Controlling ADC with new I2C version

leenowell
Posts: 155
Joined: Tue Jan 15, 2019 1:50 pm

Re: Controlling ADC with new I2C version

Postby leenowell » Tue Jan 07, 2025 5:56 pm

Great news.... I seem to have sorted it out :) With your help I think I am starting to understand the data sheet. So figured out that I set the ADC I am trying to read from in the config so need to do config (with first ADC) then read then config with second ADC set and then read again. They seem to be around 5mV out from my multi meter reading though but pretty close. Actually I think I was dividing by 32768 rather than 32767 so that might be it. Will rerun some tests a little later and report back :)

MicroController
Posts: 2045
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Controlling ADC with new I2C version

Postby MicroController » Tue Jan 07, 2025 8:51 pm

Great :)
So, are you getting 12 or 16 bits of resolution out of the ADC?

MicroController
Posts: 2045
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Controlling ADC with new I2C version

Postby MicroController » Tue Jan 07, 2025 8:56 pm

leenowell wrote:
Tue Jan 07, 2025 5:56 pm
They seem to be around 5mV out from my multi meter reading though but pretty close.
"A man with a watch always knows what time it is. A man with two watches never knows what time it is." ;-)

leenowell
Posts: 155
Joined: Tue Jan 15, 2019 1:50 pm

Re: Controlling ADC with new I2C version

Postby leenowell » Wed Jan 08, 2025 7:36 am

Lol. I am having the same issue trying to calibrate my thermistor. Hard to determine what the actual temp should be to then calibrate the thermistor! Different thermometers show different readings, take time to do final reading and hard keep something at even temp whilst it all happens 😀😀

With regard to the reading, I believe I am getting 16 as using 32768 to calculate the mV seems to work. So, assume I must have an ads1115.

A huge thank you once again for all your help and patience with this. I am hoping this thread will help others. Now need to figure out a neater way of setting the bits for the config to make it readable. At the moment I am doing an offline calc and putting in the decimal number 😵💫

leenowell
Posts: 155
Joined: Tue Jan 15, 2019 1:50 pm

Re: Controlling ADC with new I2C version

Postby leenowell » Wed Jan 08, 2025 7:43 am

Lol. I am having the same issue trying to calibrate my thermistor. Hard to determine what the actual temp should be to then calibrate the thermistor! Different thermometers show different readings, take time to do final reading and hard keep something at even temp whilst it all happens 😀😀

With regard to the reading, I believe I am getting 16 as using 32768 to calculate the mV seems to work. So, assume I must have an ads1115.

One thing I noticed was that I was connecting the read point to 2 pins of the ADS1x15 and also one pin to the ESP's ADC. In this mode the ESP's ADC was reading far too low but the other 2 were correct. If I then switch that to be 1 to the ADS1x15 and 2 to the ESP's ADC the ESP reads correctly (albeit not as accurate as the ADS1x15) but the ADS1x15 reads incorrectly. I assume it is because they use a different way of determining the value which conflicts? Is it worth putting an external cap to gnd from the read point? I see the ESP docs recommend a 100nF although I think the ADS1x15 has them built in so might conflict?

A huge thank you once again for all your help and patience with this. I am hoping this thread will help others. Now need to figure out a neater way of setting the bits for the config to make it readable. At the moment I am doing an offline calc and putting in the decimal number 😵💫

MicroController
Posts: 2045
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Controlling ADC with new I2C version

Postby MicroController » Wed Jan 08, 2025 7:52 am

:+1:

The ADS1015's range is +/-32k too; but all values read will be multiples of 16 (10000 binary).

leenowell
Posts: 155
Joined: Tue Jan 15, 2019 1:50 pm

Re: Controlling ADC with new I2C version

Postby leenowell » Wed Jan 08, 2025 8:44 am

Ah ok. Will run some tests then and report back. Assume the ADS1115 will have intervals of 1 then?

leenowell
Posts: 155
Joined: Tue Jan 15, 2019 1:50 pm

Re: Controlling ADC with new I2C version

Postby leenowell » Wed Jan 08, 2025 7:49 pm

I think it must be an ADS1115. The values aren't divisible by 16 and most aren;t by 8 or 4 either. There are a mix of odd and even so I assume it increments by 1.

MicroController
Posts: 2045
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Controlling ADC with new I2C version

Postby MicroController » Wed Jan 08, 2025 8:47 pm

Should be the 1115 then :)

As to the accuracies of the ADCs, yes, an extra capacitor to GND may improve the results a bit.
10-100nF should be fine.
The accuracy (and effect of the capacitor) also depend on the resistances (=impedance) of the voltage divider; lower resistance yields better results.
But you probably want to calibrate your ADC readings against one or two points of known temperature anyway to try and compensate for all deviations from ideal the real-world circuit will have.

MicroController
Posts: 2045
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Controlling ADC with new I2C version

Postby MicroController » Wed Jan 08, 2025 11:25 pm

leenowell wrote:
Wed Jan 08, 2025 7:36 am
I am having the same issue trying to calibrate my thermistor. Hard to determine what the actual temp should be to then calibrate the thermistor! Different thermometers show different readings, take time to do final reading and hard keep something at even temp whilst it all happens
Btw, cold water with a bunch of ice cubes in it tends to stay close to 0°C as long as there's still some ice in it; and boiling water (at 1013hPa) holds its temperature at 100°C as long as it's kept boiling ;-)
You can also put your thermistor into hot water together with and as close as possible to another thermometer (probe), then note the thermometer and corresponding thermistor/ADC readings as the water slowly cools down.

Who is online

Users browsing this forum: floitsch_toit and 232 guests