ADS1115: analog-digital converter for Arduino

ADS1115

For those projects where an analog to digital signal conversion is necessary, and the microcontroller used does not have this capacity, it is interesting to have this type of ADS1115 module, which provides that ADC conversion capability with 16-bit precision.

Furthermore, this electronic component it may also be interesting to extend the conversion capabilitiesEven if the microcontroller you are using for your project has this capability but you need something else.

A / D and D / A converters

Analog vs digital signal

There are two types of signal converters fundamental, although there are also other chips capable of doing both types of conversion at the same time. These are:

  • CAD (Analog to Digital Converter) or ADC (Analog-to-Digital Converter): is a type of device that converts the analog signal into a digital signal. To do this, you can use a binary code that encodes the analog signal. For example, associating a binary value with a specific voltage or current value. For example, with 4-bit resolution it can go from 0000 to 1111, and it could correspond to 0v and 12v respectively. Although if a sign bit is used, negative and positive values ​​can be measured.
  • CDA (Digital to Analog Converter) or DAC (Digital-to-Analog Converter): it is a device that does the opposite of the above, that is, it transforms binary data into an analog current or voltage signal.

With these converters it is possible to pass from one type of signal to another, as you will see in the case of ADS1115, which would correspond to the first case.

About the ADS1115

pinout ADS1115

The ADS1115 is a signal converter module. What it does is convert from analog to digital. You may think that the Arduino development board itself already includes internal ADCs to be able to do this task when using the analog inputs and that they can be compatible with the microcontroller signals.

Yes, that's right, they have 6 10-bit resolution ADCs in the UNO, Mini and Nano. But with the ADS1115 you add another with a 16-bit resolution, superior to the Arduino, in addition to being able to free the Arduino case. Fifteen of them are for the measurement and a last bit for the sign of the analog signal, since as you know, the analog signal can be negative or positive.

In addition, this module provides everything you need, so that its use is very simple. To connect it to your Arduino you can use the I2CTherefore it's really simple. It even includes a pin marked ADDR with which you can select one of the 4 addresses available for this component.

On the other hand, you have to understand that the ADS1115 has two measurement modes, one is the differential and another the single ended:

  • Differential: it uses two ADCs for each measurement, reducing the number of channels to 2, but it provides a clear advantage, which is that it can measure negative voltages and is not as vulnerable to noise.
  • Single ended: it has four channels by not using both as in the previous case. Each of the 15-bit channels.

In addition to these modes, it includes a comparator mode in which an alert is generated through the ALRT pin when any of the channels exceeds a threshold value that can be configured in the source code of the sketch.

If you want to do measurements less than 5v, but with higher precisions, you should know that the ADS1115 has a PGA that can adjust the voltage gain from 6.144v to 0.256v. Always bearing in mind that the maximum voltage that can be measured in any case will be the power supply voltage used (5v).

Pinout and datasheet

If you want to see all the technical details of the ADS1115 to know its limits at an electronic level or the conditions under which it can operate according to the manufacturer's recommendations, you can use the datasheets that you can find on the net. For example, you can download this from TI (Texas Instruments).

For, the pinout and connected, previously I have already commented something about the ALRT signal that also includes about ADDR. But it has other pins that you should also know for a correct integration with your Arduino board or for any other case. The pins available on the ADS1115 module are:

  • VDD: supply with 2v to 5.5v. You can power it by connecting it to 5v from your Arduino board.
  • GND: ground that you can connect to GND of your Arduino board.
  • SCL and SDA: communication pins for the I2C. In this case they must go to the appropriate pins according to your arduino model.
  • ADDR: pin for the address. By default it connects to GND, which gives the address 0x48, but you can choose other addresses:
    • Connected to GND = 0x48
    • Connected to VDD = 0x49
    • Connected to SDA = 0x4A
    • Connected to SCL = 0x4B
  • ALRT: alert pin
  • A0 to A3: analog pins

If you want to use single end You can connect the analog current or voltage you want to measure between GND and one of the 4 available analog pins.

For connection single end, we simply connect the load to be measured between GND and one of the 4 available pins. For differential mode you can connect the load to be measured between A0 and A1 or between A2 and A3, depending on the channel you want to use.

Arduino ADS1115 diagram

As an example of connection in the case of a differential reading mode, you can see the above image. In it 1.5 batteries are used in series, adding 3v that are connected between A0 and A1 in this case so that the Arduino board can measure the voltage values ​​obtained at each moment through the I2C. Obviously, you can use any other signal to measure, in this case they are batteries, but it can be whatever you want ...

Where to buy the ADS1115?

ADS1115 module

Si quieres buy the ADS1115You should know that you have modules prepared to integrate with Arduino for quite cheap prices. You can find them in a multitude of specialized electronics stores, as well as on eBay, Aliexpress and Amazon. For example:

Integration with Arduino

Screenshot of Arduino IDE

To get started, the first thing is install library corresponding in your Arduino IDE. For this, you can use the most famous, that of Adafruit. To do this, you can follow these steps:

  1. Open Arduino IDE
  2. Go to the Sketch menu
  3. Then to Include Library
  4. Manage libraries
  5. In the search engine you can search for Adafruit ADS1X15
  6. Click on Install

Now you are ready to start, you can access the code of the installed library or the examples available in:

  1. Open Arduino IDE
  2. Go to File
  3. Examples
  4. And in the list look for the ones in this library ...

Among the examples you will see both for the comparator mode, differential mode and single end mode. You can see the examples to start using them and modify them according to your needs or write more complex code. For more information, I advise you our free introductory course in PDF.


The content of the article adheres to our principles of editorial ethics. To report an error click here!.

A comment, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Pedro said

    In differential mode can I use it to measure between + 5V and - 5V?