Before ordering parts I'm hoping someone can confirm my understanding of the current measurements using the Arduino ADC.
I’m looking to use an Arduino to measure current drawn by another device that runs on 9V and determine which of three states it’s in (Sleeping, On, Active). The difference in current for each state are:
ACTIVE = .71 A
ON = .57 A
SLEEPING = .002 A
The top two measurements are the closest (~140mA apart) so I’m guessing my current measurements should have a resolution or 50mA or better to accurately differentiate between the ACTIVE and the ON state and sleeping will be easy to determine. If a 3V Arduino pro mini has a 10 bit ADC then it's 9V/1024 steps = 8.7 mV per step. If I use a 30 mOhm shunt resistor at .57A there’s a 17.1mV drop and at .714A there’s a 21.4mV drop (difference of 4.3mV). Therefore I cannot differentiate between all the states and need a higher resolution external ADC. Is my understanding correct and is there another/better way to determine the state of this external device measuring the current that doesn't require an higher resolution ADC?
I have done that and here's the issue I can't figure out with these modules. Many of them are all in one modules and I don't know if I have to power them to allow current to pass through or if they will allow current to pass through to keep another device powered even when they are off which will allow me to power the chips up periodically to check the current and determine the state of the device. Couldn't find this info in the datasheets I saw.
Ah yes, good call...didn't realize the 9V is far above the analog input voltage range for the Arduino pro mini, especially if I'm running it at 3V. Maybe I can use a FET to switch in a resistor divider (so it doesn't waste energy over the resistors) and periodically ready the voltage. I guess then the resistors in my voltage divider have to be very precise and stable over temp which doesn't seem ideal.
This is not the correct way to look at the problem. If you have an Arduino Uno, Nano or Pro Mini, you can use the 1.1V ADC reference, which gives you ~1 mV per ADC step.
Use a resistor of suitable value in the gizmo ground lead to generate the voltage drop to be measured. For example a 100 mOhm resistor will give 71 mV for 0.71 A, which is trivial to distinguish from the next lower level.
If you do yourresearch you will find example code and schematics and explanations of how they are used, some use a current shunt, others use a Hall Effect device.
Thanks.. Tom...
PS, It sounds like you are not a hardware person.
Can you please tell us your electronics, programming, arduino, hardware experience?
Definitely a hardware person, haven't done current measurements before. Routinely spin my own boards but always a ton to learn Getting into software, haven't done maybe a dozen arduino projects of varying complexity.