How to use ADS1115 16-Bit ADC Module with ESP32
Interfacing ADS1115 16-Bit ADC Module with ESP32 to measure 16-Bit resolution & voltages using ADS1115 library & example code accuracy
- Suitable forB.Tech/Diploma ESP32/IoT students
- Build time1-2 weeks
- LevelBeginner
- Available atAjvika Labs, Kakinada
About this project
Overview
In this tutorial, we will explore the process of interfacing the
ADS1115
16-Bit ADC Module with
ESP32
. The ADS1115 breakout board is a high-resolution
analog-to-digital converter (ADC)
that can be used with various microcontrollers, including Arduino, STM32, and ESP8266/32. In particular, the
ESP32
is a powerful microcontroller with built-in Wi-Fi and Bluetooth capabilities, making it an ideal choice for IoT applications.
The ESP32 has a built-in
12-bit ADC
, which provides higher resolution than the 10-bit ADC found on Arduino boards. However, the ADS1115 boasts an even higher resolution of
16 bits
, offering superior performance in terms of voltage measurement. The smallest voltage the ESP32 can measure is
3.3V / 4096 = 0.0008V (or 0.8mV)
, while the ADS1115 can measure as low as
5V / 65536 = 0.000076V (76uV)
. This makes the ADS1115 an excellent choice when precise voltage measurements are required. If you want more precison up to 0.3uV, you may check
ADS1220 24-Bit ADC
Module.
In the following sections of this tutorial, we will provide step-by-step instructions for connecting the ADS1115 to the ESP32, configuring the I2C communication, and writing code to read and process analog signals using the Arduino IDE. By the end of this guide, you will have a solid understanding of how to interface the ADS1115 16-Bit ADC Module with the ESP32 and harness its full potential for your projects.
Bill of Materials
To thoroughly understand the ADS1115 ADC Module when used with ESP32, we require the subsequent elements:
S.N.
Components
Quantity
Purchase Link
ESP32 Board
Amazon
AliExpress
ADS1115 ADC Module
Amazon
AliExpress
16x2 I2C LCD Display
Amazon
AliExpress
10K Potentiometer
Amazon
AliExpress
Breadboard
Amazon
AliExpress
Connecting Wires
Amazon
AliExpress
ESP32 ADC Pins and Accuracy
The ESP32 is a powerful microcontroller with integrated Wi-Fi and Bluetooth capabilities. It has several analog-to-digital converters (ADC) pins, which can be used to measure analog signals and convert them into digital values. The ESP32 has two ADCs, ADC1 and ADC2, with a total of 18 available ADC channels.
ADC1 has 8 channels (GPIO32 to GPIO39)
ADC2 has 10 channels (GPIO0, GPIO2, GPIO4, GPIO12 to GPIO15, and GPIO25 to GPIO27)
Accuracy
: The ESP32’s ADCs have a resolution of 12 bits, meaning they can represent an analog signal using 4096 discrete levels. However, due to internal noise and non-linear characteristics, the effective resolution is typically around 10-11 bits.
To improve the accuracy of the ADC readings on the ESP32, you can:
Use the built-in hall sensor for calibration.
Implement oversampling and averaging to reduce noise.
Use an external voltage reference for better stability.
Consider using an external ADC module, like the ADS1115, if higher accuracy is required.
Keep in mind that ADC2 channels are shared with Wi-Fi functionalities, so if you are using Wi-Fi, it’s better to use ADC1 channels to avoid potential conflicts or interference with ADC readings.
ADS1115 Chip
The ADS1115 is a precision, low-power, 16-bit, I2Ccompatible, analog-to-digital converter IC.
Features of ADS1115
16-bit Resolution
Four (4) Channel Single-Ended or Two (2) Channel Differential Inputs
I
C Protocol Interface
Programmable Comparator
Wide Supply Range
Low Current Consumption
Continuous-Conversion Mode
Programmable Data Rate
Programmable Comparator
Single-Cycle Settling
Internal Low-Drift Voltage Reference
Internal Oscillator
Wide Operating Temperature Range
Available in Ultra-Small X2QFN Package
ADS1115 Pin Configuration
The below image shows the pin configuration of the ADS1115 chip.
Pin 1 is the ADDR pin that selects the I2C address for the chip.
Pin 2 is the Alert/Ready pin which serves as a data ready and alert signal.
Pin 3 is the GND terminal.
Pins 4, 5, 6 & 7 are the four (4) ADC input pins. We can use these pins as either four (4) single-ended inputs or two (2) differential inputs.
Pin 8 is the positive power supply pin which accepts 2.0 V to 5.5 V
Pins 9 and 10 are the terminals for the I2C interface, SDA and SCL respectively.
ADS1115 Functional Block Diagram
The following presents the functional diagram for the ADS1115 Chip:
First, a multiplexer chooses the input signal. This selected signal then enters a Programmable Gain Amplifier (PGA), which can be programmed to amplify smaller signals before the conversion takes place.
Next, a 16-bit Delta Sigma converter processes the input. This converter employs its own integrated voltage reference and oscillator for input signal measurement. Once the conversion is completed, the resulting data is sent to the I2C interface. Additionally, a comparator generates a signal for the external interface, indicating that the converted result is available for retrieval.
Typical Connections of the ADS1115
The primary I2C connections for the ADS1115 can be seen in the following image.
The ADS1115 is compatible with standard mode, fast mode, and high-speed mode I2C controllers, allowing it to interface directly with them. The ADS1115 functions with any microcontroller I2C peripheral, encompassing master-only and single-master I2C peripherals.
For more information refer to
ADS1115 Datasheet
ADS1115 Module or Breakout Board
The ADS1115 is available in X2QFN and VSSOP packages, which are not suitable for prototyping. As a result, an ADS1115 Module or Breakout Board is necessary for use with ESP32 or any other microcontroller.
These modules can be found by various manufacturers at affordable prices. Their breadboard-friendly design makes them ideal for prototyping and testing applications, allowing for easy integration.
ADS1115 Module Pinout
The ADS1115 Module has a total number of 10 Pins.
Pin. No.
Pin Name
Pin Description
VDD
Power supply: 2.0V to 5.5V
GND
Ground
SCL
Serial clock input: Clocks data on SDA (used for I2C communication)
SDA
Serial data: Transmits and receives data (used for I2C communication)
ADDR
I2C address select (slave)
ALERT/RDY
Digital comparator output or conversion ready
AIN0
Differential channel 1: Single-ended channel 1 input or Negative input
AIN1
Differential channel 1: Single-ended channel 2 input or Negative input
AIN2
Differential channel 2: Single-ended channel 3 input or Positive input
AIN3
Differential channel 2: Single-ended channel 4 input or Negative input
ADS1115 Module Schematic
The illustration displayed earlier represents Adafruit’s adaptation of the ADS1115 module.
This design adheres to the standard connection protocol for the ADS1115 chip. It features 10K ohm pull-up resistors on both the I2C and Alert pins, as well as a 1uF capacitor situated between the VDD and GND pins, functioning as a decoupling capacitor.
Interfacing ADS1115 Module with ESP32
The ESP32 wiring diagram for interfacing the ADS1115 ADC Module is straightforward.
Firstly, connect the VDD and GND Pin of the module to the 3.3V and GND Pin of the ESP32, respectively. Next, connect the ADS1115 I2C pins (SDA and SCL) to the I2C pins (SDA=GPIO21 and SCL=GPIO22) of the ESP32. The ADDR pin of the chip should be connected to either VDD, SDA, or SCL, depending on which of the addresses 0x49, 0x4A, or 0x4B you wish to use. Note that the ADDR pin is pulled down to the ground by a 10K resistor by default.
If you want to use the ALERT/READY pin of the ADS1115 module, you must connect it to an ESP32 digital pin. This pin has two uses. Firstly, you can use it for interrupt-driven conversion where it serves as a data READY signal. Secondly, you can use it with the programmable output comparator for detecting conversion thresholds. In this case, it serves as an ALERT signal.
The ADS1115 has four ADC outputs, A0, A1, A2, and A3, which means that you can connect up to four analog sensors to this module. For instance, to test the module reading, you can use a potentiometer, which you should connect according to the circ
In this tutorial, we will explore the process of interfacing the
ADS1115
16-Bit ADC Module with
ESP32
. The ADS1115 breakout board is a high-resolution
analog-to-digital converter (ADC)
that can be used with various microcontrollers, including Arduino, STM32, and ESP8266/32. In particular, the
ESP32
is a powerful microcontroller with built-in Wi-Fi and Bluetooth capabilities, making it an ideal choice for IoT applications.
The ESP32 has a built-in
12-bit ADC
, which provides higher resolution than the 10-bit ADC found on Arduino boards. However, the ADS1115 boasts an even higher resolution of
16 bits
, offering superior performance in terms of voltage measurement. The smallest voltage the ESP32 can measure is
3.3V / 4096 = 0.0008V (or 0.8mV)
, while the ADS1115 can measure as low as
5V / 65536 = 0.000076V (76uV)
. This makes the ADS1115 an excellent choice when precise voltage measurements are required. If you want more precison up to 0.3uV, you may check
ADS1220 24-Bit ADC
Module.
In the following sections of this tutorial, we will provide step-by-step instructions for connecting the ADS1115 to the ESP32, configuring the I2C communication, and writing code to read and process analog signals using the Arduino IDE. By the end of this guide, you will have a solid understanding of how to interface the ADS1115 16-Bit ADC Module with the ESP32 and harness its full potential for your projects.
Bill of Materials
To thoroughly understand the ADS1115 ADC Module when used with ESP32, we require the subsequent elements:
S.N.
Components
Quantity
Purchase Link
ESP32 Board
Amazon
AliExpress
ADS1115 ADC Module
Amazon
AliExpress
16x2 I2C LCD Display
Amazon
AliExpress
10K Potentiometer
Amazon
AliExpress
Breadboard
Amazon
AliExpress
Connecting Wires
Amazon
AliExpress
ESP32 ADC Pins and Accuracy
The ESP32 is a powerful microcontroller with integrated Wi-Fi and Bluetooth capabilities. It has several analog-to-digital converters (ADC) pins, which can be used to measure analog signals and convert them into digital values. The ESP32 has two ADCs, ADC1 and ADC2, with a total of 18 available ADC channels.
ADC1 has 8 channels (GPIO32 to GPIO39)
ADC2 has 10 channels (GPIO0, GPIO2, GPIO4, GPIO12 to GPIO15, and GPIO25 to GPIO27)
Accuracy
: The ESP32’s ADCs have a resolution of 12 bits, meaning they can represent an analog signal using 4096 discrete levels. However, due to internal noise and non-linear characteristics, the effective resolution is typically around 10-11 bits.
To improve the accuracy of the ADC readings on the ESP32, you can:
Use the built-in hall sensor for calibration.
Implement oversampling and averaging to reduce noise.
Use an external voltage reference for better stability.
Consider using an external ADC module, like the ADS1115, if higher accuracy is required.
Keep in mind that ADC2 channels are shared with Wi-Fi functionalities, so if you are using Wi-Fi, it’s better to use ADC1 channels to avoid potential conflicts or interference with ADC readings.
ADS1115 Chip
The ADS1115 is a precision, low-power, 16-bit, I2Ccompatible, analog-to-digital converter IC.
Features of ADS1115
16-bit Resolution
Four (4) Channel Single-Ended or Two (2) Channel Differential Inputs
I
C Protocol Interface
Programmable Comparator
Wide Supply Range
Low Current Consumption
Continuous-Conversion Mode
Programmable Data Rate
Programmable Comparator
Single-Cycle Settling
Internal Low-Drift Voltage Reference
Internal Oscillator
Wide Operating Temperature Range
Available in Ultra-Small X2QFN Package
ADS1115 Pin Configuration
The below image shows the pin configuration of the ADS1115 chip.
Pin 1 is the ADDR pin that selects the I2C address for the chip.
Pin 2 is the Alert/Ready pin which serves as a data ready and alert signal.
Pin 3 is the GND terminal.
Pins 4, 5, 6 & 7 are the four (4) ADC input pins. We can use these pins as either four (4) single-ended inputs or two (2) differential inputs.
Pin 8 is the positive power supply pin which accepts 2.0 V to 5.5 V
Pins 9 and 10 are the terminals for the I2C interface, SDA and SCL respectively.
ADS1115 Functional Block Diagram
The following presents the functional diagram for the ADS1115 Chip:
First, a multiplexer chooses the input signal. This selected signal then enters a Programmable Gain Amplifier (PGA), which can be programmed to amplify smaller signals before the conversion takes place.
Next, a 16-bit Delta Sigma converter processes the input. This converter employs its own integrated voltage reference and oscillator for input signal measurement. Once the conversion is completed, the resulting data is sent to the I2C interface. Additionally, a comparator generates a signal for the external interface, indicating that the converted result is available for retrieval.
Typical Connections of the ADS1115
The primary I2C connections for the ADS1115 can be seen in the following image.
The ADS1115 is compatible with standard mode, fast mode, and high-speed mode I2C controllers, allowing it to interface directly with them. The ADS1115 functions with any microcontroller I2C peripheral, encompassing master-only and single-master I2C peripherals.
For more information refer to
ADS1115 Datasheet
ADS1115 Module or Breakout Board
The ADS1115 is available in X2QFN and VSSOP packages, which are not suitable for prototyping. As a result, an ADS1115 Module or Breakout Board is necessary for use with ESP32 or any other microcontroller.
These modules can be found by various manufacturers at affordable prices. Their breadboard-friendly design makes them ideal for prototyping and testing applications, allowing for easy integration.
ADS1115 Module Pinout
The ADS1115 Module has a total number of 10 Pins.
Pin. No.
Pin Name
Pin Description
VDD
Power supply: 2.0V to 5.5V
GND
Ground
SCL
Serial clock input: Clocks data on SDA (used for I2C communication)
SDA
Serial data: Transmits and receives data (used for I2C communication)
ADDR
I2C address select (slave)
ALERT/RDY
Digital comparator output or conversion ready
AIN0
Differential channel 1: Single-ended channel 1 input or Negative input
AIN1
Differential channel 1: Single-ended channel 2 input or Negative input
AIN2
Differential channel 2: Single-ended channel 3 input or Positive input
AIN3
Differential channel 2: Single-ended channel 4 input or Negative input
ADS1115 Module Schematic
The illustration displayed earlier represents Adafruit’s adaptation of the ADS1115 module.
This design adheres to the standard connection protocol for the ADS1115 chip. It features 10K ohm pull-up resistors on both the I2C and Alert pins, as well as a 1uF capacitor situated between the VDD and GND pins, functioning as a decoupling capacitor.
Interfacing ADS1115 Module with ESP32
The ESP32 wiring diagram for interfacing the ADS1115 ADC Module is straightforward.
Firstly, connect the VDD and GND Pin of the module to the 3.3V and GND Pin of the ESP32, respectively. Next, connect the ADS1115 I2C pins (SDA and SCL) to the I2C pins (SDA=GPIO21 and SCL=GPIO22) of the ESP32. The ADDR pin of the chip should be connected to either VDD, SDA, or SCL, depending on which of the addresses 0x49, 0x4A, or 0x4B you wish to use. Note that the ADDR pin is pulled down to the ground by a 10K resistor by default.
If you want to use the ALERT/READY pin of the ADS1115 module, you must connect it to an ESP32 digital pin. This pin has two uses. Firstly, you can use it for interrupt-driven conversion where it serves as a data READY signal. Secondly, you can use it with the programmable output comparator for detecting conversion thresholds. In this case, it serves as an ALERT signal.
The ADS1115 has four ADC outputs, A0, A1, A2, and A3, which means that you can connect up to four analog sensors to this module. For instance, to test the module reading, you can use a potentiometer, which you should connect according to the circ
Technologies used
Hardware components
- ESP32
- ESP8266
- Arduino
- STM32
Software & tools
- Arduino IDE
What you get
- Working project / hardware kit, tested before delivery
- Complete source code with explanation
- Project demo and guidance for your viva
- Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed.
Payment is in two parts:
• 50% advance to start the project
• Remaining 50% before delivery
Note:
• Documentation and PPT are not included by default
• If you need documentation/PPT, it can be arranged for extra time and cost
We'll confirm the exact timeline and cost with you after reviewing your requirements.