Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: brian on June 04, 2008, 12:06:27 PM

Title: 50 Dollar Robot Status LED Questions
Post by: brian on June 04, 2008, 12:06:27 PM
Hello, so I was making an eagle schematic of the 50 dollar robot and I became confused by the status LED.

The Status LED is connected to PD4 and the 5 volt regulator output pin. Current should be flowing to PD4 then correct? Isn't PD4 used for output? So how does that work? Shouldn't the other end of the LED be connected to GND?

I feel kinda dumb for asking a simple question but any explanation would be appreciated. :)
Title: Re: 50 Dollar Robot Status LED Questions
Post by: Webbot on June 04, 2008, 05:25:12 PM
The circuit goes from the +5v of the regulator, thru the LED, thru the resistor to Port 4. So this means you must set port4 LOW in order to turn on the LED. This has been a confusion to a lot of people. Can't say why Admin did it this way to start with other than: since ports seem to default to being LOW then the LED will turn on by default - so by default it is a Power On/Off inidicator. A common issue that people have is that they wire the LED the wrong way around - now you know why.
Title: Re: 50 Dollar Robot Status LED Questions
Post by: paulstreats on June 04, 2008, 06:32:37 PM
Its a common thought that microcontrollers are better at sinking current than sourcing it, so thats why its used as a sink in this case.

(pd4 is an i/o port meaning its a general purpose input/output port so it can be used either way, its just better sinking current through in the case of an led)
Title: Re: 50 Dollar Robot Status LED Questions
Post by: brian on June 04, 2008, 09:57:05 PM
Thanks everyone for the clarification. :)