This tutorial is intended for users of Evolved Horizon – a software for acquiring, visualizing, storing and analyzing sensor data from Arduinos. If you have any questions contact us at firstname.lastname@example.org. The 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.
An external ADC is useful in addition to the on-board Arduino ADC for several reasons:
- The ADC-resolution is higher (15/16 Bit vs. 10/12 Bit).
- 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.
- Use up to four ADS1115 on one Arduino, expanding the analog inputs with up to 16 ports.
- 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)
- 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)
- GND. Connect this to the Arduino “GND” i.e., ground
- 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).
- 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).
- 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”.
- ALRT. Alert. Not used in Evolved Horizon.
- A0. Analog input port 0.
- A1. Analog input port 1.
- A2. Analog input port 2.
- 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 184.108.40.206+ (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
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)
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 email@example.com