Hi,
I'm testing the ADS1115 component and I've noticed some strange behavior. Basically, in the code, if I select only channel A0 on the UART output, which I read with a serial program, I read the correct value as ch1. The same thing happens if I select only A1, excluding A0 from the program, I correctly read the value as ch2. However, if I activate both channels, the value I should read on ch1 (A0) is seen on ch2, and the value of ch2 (A1) is seen on ch1, as if the two channels ch1 and ch2 were reversed. I also wanted to ask how the ALERT/RDY pin is set, and if it isn't, how to set it as RDY and how to handle it correctly.
Do you have sample code for reading two or more channels? I couldn't find anything in the forum or on the wiki.
I'm attaching the code.
Thanks
ADS1115 PROBLEM
-
- Posts: 122
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 10, 2020 5:40 pm
- Been thanked: 10 times
-
- Valued Contributor
- Posts: 1083
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 203 times
- Been thanked: 229 times
Re: ADS1115 PROBLEM
Hi Max.tisc
1.Can you try out change ADS1115 to read Continus mode?
2.Set I2C clock to 400kHz and Samples per second to 64 (later back to 8 or 16)
3.Test the IRQ from the STM32F411 if it is 0.25Hz
Mode: I2C clock Samples per second:
1.Can you try out change ADS1115 to read Continus mode?
2.Set I2C clock to 400kHz and Samples per second to 64 (later back to 8 or 16)
3.Test the IRQ from the STM32F411 if it is 0.25Hz
Mode: I2C clock Samples per second:
Re: ADS1115 PROBLEM
Hi,
1) I've already tried continuous mode with no results.
2) I've already tried 400kHz. I'll try sampling rate adjustment later.
3) Why 0.25Hz?
Thanx
1) I've already tried continuous mode with no results.
2) I've already tried 400kHz. I'll try sampling rate adjustment later.
3) Why 0.25Hz?
Thanx
-
- Valued Contributor
- Posts: 1083
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 203 times
- Been thanked: 229 times
Re: ADS1115 PROBLEM
Hi Max.tisc
One more question: Isn't 9600 Bd a little slow for the Uart?
Your setup from the IRQ:
It shows 0.25Hz
One more question: Isn't 9600 Bd a little slow for the Uart?
Your setup from the IRQ:
It shows 0.25Hz
Re: ADS1115 PROBLEM
Hi,
I tried your suggestions. I reset it to 400kHz, sampled at 64, then went down to 16 and 8. I increased the baud rate to the maximum, set it to continuous mode, and I actually initially set the IRQ rollover value to 15600 to get 1 second. I don't know why it reverted to 65536.
The values for ch1 and ch2 remain reversed. ch1 should read 0.68 and ch2 -0.25 since nothing is connected to it.
Thanks
I tried your suggestions. I reset it to 400kHz, sampled at 64, then went down to 16 and 8. I increased the baud rate to the maximum, set it to continuous mode, and I actually initially set the IRQ rollover value to 15600 to get 1 second. I don't know why it reverted to 65536.
The values for ch1 and ch2 remain reversed. ch1 should read 0.68 and ch2 -0.25 since nothing is connected to it.
Thanks
- Attachments
-
- Screenshot 2025-09-23 175023.png (298.02 KiB) Viewed 128 times
-
- Valued Contributor
- Posts: 1083
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 203 times
- Been thanked: 229 times
Re: ADS1115 PROBLEM
Hi Max.tisc
I tested it with my hardware on ESP32 and ADS1115.
You're right. Something is wrong.
Sometimes the value jumps from one channel to the another.
I suspect that 3channel is also causing problems.
I tested it with my hardware on ESP32 and ADS1115.
You're right. Something is wrong.
Sometimes the value jumps from one channel to the another.
I suspect that 3channel is also causing problems.
-
- Valued Contributor
- Posts: 1083
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 203 times
- Been thanked: 229 times
Re: ADS1115 PROBLEM
Can you make a test?
Set Samples per second to 860 ?
On my program it helps....
Ch1, Ch2, Ch3 are ok
Set Samples per second to 860 ?
On my program it helps....
Ch1, Ch2, Ch3 are ok
- Attachments
-
- 2025-09-24_10-29-25.PNG (11.81 KiB) Viewed 100 times
-
- Valued Contributor
- Posts: 1083
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 203 times
- Been thanked: 229 times
Re: ADS1115 PROBLEM
I found this Info
I think you need to leave a minimum delay between the two read values.
This depends on the samples per second you choose..
Here are the minimum values for the delay
I think you need to leave a minimum delay between the two read values.
This depends on the samples per second you choose..
Here are the minimum values for the delay
Re: ADS1115 PROBLEM
THANKS stefan.erni
Setting it to 860 works. One question: I'm not using the ALLERT/RDY pin right now, so can it be ignored?
Setting it to 860 works. One question: I'm not using the ALLERT/RDY pin right now, so can it be ignored?