Arduino and ADS1015 analog-to-digital converters

The ADS1015 is a precision analog-to-digital converters (ADCs) with 12 bits of resolution offered in an ultra-small, leadless QFN-10 package or an MSOP-10 package. The ADS1015 are designed with precision, power, and ease of implementation in mind. The ADS1015 features an onboard reference and oscillator. Data are transferred via an I2C-compatible serial interface; four I2C slave addresses can be selected. The ADS1015 operate from a single power supply ranging from 2.0V to 5.5V.

The ADS1015-Q1 device can perform conversions at rates up to 3300 samples per second (SPS). An onboard PGA is available that offers input ranges from the supply to as low as ±256 mV, allowing both large and small signals to be measured with high resolution. The ADS1015-Q1 device also features an input multiplexer (MUX) that provides two differential or four single-ended inputs.

The ADS1015-Q1 device operates 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

 

Schematics

 

Code

In this example you need the adafruit library

#include <Wire.h>
#include <Adafruit_ADS1015.h>
 
Adafruit_ADS1015 ads;     /* Use thi for the 12-bit version */
 
void setup(void) 
{
  Serial.begin(9600);
  Serial.println("Getting single-ended readings from AIN0..3");
  ads.begin();
}
 
void loop(void) 
{
  int16_t adc0, adc1, adc2, adc3;
 
  adc0 = ads.readADC_SingleEnded(0);
  adc1 = ads.readADC_SingleEnded(1);
  adc2 = ads.readADC_SingleEnded(2);
  adc3 = ads.readADC_SingleEnded(3);
  Serial.print("AIN0: "); Serial.println(adc0);
  Serial.print("AIN1: "); Serial.println(adc1);
  Serial.print("AIN2: "); Serial.println(adc2);
  Serial.print("AIN3: "); Serial.println(adc3);
  Serial.println(" ");
 
  delay(1000);
}

 

Testing

Open the serial monitor and you should see something like this

AIN0: 1683
AIN1: 216
AIN2: 180
AIN3: 184

AIN0: 1687
AIN1: 229
AIN2: 184
AIN3: 175

AIN0: 1684
AIN1: 237
AIN2: 201
AIN3: 194

AIN0: 1684
AIN1: 237
AIN2: 288
AIN3: 1566

 

Links

1pcs ADS1015 ADC ultra-compact 12-precision ADC module development board

Related posts

Arduino Uno and HMC5983 magnetometer example

Arduino and PCF8563 RTC example

Arduino and Rotary encoder example

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Read More