How to connect to an external 16Bit ADC

This tutorial will briefly describe how to connect an Adafruit ADS1115 16Bit Analog-to-digital converter (ADC) over I2C to and arduino and to Evolved Horizon.

Introduction

An external ADC is useful in addition to the on-board Arduino ADC for several reasons:

  1. The ADC-resolution is higher (15/16 Bit vs. 10/12 Bit).
  2. Adjustable sensitivity via the voltage range; ±0.256, ±0.512, ±1.024, ±2.048, ±4.096 or ±6.144 V, depending on your input data.
  3. Use up to four ADS1115 on one Arduino, expanding the analog inputs with up to 16 ports.
  4. Use as a voltage comparator, in addition to single-ended. Meassure a difference in voltage between to end points.

The ADS1115 samples data at a frquency of ~800/#channels. Hence, if you only have one channel, you will get ~800 samples per second (SPS), and if you use all four channels you will have ~200 SPS.

Hardware & Wiring

The ADS1115 looks like this, when the 10 pins has been soldered (there exist a more detailed wiring tutorial on Adafruit homepage):

The pins are described below (from left to right)

  1. VDD. Connect this to your Arduinos 5V output (you may use the 3.3V, but the max input voltage is VDD + 0.3V. OBSERVE: IT IS NOT RECOMMENDED TO MEASURE INPUT VOLTAGES MORE THAN VDD)
  2. GND. Connect this to the Arduino “GND” i.e., ground
  3. SCL. I2C Communication. Connect this to the “SCL” on the Arduino. (Either a dedicated port “SCL” or shared in a digital one, PIN 21 on MEGA and DUE).
  4. SDA. I2C Communication. Connect this to the “SDA” on the Arduino. (Either a dedicated port “SDA” or shared in a digital one, PIN 20 on MEGA and DUE).
  5. ADDR. I2C address. Here you have four options: connect this one to the previous four pins (VDD, GND, SCL, SDA) to set the address. default in Evolved Horizon is “GND”.
  6. ALRT. Alert. Not used in Evolved Horizon.
  7. A0. Analog input port 0.
  8. A1. Analog input port 1.
  9. A2. Analog input port 2.
  10. A3. Analog input port 3.

The following connections are valid for the differential case: A0-A1, A0-A3, A1-A3, A2-A3.

Evolved Horizon Configuration

Now, lets configure the channel in Evolved Horizon, see screenshot below. Please note. you must use Evolved Horizon 1.18+ and Arduino Firmware 1.5.1.7+ (included in the Evolved Horizon release). Tutorial on how to update an Arduino firmware may be found here: How to Upload Firmware to an Ardunio

Add the ADS1115 4-channel 16Bit ADC by constructing a new Evolved Horizon channel; choose a suitable Id, scale equation and input mode.

The most important settings in the Evolved Horizon Module Creation interface will be discussed below:

  • Id As always, the “Id” parameters is most important that relates this module to all others.
  • Scale parameter to enter your own custom scale-equation, e.g., “2*x-x^2/6”. Since the value obtained from the ADS1115 is voltage, you might want to scale it to pressure, temperature, or any other physical quantity.
  • Address (i.e., PIN #5 as described above)
  • Input is all the available input modes i.e., the single ended modes A0, A1, A2, A3 and differential modes A0-A1, A0-A3, A1-A3, A2-A3). Please note that the single ended is only positive values; thus the effective ADC resolution is 16-1=15 Bits, removing the sign-bit.
  • Gain is the voltage range, as described above. Possible values are ±0.256, ±0.512, ±1.024, ±2.048, ±4.096 or ±6.144 V. Values will be truncated outside the interval. NOTE: NO INPUT ABOVE VDD (3.3/5V)…
  • Unit Enter the physical unit (e.g., Voltage, Pressure, or Temperature, C)

Summary

You are now ready to sample voltage data at 15/16 Bits resolution. Connect single ended sensors to it; measure a voltage difference in e.g., Wheatstone bridges.

Did you like this tutorial? Something missing? Contact us at info@stardots.se