My voltage divider quit working - this is weird?

zirconx

Joined Mar 10, 2010
97
I'm working on a system to monitor my sump pit, using a raspberry pi. I have a ADS1115 adc board hooked up to read in analog voltage from various sensors. One channel of the ADS1115 monitors the 5v into the raspberry pi. I am powering the pi by back feeding 5v into the expansion header and want to keep an eye on the voltage.

I use a voltage divider to divide the 5v in half, to bring it within the range of the ADS1115 (max voltage it can read is 3.3v). It was working fine, reading a nice solid 2.52 volts. Then when I checked it again 5 minutes later it was reading a fluctuating value of 2.8 - 3.2! I was not near the board at this time, I was monitoring the data remotely from my desktop computer through an SSH session.

I immediately went downstairs and put a DVM on the 5v pin - it reads a steady 5.04v. I measured the pin on my ADS1115 adc - indeed it is fluctuating between 2.8 and 3.2. Do you think one of the resistors might have gone bad? I can't remember what value I used, I think they were 1k or 2k or something like that. My first thought is to power everything down, disconnect the expansion cable, and measure the ohms of the resistors. Like I said it was working perfectly, so I know I used the same value for each one. I'm pretty new to building circuits so wanted to ask if there was anything obvious I might be missing. Thanks.

Here is some output from the 3 inputs I have connected to the ADC. Channel 0 is the 5v voltage divider.
Code:
CH_0 = 2.92 V | CH_1 = 2.158 V | CH_2 = 0.376 V
CH_0 = 2.93 V | CH_1 = 2.158 V | CH_2 = 0.376 V
CH_0 = 2.88 V | CH_1 = 2.158 V | CH_2 = 0.376 V
CH_0 = 2.89 V | CH_1 = 2.158 V | CH_2 = 0.376 V
CH_0 = 2.91 V | CH_1 = 2.158 V | CH_2 = 0.377 V
CH_0 = 2.92 V | CH_1 = 2.158 V | CH_2 = 0.377 V
CH_0 = 2.85 V | CH_1 = 2.158 V | CH_2 = 0.377 V
CH_0 = 2.86 V | CH_1 = 2.158 V | CH_2 = 0.377 V
CH_0 = 2.88 V | CH_1 = 2.158 V | CH_2 = 0.377 V
CH_0 = 2.89 V | CH_1 = 2.158 V | CH_2 = 0.377 V
CH_0 = 2.93 V | CH_1 = 2.158 V | CH_2 = 0.376 V
CH_0 = 2.86 V | CH_1 = 2.158 V | CH_2 = 0.376 V
CH_0 = 2.88 V | CH_1 = 2.158 V | CH_2 = 0.376 V
CH_0 = 2.87 V | CH_1 = 2.158 V | CH_2 = 0.376 V
CH_0 = 2.84 V | CH_1 = 2.158 V | CH_2 = 0.377 V
CH_0 = 2.83 V | CH_1 = 2.158 V | CH_2 = 0.377 V
CH_0 = 2.89 V | CH_1 = 2.158 V | CH_2 = 0.377 V
CH_0 = 2.85 V | CH_1 = 2.158 V | CH_2 = 0.378 V
CH_0 = 2.88 V | CH_1 = 2.158 V | CH_2 = 0.378 V
CH_0 = 2.88 V | CH_1 = 2.158 V | CH_2 = 0.378 V
CH_0 = 2.86 V | CH_1 = 2.158 V | CH_2 = 0.378 V
CH_0 = 2.87 V | CH_1 = 2.158 V | CH_2 = 0.378 V
CH_0 = 2.93 V | CH_1 = 2.158 V | CH_2 = 0.377 V
CH_0 = 3.07 V | CH_1 = 2.158 V | CH_2 = 0.377 V
CH_0 = 2.89 V | CH_1 = 2.158 V | CH_2 = 0.377 V
CH_0 = 3.04 V | CH_1 = 2.158 V | CH_2 = 0.377 V
CH_0 = 2.87 V | CH_1 = 2.158 V | CH_2 = 0.376 V
CH_0 = 2.91 V | CH_1 = 2.158 V | CH_2 = 0.377 V

