i want my arduino to measure its current draw. so i have set up an analog pin to measure the voltage drop across a shunt resistor. the problem, every time i connect the V- to ground, the voltage drop across the resistor drops from say 1v to 20mv, almost zero.
is there any suitable way of connecting the arduino to measure its own power consumption?
i have tried to connect the shunt resistor between the power supply and my arduino and the voltage keeps dropping...
On the basis that you want a "sizeable" input voltage, say 1 volt or so, you cannot do it with passive components (resistors) when supplying power into the 5 volt power connection on the arduino.
However if you power the unit with say 12 volts, into the normal power terminal you can do what you want using a shunt resistor.
Connect the resistor in the negative line from the battery/power supply to the ground connection.
From the end of the resistor that is not connected to ground run a line to your sense port.
Assuming you want say 2 volts input when the unit draws around 40mA you'll need a 50ohm resistor. This of course means that you will therefore loose a couple of volts being fed to the power connection.
The current is not DC, it has many spikes of current. The average current can be measured, or the peak current. Or you can use a storage oscilloscope to record the current waveform. I like the idea of using a 1 farad capacitor as the supply and watching it drain down from 11v to 10v and use that time, like 12 seconds to calculate the average current.
None of the above will work. The voltage on the resistor is outside the region of the power supply of the arduino. It simply cannot measure 5V-5.1V if the power supply voltage is 5V. The correct solution is to use a curent shunt monitor. I present you a link.
http://nandblog.com/current-shunt-monitors/
It works, as the current shunt monitor amplifies the signal some (20-50 times) and the signal you measure will be ground referenced (or any reference you connect)
You don't want to put a resistor on ground.
What is your shunt resistor value and what happens when it is on the positive side of the supply?
Please crop when scanning, and resample down to something screen sized.