UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

ADS1115 Class

Module: ads1x15

The ADS1113, ADS1114, and ADS1115 are precision analog-to-digital converters (ADCs) with 16 bits of resolution offered in an ultra-small, leadless QFN-10 package or an MSOP-10 package. The ADS1113/4/5 are designed with precision, power, and ease of implementation in mind. The ADS1113/4/5 feature an onboard reference and oscillator. Data is transferred via an I2C-compatible serial interface; four I2C slave addresses can be selected. The ADS1113/4/5 operate from a single power supply ranging from 2.0V to 5.5V. The ADS1113/4/5 can perform conversions at rates up to 860 samples per second (SPS). An onboard PGA is available on the ADS1114 and ADS1115 that offers input ranges from the supply to as low as +/- 256mV, allowing both large and small signals to be measured with high resolution. The ADS1115 also features an input multiplexer (MUX) that provides two differential or four single-ended inputs. The ADS1113/4/5 operate either in continuous conversion mode or a single-shot mode that automatically powers down after a conversion and greatly reduces current consumption during idle periods. The ADS1113/4/5 are specified from -40 deg C to +125 deg C.
Tested with DIYMall ADS1115 board. Also available from Adafruit: https://www.adafruit.com/products/1085
ads1115.jpg

Methods

ADS1115

(
  • bus
  • address
)
Number

ADS1X15 constructor

Parameters:

  • bus Number

    i2c bus the sensor is attached to.

  • address Number

    Device address. Default is 0x48.

Returns:

Number:

setSPS

(
  • rate
)

Sets the sample rate of the device. This function needs to be overridden in subclasses as the ADS1115 and ADS1015 have different sample rates.

Parameters:

  • rate ADSDATARATE

    ADSSAMPLERATE enum

Properties

SPS_8

Enum ADSDATARATE

SPS_16

Enum ADSDATARATE

SPS_32

Enum ADSDATARATE

SPS_64

Enum ADSDATARATE

SPS_128

Enum ADSDATARATE

SPS_250

Enum ADSDATARATE

SPS_475

Enum ADSDATARATE

SPS_860

Enum ADSDATARATE