4 Channel Analog to Digital 0-20V Converter Noise

I am able to read values using I2C on my Raspberry Pi, but the voltages I am getting are jumping around by +/- .5 volts or more for each query. Any ideas on what is going on? I am testing a stable bench-top power supply at 10.0VDC to start with. I need very consistent sampling.

Hi,
Here is a lib i use for testing


make sure the power supply is not too noisy.

Thanks

Good call, but already tried that. I used a lab power supply for the 12V for the unit. Verified the noise was very low on an o-scope. Saw the same noise on the readout.

ADC Output channel 1 : 589
ADC Output channel 2 : 1
ADC Output channel 3 : 1
ADC Output channel 4 : 2
ADC Output channel 1 : 797
ADC Output channel 2 : 1
ADC Output channel 3 : 1
ADC Output channel 4 : 2
ADC Output channel 1 : 1574
ADC Output channel 2 : 1
ADC Output channel 3 : 1
ADC Output channel 4 : 2
ADC Output channel 1 : 1060
ADC Output channel 2 : 1
ADC Output channel 3 : 1
ADC Output channel 4 : 2
ADC Output channel 1 : 1009
ADC Output channel 2 : 1
ADC Output channel 3 : 1
ADC Output channel 4 : 2
ADC Output channel 1 : 588
ADC Output channel 2 : 1
ADC Output channel 3 : 1
ADC Output channel 4 : 2
ADC Output channel 1 : 665
ADC Output channel 2 : 1
ADC Output channel 3 : 1
ADC Output channel 4 : 2
ADC Output channel 1 : 1444
ADC Output channel 2 : 1
ADC Output channel 3 : 1
ADC Output channel 4 : 2
ADC Output channel 1 : 1089
ADC Output channel 2 : 1
ADC Output channel 3 : 1
ADC Output channel 4 : 2
ADC Output channel 1 : 604
ADC Output channel 2 : 1
ADC Output channel 3 : 1
ADC Output channel 4 : 2
ADC Output channel 1 : 1284
ADC Output channel 2 : 1
ADC Output channel 3 : 1
ADC Output channel 4 : 2
ADC Output channel 1 : 1208
ADC Output channel 2 : 1
ADC Output channel 3 : 1
ADC Output channel 4 : 2
ADC Output channel 1 : 591
ADC Output channel 2 : 1
ADC Output channel 3 : 1
ADC Output channel 4 : 2
ADC Output channel 1 : 695
ADC Output channel 2 : 1
ADC Output channel 3 : 1
ADC Output channel 4 : 2
ADC Output channel 1 : 1146
ADC Output channel 2 : 1
ADC Output channel 3 : 1
ADC Output channel 4 : 2
ADC Output channel 1 : 1164
ADC Output channel 2 : 1
ADC Output channel 3 : 1
ADC Output channel 4 : 2

Traceback (most recent call last):
File “/home/pi/Python/A2D_test.py”, line 80, in
print (“ADC Output channel 4 : %d” %raw_adc)
File “/usr/lib/python2.7/idlelib/PyShell.py”, line 1356, in write
return self.shell.write(s, self.tags)
KeyboardInterrupt

Sample output while running your 12-bit code. Channel 1 is connected to a stable +10V bench-top power supply (not the same one providing power to the unit.)

Can you try our official repository at https://github.com/ncd-io/MCP3428/tree/master/Python?

There’s a bit of odd calculation if the resolution isn’t taken into account so that may be it.

Tried with your mpc3428 module and the sample code with a bench-top power supply set to 10.00V. Same problem. Output:

Python 2.7.13 (default, Nov 24 2017, 17:33:09)
[GCC 6.3.0 20170516] on linux2
Type “copyright”, “credits” or “license()” for more information.

================== RESTART: /home/pi/Python/A2D_test_v3.py ==================
All Readings:
[5.516790425012213, 0.00545676599902296, 0.00545676599902296, 0.01091353199804592]

