PICAXE as a current meter

BeanieBots

Moderator
Current sense resistor + op-amp or Hall effect sensor.
Have a read of my "Simple Battery Capacity meter" project in the Misc Projects section for a method that uses the volt drop down the cable.
Just replace the integrator with a high gain amplifier.
(ie, change the feedback cap for a resistor)
 

manuka

Senior Member
Readadc10 ?

What's the application? You may not need an op. amp or HES for simple work (& modest currents), as READADC10 is responsive enough for ~mV level voltage drops via the old "1 Ohm resistor" trick. (Ohms Law of course => I passing = V across/R value). Used to good effect for a hacked bike computer A & Ah meter =>www.picaxe.orcon.net.nz/bikeamph.jpg
 

Attachments

Last edited:

moxhamj

New Member
Sometimes it works out really easy - just one resistor. Say the current is about 100mA - put a 1 ohm resistor in series with the circuit and it will have 100mV across it and you can measure that with a voltmeter. Now measure both sides of the resistor with respect to ground. If both values happen to come between 0V and 5V then a picaxe can measure the mV with readadc or readadc10. The tricky bit is getting both values to be between 0 and 5V.

Method #1 for batteries. Consider a picaxe running off 8 batteries and a 5V regulator. Unfortunately you can't do any of this with just 3 batteries as the supply is unregulated so the adc values would change as the battereis go flat. So we have 8 batteries in a row. Put a 1 ohm resistor between the bottom and second to bottom battery in the pack. If we are using nicads, the voltages on the 1 ohm resistor will be 1.2V and 1.3V with a 100mA load - perfect to read straight into a picaxe and now the picaxe can measure its own circuit's current draw.

Method #2 - moving the voltages into the right range. Consider the picaxe measuring the current in a 12V supply and the grounds are connected together. The current is 100mA and the volts would be 12V and 11.9V. Divide these by 3 eg with a 200k/100k divider (or 3x100k if you don't have 1% resistors). Now the volts are 4 and 3.966. These are now between 0 and 5V and so can go straight into a picaxe. Readadc10 will probably be needed here to keep the resolution.

Method #3 - put the 1 ohm resistor in the ground part of the circuit (see manuka's schematic above). Consider a supply with 8 batteries. The -ve of the lowest battery is the real earth. The picaxe itself draws hardly any current so lets not include it in the current sense, but lets say the picaxe is driving a transistor which is driving a lamp. The power part of the circuit is battery => lamp => transistor => 1 ohm resistor => back to the battery. When the lamp comes on it will draw (say) 100mA and the volts on the 1 ohm resistor will be 0V and 0.1V - again within the range of the 0-5V the picaxe needs. One tricky part with this method is you need thick wires for the power part otherwise it is possible to end up with negative volts on the picaxe.

Method #4 - use an op amp configured as a differential amplifier. This is also useful to increase the resolution eg 0.1V is only using 2% of the range of 0-5V and even with readadc10 the resolution is a bit coarse. A differential amp with a gain of 10-20 will end up using the full picaxe range.

Now tweak a few things. If you want to measure 1 amp then change the sense resistor to 0.1 ohms. If the current is varying a lot then put a smoothing capacitor across the sense resistor. If the current is 10 amps then experiment with some bits of wire to get 0.01 ohms.
 
Last edited:

hackman127

New Member
The current will be 0-3A, so I will probably go with the op-amp method, and it'll be used on a variable power supply that will go from 0-~25v, so I will go the op-amp route. Thanks for the tips, everyone.
 

premelec

Senior Member
Note that there are ICs at a reasonable price that sense a very small voltage and convert it to a current to 'ground' where it can be changed to a voltage with a resistor - look at www.linear.com and www.zetex.com - current sense units.
 

hackman127

New Member
Note that there are ICs at a reasonable price that sense a very small voltage and convert it to a current to 'ground' where it can be changed to a voltage with a resistor - look at www.linear.com and www.zetex.com - current sense units.
I have actually seen the linear chips after I posted here, and I am considering trying one out. Thank you very much for the links, I'll have to check zetex out also.
 

Dippy

Moderator
Good find premelec.
That ZXCT1022 (and similar) look dead easy to use and also cut shunt value down too which is very desirable.
 

cpedw

Senior Member
An alternative way

I have found these http://www.amploc.com/ devices to be very easy to use. No electrical connection between the sensor and the sensed current, just magnetic. The lowest rating is +-25A nominal (60A in practice at full scale). The output is 0- 5V, ideal for ADC when powered by 5V. Quite cheap and they deliver to UK in less than a week.

Derek
 

steliosm

Senior Member
I have a similar device tou amploc. It's the current sensor from the Cent-a-Meter/Electrisave (http://www.centameter.com.au/ AU, http://www.electrisave.co.uk UK) device. I was hoping I could get it to work with the PicAxe and create an energy meter.

I couldn't find any more information about it (output voltage range) so I put away for now. Anyone tried something similar and wants to share the experience?
 
Top