measuring current

113 views
Skip to first unread message

Richard Gillett

unread,
Jun 24, 2015, 3:36:28 PM6/24/15
to web...@googlegroups.com
Hi,

I'm trying to measure curent between an invertor and a 12V campervan leisure battery. I have a 75A shunt which gives 75mv full scale.

When I put this into my pi though, via the mcp3008 I get spurious readings. There's a multiplier off 1000 to bring the displayed current up to match the ampmeter reading however the readings on the pi are not stable at all.

I've done the same on a 10A system and this works fine, any one have any suggestions as to why this is.... maybe a smoothing capacitor or something, if so what value??

Any advice would be appreciated,

Thanks
Rich

Pete Dudash

unread,
Jun 25, 2015, 10:29:47 AM6/25/15
to web...@googlegroups.com
What resistance value is the shunt?  What kind of current ranges are you wanting to measure?  Using something with a 1000x gain could easily amplify unwanted noise to a problematic level.  Do you have a schematic diagram you could share of your exact setup?  It's hard to guess where the problem could be with the info provided.

Richard Gillett

unread,
Jun 25, 2015, 12:24:25 PM6/25/15
to web...@googlegroups.com
Hi Pete, thanks for the reply, the resistance is 10 ohms.

Im multiplying the value in the software by 1000.

If I do this externaly won't it blow my pi up as the voltage i/p will be to high? Ie limited to 0 to 3.3V?

The range is basically 0 to 75A.

I can draw a quick schemetic later and post although it is just literally a shunt on the negative line between an invertor and 12V leisure battery.

Thanks
Rich

For info.... I'm using the INA122 for the MPX10DP with a x10 gain, which work perfectly. I've tried using this amp here (with a x5 gain) but still no improvement....

Pete Dudash

unread,
Jun 25, 2015, 12:54:14 PM6/25/15
to web...@googlegroups.com
Low-side current sensing could introduce ground disturbances due to the voltage drop across the sense resistor.  Certain devices might not like that too much.  It also depends on the size of the resistor.  A shunt of 10Ω seems very high.  Your power losses at 75A would surely destroy it!  If you want to measure 75A, a shunt of 10mΩ would be much better.  (You should reduce the shunt resistance by a factor of 1000 and eliminate the software gain of 1000.)

That would provide a max voltage drop of 0.75V  (75A * 0.01Ω) and dissipate 56W (75A * 75A * 0.01Ω).  Make sure your shunt can handle at least 1.5 times more and you have a heatsink on it to be safe.  Your INA122 gain could be set to 4.4 to utilize the full range of the ADC with a 3.3V reference.  Prior to your ADC input, a simple resistor-capacitor low pass filter and zener voltage limiter will help smooth and protect your ADC.

This is a hefty application for someone new into electronics.  Please be careful!  Details like these become much more important at this kind of power level.

Just for your information, if your amplifier gain is set really high (like 1000x), the output will still be limited.  I can't amplify a 1V input to 1000V.  The output can only get as high as the input voltage of 3.3V (for an op-amp with rail-to-rail output).

Richard Gillett

unread,
Jun 25, 2015, 3:04:54 PM6/25/15
to web...@googlegroups.com
Sorry pete my mistake, was going out so quickly measured the shunt with it conected, the true value is 0.2ohms.

I have tried putting a capacitor across the adc i/p and ground and this does give a much more stable reading, however it does still fluctuate between say 12A (stabilises for a few seconds), drops to 9A, back to 12A and sometimes even 0..... not quite sure what to do, maybe design a filter...

Just out of intrest what value you say the capacitor need's to be?

Pete Dudash

unread,
Jun 25, 2015, 4:31:45 PM6/25/15
to web...@googlegroups.com
That is better, but 0.2Ω is still high for the current you want to measure.  Ohms law states V = I*R.  Therefore 75A * 0.2Ω = 15V drop across your shunt.  This is impossible since your battery is only 12V!

The OP says "campervan leisure battery".  I really doubt you'll be pulling 75A out of that.  Are you sure that is the right number?

