# Coding for conductivity measurement using Arduino and 16 bit ADC

I am using a 16 bit ADC (Adafruit) connected to Arduino UNO through I2C. When I use differential mode to measure water conductivity (I plug jumper wires into pins A0 and A1 on the ADC), my numbers are always fluctuating, and always different. Even if I touch the two pins together I always get crazy values that are always different. Sometimes my values even go past 65,000, for example it'll show one hundred thousand or the digit in the ten thousands place (the 1 in 10,000 for example) will increase while all of the other digits stay the same. For example, it might fluctuate between 9355 and 15355, or sometimes even jump between 10,000 and 100,000. I have tried differential and single ended, neither work. I feel like differential would work better in theory because it would minimize noise but that really hasn't happened in reality.

Is the problem with my design? I have a very simple design, just the arduino connected to the ADC through a breadboard, and two wires going out of A0 and A1. No capacitors, no resistors, etc. The ADC address is 0x48, so I have the ADR pin connected to GND.

Or is the problem with my software? I looked at many other websites and can't seem to find how to change my code. Here is the Arduino code:

#include <Adafruit_ADS1015.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

void setup() {
Serial.begin(9600);
lcd.begin(16,2);

; }

void loop() {
int16_t results;

• "Sometimes my values even go past 65,000..." - results is a 16 bit signed integer, so it cannot be larger then 32767. If your LCD is displaying larger numbers it is not the fault of the ADC. – Bruce Abbott May 15 at 23:26