Posts: 76
Joined: Tue Jul 24, 2012 10:03 pm

PCF8591P and 50-70mV difference

Thu Apr 21, 2016 10:49 am

Hello all,

I'm having a problem with inaccurate reading from PCF8591P.
I attached self made Li-ion UPS to RPI and wanted to measure battery voltage, but it always differs.
PCF module is connected properly, Vin and Vref set to stablized 5.01 volts that doesn't even change a little.

When I connect a separate battery to AIN0 and GND (common ground for PI Zero and battery), then PCF module shows proper voltage, but when I want to check voltage of battery that acts as UPS (in fact I'm using it now when typing it), voltage is always different. My two multimeters shows 3.59 but data output converted from number received from PCF is, let's say 3.52. This is not even some kind of rounding as PCF is 8-bit module, so every step gives 0.020V difference but in my project, it reaches even 0.070V...

Did anyone of you had similar problems or is it some PCF modules limitation ? I use a simple chip, not any "magic board for 10 USD". Only two schottky diodes used and Vin<>GND 100nF capacitor.
usb and broadcom issues will never be solved...Too much time passed, too much to be done...

User avatar
Posts: 335
Joined: Wed Feb 03, 2016 3:36 pm
Location: HU

Re: PCF8591P and 50-70mV difference

Thu Apr 21, 2016 3:14 pm

This difference is coming from noise, especially if the power supply is connected to the battery. There is two way, you sample two multiple times the signal, add them and shift rigth by the times. This is a digital filter. You must got a smother signal output.
Other solution you use a resistor and a capacitor depending on the sampling ratio as a first order hardwarew filter.

In case you filter your system you will got much better results!
on a Raspberry B+ with whezzy, two Zero with Jessie Light

Posts: 277
Joined: Mon Jan 30, 2012 7:01 pm

Re: PCF8591P and 50-70mV difference

Fri Apr 22, 2016 9:27 pm


Where are you connecting the meter? Is it across the battery terminals or across the input of the ADC?

Posts: 3522
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: PCF8591P and 50-70mV difference

Fri Apr 22, 2016 11:01 pm

Maybe a picture of your assembly will be good.

N.B. Normally a multimeter had some RC filter around 30Hz.

When you sample with a A/D converter you need to filter with a low pass to remove frequency above the sampling rate.

A UPS will create switching spike. This needs to be remove. Again you need a low pass filter.

Return to “Automation, sensing and robotics”