Putting a cap across the ADC input would help.  But is that cap is also directly connected to the op-amp output?  Op-amps do not like large capacitive loads and could start to oscillate - giving you more noise.  That is why I suggested the resistor too.  Google for low pass filters.  The capacitance depends on the resistance and the input noise and desired output ripple.  Best practice dictates that you should first identify the source of the noise rather than try to snub it out with brute force.

You say you are measuring a fluctuation of ~3A.  Are you sure the load is constant?  A varying load would definitely show up in your measurement.
Measure the actual voltage drop across the shunt.  Is that stable or noisy?
Is 75A a realistic number for your max continuous current draw?
What is the power rating of your 0.2Ω shunt?

All this information is important to specifying proper components to give you the data you want.  The more you help me, the more I can help you.

Richard Gillett

unread,
Jun 25, 2015, 5:17:31 PM6/25/15
to web...@googlegroups.com
It all sounds crazy I know, and i must admit the whole project has escalated because I'm just into this kinda thing, it is driving the missis mad mad mind!! Haha.

I'm doing a self build camper van which I've put 2 125ah batteries in conected in parallel to give 250ah. This is so I can run without hookup in remote areas. From this and looking at posts on here I thought it'd be a great idea to make a power analyser to monitor battery use, and remaining life etc.... more fool me! Haha!!

The values are real as i have a clamp ammeter attached monitoring the currents also, plus like you say using using ohms law, the calcs match what the a meter displays,ie, should the 750W toaster on to really pull some power the reading between the invertor and the battery is, as expected (p/v, 750/12) 62.5 amps. The invertor shall rarely be used under these conditions as my batteries won't long I know, but like I say I'd like the ability to monitor and calculate accordingly... sad I know!! Lol.

The main use here is on the 12v side only, ie no invertor for the 230v stuff, a maximum of 10A can be drawn with my appliances, and this shunt behaves much more stable, I'll measure the resistance of that tommorow and let you know. Maybe I need a better shunt and not a cheap crappy thing from good old China!!!

Thanks allot for your help and ill give you more info tomorrow!!

Really love this app btw, learnt so much from it, ie python and java, to which I still have a few problems, but shall save them later!! Had some great help and it's all very much appreciated!!

Thanks again
Rich

Richard Gillett

unread,
Jun 25, 2015, 5:21:46 PM6/25/15
to web...@googlegroups.com
Btw one final thing, don't know if it's worth mentioning, I gave up with the op amp so the cap is directly across the adc ip, 100uf / 25V capacitor.

This is because the 10A shunt seems to be a big enough signal, and also placing a dvm across the 75A shunt the mv indicated is solid as rock.... is that because the dvm has the correct filters built in....??

Pete Dudash

unread,
Jun 26, 2015, 8:44:07 AM6/26/15
to web...@googlegroups.com
So you really only need to measure 10A.  So the most any of your appliances would be is only 10V.  When using a higher resistance shunt, like 0.2Ω, you get a higher voltage drop.  So yes, that would be easier to measure without seeing much noise.  BUT, you immediately lose 2V across the shunt (10A * 0.2Ω) leaving your appliances with a maximum of 10V.  On the other hand, using a smaller shunt of 0.02Ω, you get a lower voltage drop which could be harder to measure.  BUT, you only lose 0.2V across the shunt which leaves you with 11.8V.  You have to look at the trade-offs to see what is doable/acceptable.  Also keep in mind the power dissipated by the shunt (P = I^2 * R) - it could get very hot!

Richard Gillett

unread,
Jun 26, 2015, 1:01:55 PM6/26/15
to web...@googlegroups.com
Yeh no worries, took the shunt to work today and measured it properly, it's 0.0016.... knew something wasnt right, it's me meter and cheap leads.

Anyway seemed to have solved the problem now, I've put a basic low pass filter in and this seems to have done the trick! Even managed to leave toast to cook a full cycle!! This will probably never get used again now but hey I got there!! Haha

Thanks for your help! :0) and if you know anything about peukerts law feel free to advise further..... ;0)

Pete Dudash

unread,
Jun 26, 2015, 4:08:42 PM6/26/15
to web...@googlegroups.com
Ok, that value is much better!  I know of Peukerts law, but haven't used it before.  Usually, I just monitor the voltage.  But my projects are on a much smaller scale, that that works well for me.  Glad you got it to work!
Reply all
Reply to author
Forward
0 new messages