Monitoring it's own current draw?

Is there a standard way of monitoring the current draw of a device like an Arduino using its own analogue inputs? I was thinking of putting a resistor in the positive wire before the it connects to the Arduino then using two resistive dividers, one on each side connected to 2 analogue inputs and then measuring the voltage difference between the two. Is this the best approach? Can it be done using a single analogue input?

Mike

Depends on power supply, if it provides regulated voltage or not. In first case you would not need one of the voltage dividers, as Vin = constant. If it's not regulated, you have to use differential amplifier ( OPA ) or more sophisticated current sensor (hall effect) instead of a resistor .

Using a current sense resistor and current sense amplifier, you could do what you want:

http://www.maxim-ic.com/products/amp_comp/current_sense/

Or better still use a hall sensor powered by the system voltage which gives an isolated 0-5 volts output

[quote author=James C4S link=topic=64870.msg473591#msg473591 date=1308926775] Using a current sense resistor and current sense amplifier, you could do what you want:

http://www.maxim-ic.com/products/amp_comp/current_sense/ [/quote]

Current sense amplifiers seem expensive, at least in small quantities.

I think I'll have a go at making a differential amp http://www.allaboutcircuits.com/vol_3/chpt_8/9.html as I already have some LM324 chips which have 4 op amps in the one package.

Resolution wise I only need to know the current to within about 10% so I can manage battery life. Hopefully with a 100mv drop across the sense resistor I will be able to ignore offsets and temperature effects.

Hall effect sensors are not sensitive enough for small amounts of current that the arduino draws. The problem is that the analogue input pins can't take a voltage higher than the supply rail which is what you have by definition from a sense resistor. Look at the data sheet but I don't think the LM324 can work at close to it's rails which is why i think you will struggle to get a reading across the sense resistor.

I'll use resistive dividers to divide down the two voltages before feeding them to the op amps.

See attached for a hall sensor with 250mA fullscale range http://www.gmw.com/magnetic_sensors/ametes/documents/Ametes%20CS_Spec_020707.pdf

http://focus.ti.com/lit/ds/symlink/ina219.pdf

See attached for a hall sensor with 250mA fullscale range

The problem is that this is now a discontinued product. The TI one however might work for this application.