
0 volts represents 0 digital value and 6.144 volts represents 32767 as a digital value. In default mode, the reference voltage value is +/-6.144 volts. The weight of every bit can be defined with Programmable Gain Amplifier (PGA) by setting a reference voltage value. These 15 bits are used to get the magnitude of voltage through I2C communication. Possible output digital values will be between 0-32767. We get 2^15 = 32,768 possible output values for every analog input. Therefore, only 15 bits are used to measure the voltage and ADC resolution is calculated according to according to 15 bits. From total 16 bits, one bit is assigned for positive and negative number. It provides output in signed integer format. We can interface it with any microcontroller having I2C communication support.ĪDS1115 is a 16 bit I2C ADC having four analog channels. In single ended differential mode, it is used to measure positive voltages only and in comparator mode, it can measure both positive and negative voltages ( useful when you want to measure voltage of battery). It works in Single Ended, Differential and comparator mode. It can be used in to measure both positive and negative voltages. ADS1115 is a 16-bit analog to digital converter that consists of four analog channels. Built-in adc can not measure 1mV accurately and so is ESP32. LM35 temperature sensor gives output of 1mv per one degree centigrade of temperature. Interfacing issues : For example, you want to interface LM35 temperature sensor with ESP32, you can not connect it directly due to low resolution and inaccurate behavior of built analog to digital converter of ESP32. Therefore, we can used an external ADC with this development board to resolve problem of measuring analog signal with high accuracy. Low resolution issue : Other than the issue of non-linear behavior and low resolution of built-in analog to digital converter, ESP32 has all excellent features required for internet of things project. Reasons to use External analog to digital converter are mentioned below: In order to resolve these issues, we can use external high resolution programmable ADC IC. It can not differentiate between 1mv and 2mv signals which means it offers very low resolution.
But, the main issue of ESP32 ADC’s is that it has a non-linear characteristics and it exhibits non-linear behavior as explained in already posted ESP32 ADC tutorial.
Esp32 arduino i2c example code#
Code working Why we need to use external ADC with ESP32?Īlthough, ESP32 has two built-in ADC modules namely ADC0 and ADC1 and each channel is of 12-bits.Interfacing ADS1115 external ADC with ESP32.Why we need to use external ADC with ESP32?.