Attachments

• 1.3 MB Views: 9

MrSoftware

Joined Oct 29, 2013
1,669
First check your connections, maybe something is loose. Second what are your resistor values, and is there anything nearby that might cause electrical noise?

SamR

Joined Mar 19, 2019
1,650
Did you disconnect the input from the mux and measure the V?

zirconx

Joined Mar 10, 2010
97
First check your connections, maybe something is loose. Second what are your resistor values, and is there anything nearby that might cause electrical noise?
I did check the resistors and made sure they were still solidly soldered in place. The other channels on my ADC read correctly so I don't think there is a problem with the connections to the ADC. And if channel 0 was loose/bad, I would expect the reading to fluctuate between 2.5 and 0v.

Did you disconnect the input from the mux and measure the V?
I don't know what mux is, but I did check the 5v out of my power supply / into the pi and it reads 5.04v.

I also measured from the GND pin shown in the picture to my battery ground and I get 7mv. So I think that shows that my ground connection is ok.

FYI my power supply is a 12v marine battery feeding a mini360 buck converter adjusted to 5v output.

zirconx

Joined Mar 10, 2010
97
Here's the the other odd thing I just realized. CH_2 was reading 1.2v around the time everything was working. As you can see in my data dump above, it's now reading around .37v.

MisterBill2

Joined Jan 23, 2018
4,903
You may simply have multiplexer problems, that does happen even with larger computer systems. Charge storage and bleeding over to open multiplexer channels. And the noise voltage is not that large, it may be noise that does not appear on your meter.

zirconx

Joined Mar 10, 2010
97
I don't think there is any nearby noise. It's in my storage room, no other electronics are in there. Other than the sump pump, which isn't running.

I added a 10uf cap from 5v to ground, that didn't do anything.

MisterBill2

Joined Jan 23, 2018
4,903
It may also be multiplexer channel bleed, and it might well be actual noisecaused by an open analog input.

SamR

Joined Mar 19, 2019
1,650
The ADS1115 has 4 inputs into it's multiplexor ie Mux. Have you checked each input to see if it is stable. Divide and conquer! Is the input to the ADS1115 or the ADC itself giving the error?

zirconx

Joined Mar 10, 2010
97
You may simply have multiplexer problems, that does happen even with larger computer systems. Charge storage and bleeding over to open multiplexer channels. And the noise voltage is not that large, it may be noise that does not appear on your meter.
My DVM does confirm the 2.8-3.2v readings though.

zirconx

Joined Mar 10, 2010
97
It may also be multiplexer channel bleed, and it might well be actual noise caused by an open analog input.
Aha - maybe I should ground channel 3 then? Currently it's reading .6v, the same thing I get when I disconnect my sensor from channel 2.

The ADS1115 has 4 inputs into it's multiplexor ie Mux. Have you checked each input to see if it is stable. Divide and conquer! Is the input to the ADS1115 or the ADC itself giving the error?
...
Good point - it seems it's the voltage divider output that is the error, not the ADC reading. Since my DVM shows the same reading.

So grounding channel 3 is probably not necessary.

Unless it's the ADC itself that is causing the voltage change in the voltage divider circuit. I'd have to disconnect it to see.

zirconx

Joined Mar 10, 2010
97
Now it seems to have maxed out at 3.3 (which is probably the max it can read). Maybe something is getting warm and changing resistance. I'm going to shut it down and let things cool and try again.

Code:
pi@pione:~/src/ads1115-linux-rpi \$ ./ads1115_example
Bus open
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.395 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.391 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.389 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.391 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.392 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.393 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.393 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.393 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.393 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.393 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.393 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.392 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.390 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.388 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.383 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.384 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.385 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.385 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.385 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.384 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.383 V | CH_3 = 0.599 V
CH_0 = 3.30 V | CH_1 = 2.164 V | CH_2 = 0.382 V | CH_3 = 0.599 V

SamR

Joined Mar 19, 2019
1,650
Grounding an unused analog input is always a good idea or else it is going to be processing noise. Thoroughly read the TI PDF for it as it has lots of very necessary info.

ci139

