go_away

Author Topic: 50 Dollar Robot Status LED Questions  (Read 2000 times)

0 Members and 1 Guest are viewing this topic.

Offline brianTopic starter

  • Jr. Member
  • **
  • Posts: 12
  • Helpful? 0
50 Dollar Robot Status LED Questions
« 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. :)

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,150
  • Helpful? 109
Re: 50 Dollar Robot Status LED Questions
« Reply #1 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.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline paulstreats

  • Supreme Robot
  • *****
  • Posts: 1,381
  • Helpful? 21
Re: 50 Dollar Robot Status LED Questions
« Reply #2 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)

Offline brianTopic starter

  • Jr. Member
  • **
  • Posts: 12
  • Helpful? 0
Re: 50 Dollar Robot Status LED Questions
« Reply #3 on: June 04, 2008, 09:57:05 PM »
Thanks everyone for the clarification. :)

 


Get Your Ad Here

data_list