Skip to content

Latest commit

 

History

History
45 lines (30 loc) · 1.44 KB

ADS1X15.md

File metadata and controls

45 lines (30 loc) · 1.44 KB

ADS1x15 programmable gain ADC

  • KEYWORDS: Module,I2C,ADS1x15,ADS1015,ADS1115,ADC,Analog to Digital Converter,Programmable Gain

The ADS1015 (12 bit) / ADS1115 (16 bit) is a 4 channel, programmable gain Analog to Digital converter made by TI (datasheet).

Support is included in the [[ADS1X15.js]] module.

Wiring

If you're using the Adafruit modules, connect them as per Adafruit's documentation, making sure you connect SDA and SCL to I2C-capable pins on Espruino.

Software

Just 'connect' the module to the correct I2C port and call getADC to get a value. Because conversion can take around 8ms, getADC uses a callback - which allows Espruino to do other things in the background.

I2C1.setup({ scl : ..., sda: ...} );
var ads = require("ADS1X15").connect(I2C1);
ads.setGain(256); // +/- 0.256mV
ads.getADC(0, function(val) {
  console.log("Read ADC value: "+val);
});

API reference

  • APPEND_JSDOC: ADS1X15.js

Using

  • APPEND_USES: ADS1X15

Buying

The ADS1015 is available in chip form, however:

  • Adafruit sell the ADS1115 (16 bit) or the ADS1015 (12 bit) on a breakout board