Joined Jul 11, 2016
1,088
the circuit before / to the MUX inputs maybe floating (favorably over the upper input range) put an analog voltmeter in parallel with "Let's see what we can see" -- a stupid quote from an idiotic movie

zirconx

Joined Mar 10, 2010
97
the circuit before / to the MUX inputs maybe floating (favorably over the upper input range) put an analog voltmeter in parallel with
I did measure the input pin - from the voltage divider into the ADC channel 0, and my DVM confirms what I am reading from the ADS1115. Is that what you mean?

SamR

Joined Mar 19, 2019
1,650
Remove the wire from the input and measure the wire voltage to gnd with your meter. Is it stable? If so then start looking at the ADS1115 module.

SamR

Joined Mar 19, 2019
1,650
I don't think there is any nearby noise.
There is always noise! One very good method of generating random numbers is to seed the random number generator with a random number by inputting the voltage from an ungrounded analog input pin which is constantly and randomly changing in our electronic soup that we exist in.

zirconx

Joined Mar 10, 2010
97
With the circuit board on the bench, disconnected from the pi but connected to the power supply, I get 5v where I should (the 5v rail where the pi would be), and 1v at the output of the resistor divider (that's not right!). Then I disconnected the ADC (channel 0) from the resistor divider - now I get the correct value from the resistor divider - 2.5v. So the ADC is pulling down the voltage. The ADC is powered down at this point of course (it's powered by the 3.3v rail of the pi, which is disconnected), so I don't know is this is appropriate behavior or not. It seems odd. And it's different from the 2.8-3.3v I was reading when the circuit is powered up.

I'm not sure what to do next. Ground channel 3 and boot it up? It seems unlikely what will solve my channel 0 problem, since it now stays fixed at 3.3v. (I booted it back up after a 20 minute break and it was 3.3v right away). Channel 1 is the most important one, and it is working. So I'm tempted to disconnect channel 0 and give up on monitoring the 5v pi voltage.

Last edited:

SamR

Joined Mar 19, 2019
1,650
Move channel 1 to the unused 3 and try it. Sounds like a problem with the ADC module.

zirconx

Joined Mar 10, 2010
97
Ok I moved the voltage divider output to channel 3, and I grounded channel 0. With the pi disconnected, I still get 1v out of the voltage divider when connected to the ADC (channel 3). But when I booted the pi and tried it:

Code:
CH_0 = 8.19 V | CH_1 = 2.253 V | CH_2 = 0.480 V | CH_3 = 2.516 V
CH_0 = 8.19 V | CH_1 = 2.253 V | CH_2 = 0.473 V | CH_3 = 2.516 V
CH_0 = 8.19 V | CH_1 = 2.253 V | CH_2 = 0.390 V | CH_3 = 2.516 V
CH_0 = 8.19 V | CH_1 = 2.253 V | CH_2 = 0.467 V | CH_3 = 2.516 V
CH_0 = 8.19 V | CH_1 = 2.253 V | CH_2 = 0.407 V | CH_3 = 2.516 V
CH_0 = 8.19 V | CH_1 = 2.253 V | CH_2 = 0.443 V | CH_3 = 2.516 V
CH_0 = 8.19 V | CH_1 = 2.253 V | CH_2 = 0.407 V | CH_3 = 2.517 V
CH_0 = 8.19 V | CH_1 = 2.253 V | CH_2 = 0.406 V | CH_3 = 2.517 V
CH_0 = 8.19 V | CH_1 = 2.253 V | CH_2 = 0.393 V | CH_3 = 2.517 V
CH_0 = 8.19 V | CH_1 = 2.252 V | CH_2 = 0.421 V | CH_3 = 2.517 V
CH_0 = 8.19 V | CH_1 = 2.253 V | CH_2 = 0.466 V | CH_3 = 2.516 V
CH_0 = 8.19 V | CH_1 = 2.252 V | CH_2 = 0.568 V | CH_3 = 2.516 V
CH_0 = 8.19 V | CH_1 = 2.253 V | CH_2 = 0.411 V | CH_3 = 2.516 V
Very odd that I'm getting 8v on channel 0 now. But the voltage divider circuit seems to be working on channel 3!

Thanks for everyone's help.