ADC reading variation

Moderator: Steve

ADC reading variation

Postby alanmcdonley » Mon Jun 13, 2016 2:27 pm

I have one channel of my Pi Droid Alpha MCP3008 ADC connected to a +/- 5A ACS712-05 current sensor which puts out 185 mV/A around 2.5v.

The ADC is nominally measuring 4.88mv/bit so I think that gives
Code: Select all
4.8828  mv          1000 mA          26.4 mA
----------       * -------         =  ____   
1 bit               185  mV            bit  around 512

(turn out it is wired up such  -26.4 mA/bit from 512)

current in mA = (ADC reading * 26.4) +/- 1.5% for current sensor and +/- 1.5 bits for the ADC

So a reading of 493 ~ 500mA +/- 7.5ma for the sensor and +/- 39.6ma for ADC ~ 500ma +/- 50ma somewhere between 450ma to 500ma or +/- 10%

or the other way around I can expect readings to vary +/- 2bits from 491 to 495 for 500mA current.

Now to my question:
Why do I have to average lots of readings to get a consistent average from set to set?
Code: Select all
Readings     Variability of five sets of average readings
10                 16%
20                 10%
33                  8%
65                  4%
75                  1.5%

average of 10 readings 420ma
average of 10 readings 580ma
average of 10 readings 460ma
average of 10 readings 500ma
average of 10 reading 500ma

range of averages = 16% when performing five sets of 10 readings
Posts: 90
Joined: Thu Jul 23, 2015 10:50 am
Location: Boynton Beach, Florida

Re: ADC reading variation

Postby mikronauts » Tue Jun 14, 2016 10:42 am

The ADC is driven from the Pi's 5V, whose level fluctuates due to instant power draw from the Pi.

For most sensors that does not matter, as they are ratiometric and basically work off Vcc/1024 and give you (sensor_vout/1024), so if the sensor is driven by the same voltage as the Pi, the errors basically cancel out.

Averaging many samples filters out the supply variations due to varying current draw by the Pi's on-board 3v3 regulation.

You could try adding a 100uF - 4700uF cap on the Pi's 5V, or for best results use an isolated supply to drive the MCP3208 and sensors.
Posts: 119
Joined: Tue Sep 16, 2014 6:58 pm

Return to Pi Droid Alpha

Who is online

Users browsing this forum: No registered users and 2 guests