How to Increase Arduino ADC Precision with ADS1115

The Arduino boards have 10 bits ADC, but some applications require more precision such as audio processing, battery capacity and current monitoring, high accuracy measurement of sensor signal whose magnitude is very small in the range of mV. In such cases, one can use ADS1115 ADC IC which has 16-bit resolution with Arduino to read reliably the small signal. Thus, we can increase the ADC resolution of Arduino. 

Circuit Diagram

The following circuit diagram shows how to interface ADS1115 ADC with Arduino.

arduino ADS1115 interfacing circuit diagram

Program Code

The following is the program code that reads the ADC value from the ADS1115 and displays on serial monitor.

#include <Wire.h>
#include <Adafruit_ADS1X15.h>

Adafruit_ADS1115 ads;  /* Create an instance of the ADS1115 */

void setup(void) {
  Serial.begin(9600);
  Serial.println("Initializing ADS1115...");

  // The ADC gain can be changed to allow for different voltage ranges:
  // ads.setGain(GAIN_TWOTHIRDS);  // 2/3x gain +/- 6.144V  1 bit = 0.1875mV (default)
  // ads.setGain(GAIN_ONE);        // 1x gain   +/- 4.096V  1 bit = 0.125mV
  // ads.setGain(GAIN_TWO);        // 2x gain   +/- 2.048V  1 bit = 0.0625mV
  
  if (!ads.begin()) {
    Serial.println("Failed to initialize ADS1115. Check wiring!");
    while (1);
  }
}

void loop(void) {
  int16_t adc0;
  float volts0;

  // Read the raw value from Channel 0
  adc0 = ads.readADC_SingleEnded(0);

  // Convert raw value to Volts (assuming default 2/3 gain)
  // 1 bit = 0.1875mV = 0.0001875V
  volts0 = adc0 * 0.0001875;

  Serial.print("Raw ADC Value: ");
  Serial.print(adc0);
  Serial.print(" | Voltage: ");
  Serial.println(volts0, 4); // Display with 4 decimal places

  delay(500);
}
  
  
Now the circuit diagram and the code is explained below.

The ADS1115 is an
I2C device, and so it only requires two signal wires (SDA and SCL) to communicate with the Arduino, regardless of how many channels (A0–A3) you are reading.

1. The Wiring Connections (Pin-to-Pin)

ADS1115 PinArduino Uno PinFunctionRequirement
VDD5VPower SupplyPowers the IC (2.0V – 5.5V compatible).
GNDGNDGroundCommon ground for signal reference.
SCLA5I2C ClockSerial Clock line for data timing.
SDAA4I2C DataSerial Data line for bit transfer.
ADDRGNDAddress SetSets I2C address to 0x48 (as defined in code).
A0Signal SourceAnalog InputThe voltage you want to measure (0–5V max).
Try the ADS1115 Chip explorer web tool which shows the pin details instantly instead of reading the datasheet.

2. Circuit Diagram Logic

A. The I2C Bus (A4 & A5)

The Arduino Uno uses dedicated pins for I2C: A4 (SDA) and A5 (SCL).

  • Pull-up Resistors: While the Arduino has internal pull-ups, for 16-bit precision, it is highly recommended to use external $4.7k\Omega$ or $10k\Omega$ resistors connected from SDA/SCL to 5V. This ensures the signal "edges" are sharp, preventing data errors.

B. The Address Pin (ADDR)

In the code provided below, we initialize the sensor with ads.begin(). By default, the library looks for address 0x48.

  • To match this code, the ADDR pin must be wired to GND. If you leave it floating or wire it to VDD, the code will fail to find the sensor.

C. The Analog Input (A0)

Since the code calls ads.readADC_SingleEnded(0), the circuit expects your sensor or voltage source to be connected to Pin AIN0.

  • Voltage Limit: Because we are powering the ADS1115 with 5V from the Arduino, you must ensure the input on A0 does not exceed 5V.


3. How the Circuit Works with the Code

  1. Initialization: When ads.begin() is called, the Arduino sends a "Start" condition over A4/A5 to the address 0x48. If the ADDR pin is grounded, the ADS1115 wakes up and acknowledges.

  2. Configuration: The code sets the Gain. If using GAIN_TWOTHIRDS, the internal PGA (Programmable Gain Amplifier) is set to handle a range up to +/- 6.144V. Even though the range is 6V, our circuit limits us to 5V because of the Arduino's power rail.

  3. Conversion: When readADC_SingleEnded(0) is executed, the ADS1115 samples the voltage on A0 relative to GND, converts it to a 16-bit number, and sends it back to the Arduino via the I2C bus.

  4. Math: The Arduino takes that raw number and multiplies it by 0.0001875 (the voltage value of 1 bit at that gain) to give you the final voltage on the Serial Monitor.

The 10kohm potentiometer which acts the sensor is connected to AIN0 pin of the ADS1115 ADC. By changing the potentiometer value the analog value is converted to 16-bit values and sent to arduino using the I2C connection. The Arduino after getting the value is sent to serial port. The following shows the values read by Arduino on the serial terminal/serial monitor.

ADS1115 analog values

The following video shows how the above circuit works.





 

Post a Comment

Previous Post Next Post