LED connection ?

johndxmurphy

New Member
I noticed in the Picaxe book (can't remember the name, the green one) that in some cases an led is connected from +5 volts then to the pin. I was under the impression that one connected from output pin to LED (and resister) to ground. Is +5 volts to LED to pin the same thing?
 

westaust55

Moderator
Both ways will work but the LED will be turned on under different PICAXE output states.

With the circuit as +5V - resistor - LED - PICAXE OUTPUT then the LED will be on when the output is low

With the circuit as PICAXE OUTPUT - resistor - LED - 0V then the LED will be on when the output is high
 

Michael 2727

Senior Member
Also refered to as Sink or Source, 20mA MAX whatever is used.
Sink, when the pin is LOW and used as - NEG.
Source, when the pin is HIGH and used as + POS.
And 20mA current MAX in either direction so use a resistor, as mentioned.
What they said ^ ^ ^
 

hippy

Ex-Staff (retired)
Staff member
If you think of the sparklets ( the electrons which will pass through the LED to make it glow ) as being pulled by gravity, the can either be pulled in from +5V via the LED and into the PICAXE ( its output set to 0V, Low ) or can be pushed out from the pin (output +5V, High ) through the LED and to 0V.

You might want to consider the current limiting resistor as speed-bumps for sparklets which stop them whizzing through the LED at high speed. The faster they go the brighter the LED glows but go too fast and the LED melts or explodes ( often physically ).
 
Top