Pages: [1]   Go Down
 Author Topic: Real/theoretical readings from a digitalPin  (Read 464 times) 0 Members and 1 Guest are viewing this topic.
Portugal
Offline
Newbie
Karma: 0
Posts: 11
 « on: June 17, 2013, 06:29:31 am » Bigger Smaller Reset

Hi,
When i apply a HIGH voltage to a digital pin, i´m expecting a "real" voltage of +5V in the circuit.
Whem i try the simple led +resistor sequence, and then use a voltmeter, it reads 4.73V.
I'm just interested in better undestanding the diference between the real and the theoretical value.
I unsdestand that there is the internal resistance of the voltmeter (i'm using this cheap model [1] ), allong with other factors but, the question is:
How close is to +5V the real tension in a digital output of an Arduino UNO?

[1] http://www.ferreteriakeerl.com/multimetro-digital-nr-908146-noru-tagCodArt1749R20
 Logged

Learning from scratch, on my own ...

Germany
Offline
Newbie
Karma: 4
Posts: 33
 « Reply #1 on: June 17, 2013, 07:23:53 am » Bigger Smaller Reset

The datasheet guarantees an output voltage of minimum 4.2V at 20mA load, so don't expect more...
 Logged

Grand Blanc, MI, USA
Offline
Karma: 93
Posts: 3968
CODE is a mass noun and should not be used in the plural or with an indefinite article.
 « Reply #2 on: June 17, 2013, 08:04:27 am » Bigger Smaller Reset

And the less current that is drawn, the closer the voltage will be to 5V.  If the output voltage is insufficient for your purposes, consider using a transistor (which will still exhibit the same behaviour, although to a lesser extent with the right transistor) or a relay (which should be pretty darn close to 5V).

Your voltmeter is probably fine for doing these measurements; it's not the meter that is loading the circuit and causing the voltage drop, but the LED and the internal resistance of the circuitry in the microcontroller that drives the pin.  You don't say what value resistor you are using with the LED, but try a larger value and you will see that the voltage is then higher.  Try it with no load (remove the LED) and the voltage should be very close to the supply voltage.
 Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Portugal
Offline
Newbie
Karma: 0
Posts: 11
 « Reply #3 on: June 17, 2013, 08:24:03 am » Bigger Smaller Reset

I was using a 330ohm resistor.
Changing to a 1K resistor incresead the voltage, but removing the led makes the opposite!
Am i missing something?

My data:
330ohm resistor + led
4.73V

330ohm resistor - led
4.56V

1K resistor + led
4.88V

1K resistor - led
4.83V
 Logged

Learning from scratch, on my own ...

Grand Blanc, MI, USA
Offline
Karma: 93
Posts: 3968
CODE is a mass noun and should not be used in the plural or with an indefinite article.
 « Reply #4 on: June 17, 2013, 08:37:30 am » Bigger Smaller Reset

I was using a 330ohm resistor.
Changing to a 1K resistor incresead the voltage, but removing the led makes the opposite!
Am i missing something?

That is odd, is the meter hooked directly from the pin to ground? Is the pin staying on (and off) long enough for the reading on the meter to settle (usually a few seconds)?

Are you leaving the resistor in the circuit, connected to ground? That would explain your observations, without the LED the load would be greater. What I meant was to measure the pin with no load, i.e. nothing connected.
 Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Portugal
Offline
Newbie
Karma: 0
Posts: 11
 « Reply #5 on: June 17, 2013, 11:19:56 am » Bigger Smaller Reset

Quote
Are you leaving the resistor in the circuit, connected to ground?
Yes i was

But even then, shouldn't i assume that the set resistor+led has a greater total resistance?
 Logged

Learning from scratch, on my own ...

Offline
Newbie
Karma: 0
Posts: 28
 « Reply #6 on: June 17, 2013, 11:53:33 am » Bigger Smaller Reset

Work out the current drain in the two cases. There is a greater voltage drop across the led resistor [moderator edit] without a led. You need bigger output drivers with lower on resistance to get a voltage closer to 5v. This is probably a dead end though. You are looking at logic level outputs which are not designed for high current draw.
 « Last Edit: June 17, 2013, 12:24:33 pm by CrossRoads » Logged

Grand Blanc, MI, USA
Offline
Karma: 93
Posts: 3968
CODE is a mass noun and should not be used in the plural or with an indefinite article.
 « Reply #7 on: June 17, 2013, 12:29:24 pm » Bigger Smaller Reset

Quote
Are you leaving the resistor in the circuit, connected to ground?
Yes i was

But even then, shouldn't i assume that the set resistor+led has a greater total resistance?

Correct, the combination of LED + resistor has greater total resistance, so draws less current, so the voltage sags less.
 Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

 Pages: [1]   Go Up