Hi, I have a Freenove UNO which is supposed to be exactly like an Arduino UNO.
I did little test where I simply had digitalPin8 set as output-high to a red LED connected in series to a 220-ohm resistor, then connected to ground. The LED comes on as predicted when connected by USB to my laptop.
However, when I use my mulitmeter to check the circuit. the voltage at the LED is 2.04V and the voltage at the resistor is 2.62V. This only adds up to 4.65V and I thought the output, source voltage was supposed to be 5V(???). Also, when I check the current of the circuit, I get a reading of 12mA (using the more sensitive current setting), when if I do the math, I = V/R, I = (4.65V / 220 Ohm) , I would expect a current of 21 mA. I verified the resistor and it is 214-ohm. Is there something I don’t see correctly? Is there resistance I should be accounting for elsewhere (within the UNO board, or the LED)?
I saw on the internet that on an Arduino UNO, the DC current of the I/O pins is 40 mA, is this because at the pin there is a resistor of 125-ohm (5V / 0.04A)? This would actually make sense in my case, since if I consider that in my small circuit below and add that resistance to my resistor, I would get I = (5V / (220 ohm + 125 ohm)) = 14.5 mA, which is a lot closer to the 12 mA that I measured.
Thanks for any clarification!
Ron
Ron,
The output transistor has some resistance, it is not a perfect 0 Ohm switch. I don't know how much resistance, but that will account for what you see.
The maximum output current is the current at which the manufacturer guarantees the output will not be damaged, that does not mean it will maintain 5V at that current. Note there is also a total maximum for the chip as a whole that is less than 40mA multiplied by however many pins there are.
I think i just realized my problem. If i don't include the forward voltage of the LED in my calculation, I come up with I = 2.62V / 214ohm = 12mA, which is what I measure.
I suppose when calculating values for a circuit, the forward voltage of the composants need to be removed from the total voltage. Does this make sense?
Cheers,
Ron
and BTW, thank you Perry for your response!
I think i just realized my problem. If i don't include the forward voltage of the LED in my calculation, I come up with I = 2.62V / 214ohm = 12mA, which is what I measure.
I suppose when calculating values for a circuit, the forward voltage of the composants need to be removed from the total voltage. Does this make sense?
Cheers,
Ron
Ron, sorry, I completely missed that! I am annoyed with myself because I should have seen it!
I suppose when calculating values for a circuit, the forward voltage of the components need to be removed from the total voltage. Does this make sense?
You are correct. I take it you are not familiar with Kirchhoff's circuit laws, which explain that kind of thing.
Also you need to know Ohm's Law, although maybe you are already familiar with those as you seem to know the maths.
USB voltage input also has some drop across the PTC resettable fuse that is next to the USB connector.
So the full equation would be:
(Vusb - Vptc - Vf)/(Rds + resistor) = current
Vusb = USB voltage the PC supplies (5V +/-5%_
Vptc = voltage drop across the PTC fuse, varies with current
Vf = forward voltage of the LED
Rds = resistance of the internal MOSFET transistor that connects the pin to Vcc or Gnd, whichever you are using
resistor = your current limit resistor
Wow, thanks Perry, thanks CrossRoads, for the responses.
Yes, I'm aware of Kirchoff's and Ohm's laws in theory, only now I'm learning to put these into practice and am starting to make actual circuits and doing some basic programming.
So as you said CrossRoads, it's probably normal that I don't get exactly 5V output at the pin.
Realizing this is a cool forum to use if I have questions, will probably use it more often.
Cheers, stay safe!
Ron