Rite now I am myself in the process of calculating the current being consumed by a Arduino UNO. I am using a 9V Alkaline battery and a resistor in series with the Arduino UNO. I am supplying voltage to the VIN and the ground. When I am using the simple sketch ( Just a setup and loop function with no commands), I get a voltage of around 1.86 volts on the 220 ohm resistor. By this, I calculate the current to be 85 mAmp. When I am using the sleep function of power down mode, there is reduction of around 6 mAmp.
This is not in conjunction with the power savings and current ratings shown in the link. Where am i going wrong. I am using a FLUKE 123 Scope meter to measure the voltage.
I guess I got the maths wrong. With 220 Ohm resistor and a voltage of 1.98V the current comes out to 8.5 mAmp which is way less than the current provided by the link by Gammon.
Firstly, in order to do any reasonable calculations you have to make sure you have your values absolutely right.
You should first measure the resistance of the resistor you are using. A 220? 5% resistor could be anywhere between 209? and 231?.
Also, 220? is a little on the high side. Most current measurement with a "shunt" resistor, which is what you are doing, is done using resistances of 1? or less. You have to remember, that every volt dropped across your resistor is a volt not seen by the Uno. A 9V battery with 1.98V dropped across the resistor results in a voltage of 7.02V - awfully close to the lower limit of the voltage regulator.
You would be much better off scrapping the shunt resistor idea and using a DMM with ammeter functionality directly inline with the power.
Thank you so much for your reply I hope i would be able to do it correctly with a DMM. Do you know whether the oscilloscope current probe would be a good idea to get the milli ampere reading ?
I have no idea, I have never used anything so complex.
Just the most basic DMM with two wires is all you need. I suspect the "current probe" you mention is a current transformer for clamping around AC power lines.
My question:
I understand the voltage regulator used on the Arduino (NCP1117) turns the extra power into heat (like a variable resistor) and does not need a big extra current to control this. It's not a switch down (buck) regulator, though, which could turn a low current @ high voltage into high current @ low voltage.
Thus, no matter if you supply 7.5V or 9V, the current should be about the same, and just as much as Arduino including its 3.3V regulator take (given 5V after the main regulator and a fixed load).
Then, having a "shunt" resistor in line, which takes about 1V itself, should not change too much, neither.
Am I wrong ?
Of course, to come from voltage measurement to current flowing, you need to know the actual resistance value.
But we are talking about 8..9mA (vic009) vs. 45..55 mA (Nick Gammon) , aren't we?
It does add an added complexity that just isn't needed though. Measuring values in a circuit should not interfere with the operation of a circuit. For this reason, the ideal volt meter has an infinite impedance, and the ideal ammeter has zero impedance. In practice this cannot happen, but keeping the resistance as low as possible when measuring current is the best you will get.
Just out of curiosity, I have just replicated the circuit, but using a 12V PSU (I don't have a 9V battery to hand).
Resistor: 216?
Voltage across resistor: 9.76V
Voltage at PSU: 15.76V
Vontage in to Arduino: 5.96V
Current without resistor: 54mA
Current calculated from resistor: 9.76/216 = 45mA
Measured current with resistor: 45.3mA
(yes, it's an un-regulated wall wart)
So you can see, at the currents that the Arduino is pulling, the resistor will be dropping way too much for the Arduino to function properly. You must use a smaller resistance for this reason. Also, you can see how the resistor itself is causing a roughly 10mA drop in drawn current.
Are you sure that the voltage across your resistor is being measured correctly? You're not measuring the voltage WRT ground after the resistor are you - the resultant voltage after the resistor's voltage drop, instead if the actual voltage drop across the resistor are you?
I would use a 10 ohm 1 watt resistor... If I wanted accuracy on the cheap... I would use 10 100 ohm resistors in parallel for a combined total of 10 ohms and my reasoning would be that the resistor tolerances would average out fairly well to about 2 - 3% (Measured many times as I have used this 'trick' frequently in my professional career) Still Measure the resistor... BUT first short the meter probes together and note the 0 resistance value as it can be 1/2 ohm or more on the RX1 scale and that is 5% of the intended value. The small resistor has little impact on the DUT and will give fairly accurate measurements. The original user mentioned using a current probe, Yes Certainly, most all (unless otherwise stated) are capable of DC current measurement or at least my HP current probes were. My opinions are based on a combined accuracy of about 5% total and unless otherwise stated @ low voltages 5% is good enough to get some idea of what is going on. If you use an ammeter be aware that not all are 0 resistance insertion loss many have series resistances of an ohm or more @ 100 mA FS and frequently 10 - 50 ohms at any scale above an amp or more. For 20 years I designed battery operated solar power charged devices and making non intrusive current measurements were crucial to the success of a project... My work must have been ok as I worked for the same company for 20 years before I retired in 2008 and everything I designed worked to spec. My employer was an engineer as well and he for many years double checked everything I did... until he knew that I didn't make the mistake of not triple checking my work. If I made a mistake it was 100 mistakes as that was the smallest production run we ever did.
Just to explain what I am doing and if you guys being the experts can point out where am i going wrong.
Just to simplify matters, now i am using a multimeter to calculate the voltage across the resistor. I have connected the positive lead on the mutlimeter to one end and the negative lead to the other end of the resistor. The resistor is connected between the negative terminal of the battery and the other terminal goes in to the ground of the Arduino.
Now I am getting a voltage of 3.96 volts across the resistor. This is double the value I was getting from the oscilloscope. I am thinking that this might be due to the fact that now I am getting the voltage drop across the resistor that I can use to get the current. But still the current comes out to be 18 milliAmp.
So I guess I should use a smaller resistance that would push up the current to expected value !!!
Are you still using the 220Ω resistor? At 55mA (as quoted on the page linked at the start), a 220Ω resistor would drop 12.1V. That obviously can't happen with a 9V battery, so the current is massively reduced to compensate.
You cannot measure this current using a 220Ω resistor - not without entering a parallel dimention where V=I²Rµ.
At 55mA (as quoted on the page linked at the start), a 220? resistor would drop 12.1V. That obviously can't happen with a 9V battery, so the current is massively reduced to compensate
Applying 9V to a 220? resistor and "something else" in series can easily draw e.g. 9 mA.
That "something else" will see a voltage of 7V, as 1.98V are dropped at the resistor, and can be interpreted as a 780? resistor.
However, according to the specs an Arduino regulator should be able to live with 7V supply, so I bet there's something wrong with your DMM (besides the current fuse)
Question is, what voltage is visible at the 5V pin, is the power led on, is sketch still running, and if this a safe mode to operate the mcu. ( I guess "no" )
There are ways to run the processor at lower speed whith less voltage requirements. Thats not an Arduino any more, but some ATMEGA328P-PU based circuit, following these ATMEL specs:
• Speed Grade:
– 0 - 4MHz@1.8 - 5.5V, 0 - 10MHz@2.7 - 5.5.V, 0 - 20MHz @ 4.5 - 5.5V
• Power Consumption at 1MHz, 1.8V, 25°C
– Active Mode: 0.2mA
– Power-down Mode: 0.1?A