5.51679042501
0.00545676599902
0.00545676599902
0.010913531998
Channel 0 reading:
6.1279482169

All Readings:
[5.173014167073767, 0.00545676599902296, 0.00545676599902296, 0.01091353199804592]

5.17301416707
0.00545676599902
0.00545676599902
0.010913531998
Channel 0 reading:
5.62592574499

All Readings:
[5.860566682950659, 0.00545676599902296, 0.00545676599902296, 0.01091353199804592]

5.86056668295
0.00545676599902
0.00545676599902
0.010913531998
Channel 0 reading:
6.04063996092

All Readings:
[5.5659013190034194, 0.00545676599902296, 0.00545676599902296, 0.01091353199804592]

5.565901319
0.00545676599902
0.00545676599902
0.010913531998
Channel 0 reading:
5.88785051295

All Readings:
[5.909677576941866, 0.00545676599902296, 0.00545676599902296, 0.01091353199804592]

5.90967757694
0.00545676599902
0.00545676599902
0.010913531998
Channel 0 reading:
5.94787493894

All Readings:
[5.031138251099169, 0.00545676599902296, 0.00545676599902296, 0.01091353199804592]

5.0311382511
0.00545676599902
0.00545676599902
0.010913531998
Channel 0 reading:
5.91513434294

All Readings:
Traceback (most recent call last):
File “/home/pi/Python/A2D_test_v3.py”, line 20, in
print ‘All Readings:’
File “/usr/lib/python2.7/idlelib/PyShell.py”, line 1356, in write
return self.shell.write(s, self.tags)
KeyboardInterrupt

can you add a 10uF cap on the input one?

and test with this code

That is a LITTLE better maybe with the cap. A .43V range over a few measurements is still WAY too high of a variance.

ADC Voltage Output channel 1 : 9.82
ADC Voltage Output channel 2 : 0.01
ADC Voltage Output channel 3 : 0.01
ADC Voltage Output channel 4 : 0.02
ADC Voltage Output channel 1 : 9.95
ADC Voltage Output channel 2 : 0.01
ADC Voltage Output channel 3 : 0.01
ADC Voltage Output channel 4 : 0.02
ADC Voltage Output channel 1 : 10.42
ADC Voltage Output channel 2 : 0.01
ADC Voltage Output channel 3 : 0.01
ADC Voltage Output channel 4 : 0.02
ADC Voltage Output channel 1 : 10.14
ADC Voltage Output channel 2 : 0.01
ADC Voltage Output channel 3 : 0.01
ADC Voltage Output channel 4 : 0.02
ADC Voltage Output channel 1 : 10.18
ADC Voltage Output channel 2 : 0.01
ADC Voltage Output channel 3 : 0.01
ADC Voltage Output channel 4 : 0.02
ADC Voltage Output channel 1 : 10.07
ADC Voltage Output channel 2 : 0.01
ADC Voltage Output channel 3 : 0.01
ADC Voltage Output channel 4 : 0.02
ADC Voltage Output channel 1 : 9.90
ADC Voltage Output channel 2 : 0.01
ADC Voltage Output channel 3 : 0.01
ADC Voltage Output channel 4 : 0.02
ADC Voltage Output channel 1 : 10.25

Traceback (most recent call last):
File “/home/pi/Python/A2D_test_v4.py”, line 37, in
time.sleep(DL1)
KeyboardInterrupt

the cap is working as a noise filter. looks like the power supply is quite noisey.
do you have any other supply you can use for testing?

I have used three separate power supplies, all were checked out on an oscilloscope to check for a ripple in their voltage output. I still get a variation in the voltage no matter how much capacitance I add to the input side. The capacitance reduces the responsiveness of my sensor data, so is not a long-term solution anyway.

in MCP3428 there is a flag which can be used to see if the ADC conversion is complete or not. You can also increase the delays
DL = 0
DL1 = 0.5
In past i have seen this kind of noise and all of them because of power supply or noisy input.