Hello, I am using an ads1115 of the adafruit brand, I have it connected to pins a0 and a1 of my photon using sda / scl, connect it to 3.3v and ground, the addr is default on the gnd pin, I have connected to the inputs of the ads an ozone sensor spec where a0-vgas, a1-vref, a2-vtemp, but when it gives me the data it always gives me the same data in each of the inputs, I was investigating and according to this modifying the ADS1115_CONVERSIONDELAY to 9 it could work but Still not doing it for this I am using the Adafruit_ADS1x15 library, does anyone know why this happens or could you give me ideas for modifications? Thanks in advance
I add the code that I am using
If you get the same value irrespective whether you use the right or the wrong pins chances are that you are not getting any values at all
Maybe it’s time to track back and first find out whether your can talk to the board at all.
Usually that’s best done via an I2C scanner sketch like this
What ADS1115 board are you using?
Does it feature pull-up resistors?
What device OS version are you targeting?
But the command would be particle serial monitor --follow rather than particle monitor serial
You are trying to monitor the cloud variables a device called serial would expose, but I suppose you don’t have a so called device and hence the No matching device is telling the truth, I’d guess.
ADS1115 16-Bit ADC - 4 Channel with Programmable Gain Amplifier, these modules use the I2C interface and include the power conditioning and pull-up/pull-down resistors needed to basically make it plug-and-play to get up and running doing basic A-D conversions very easily, and the version is 2.0.0,
and can’t find the device
Can’t see anything wrong with that.
You could try adding another set of 10k pull-up resistors in parallel or supply from Vin (5V) to see whether the I2C scanner can then see the board.
It could also be that either one of your I2C pins on the Photon is damaged or the ADS board is dead - it could even be that the breadboard has no good contact.
To test that I’d pull out a logic analyzer or oscilloscope to see whether there is any communication going on between the two at all.
If you had another Photon and/or ADS115 board (or other I2C device) swapping them out may also provide some more insight.
Aside from a problem with the I2C on either the ADS1115 module or the Photon - the I2C scanner should return address 0x48 - once you have that working then the rest should follow.
A couple of observations on the code that you posted at the top of this topic:
#include <Wire.h> is not required because this is included by default.
In setup() Wire.begin(); isn’t required before ads.begin(); because that’s all that ads.begin() does.
To read a single channel you use Vtemp = ads.readADC_SingleEnded(2); as you have done but the function does not return a float but rather an unsigned 16 bit number. This then needs to be scaled - it is reading an analog voltage and converting into a binary number (1 bit = 0.0078125mV with the gain you have set).