Go to Post It is not necessary to draw 200 amps to move a robot through a two minute match. Rule of thumb is you robot should be able to compete for three matches without a battery change. - Al Skierkiewicz [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-01-2009, 20:45
sircedric4's Avatar
sircedric4 sircedric4 is offline
Registered User
AKA: Darren
no team (The SS Prometheus)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Lousiana
Posts: 245
sircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond repute
Wiring LED to Driverstation

I want to use the digital output on the driver station to activate an LED when a certain condition is met. I have an LED that is rated good for the driver station but I wired it wrong the first time and it always stayed on instead of turning on and off when I program it to.

How do I wire a 2 wire LED to turn on and off when I activate and deactivate the Driver Station Digital Output? I know my code activates/deactivates correctly because the Labview dashboard shows this, I just need to know how to wire up an LED to give me a big indicator.

Thanks.
  #2   Spotlight this post!  
Unread 21-01-2009, 22:41
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,011
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Wiring LED to Driverstation

Assuming a red LED:

Wire the + side of the LED to +5v pin, and the - side of the LED through a 330 Ohm 1/8 watt (or 1/4 W) resistor to the digital output pin. A "1" turns it off, and a "0" turns it on. You change the ground, not supply power.

Other colors need different ohm values.

Don
__________________

I am N2IRZ - What's your callsign?
  #3   Spotlight this post!  
Unread 22-01-2009, 06:46
sircedric4's Avatar
sircedric4 sircedric4 is offline
Registered User
AKA: Darren
no team (The SS Prometheus)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Lousiana
Posts: 245
sircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond repute
Re: Wiring LED to Driverstation

Quote:
Originally Posted by Don Rotolo View Post
Assuming a red LED:

Wire the + side of the LED to +5v pin, and the - side of the LED through a 330 Ohm 1/8 watt (or 1/4 W) resistor to the digital output pin. A "1" turns it off, and a "0" turns it on. You change the ground, not supply power.

Other colors need different ohm values.

Don
Thanks Don,

I have a few new questions given this information now.

Is the digital output pin you refer to the signal pin? I am using the standard 3 wire PWM cables and if I understand you I need to go from +5 V through my red wire of my PWM cable then through the LED than out of the LED through a resistor and then to the signal wire of my PWM cable?

Is this 330 Ohm resistor necessary if I spec'd my panel mount LED to not draw more current than the driverstation can handle? I used Digi-Key part L50141-ND (LED IND LIGHT 6V RED), does that require the resistor you mentioned?

If it does, can you point me to some documentation or website that explains why I need resistors with LEDs and why different resistances to different colors. I saw no documentation on the Driver Station that would send me down this path. I want to understand why I wire LED's up this way to the DriverStation.

Thanks
  #4   Spotlight this post!  
Unread 22-01-2009, 08:15
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Wiring LED to Driverstation

Quote:
Originally Posted by sircedric4 View Post
Is this 330 Ohm resistor necessary if I spec'd my panel mount LED to not draw more current than the driverstation can handle? I used Digi-Key part L50141-ND (LED IND LIGHT 6V RED), does that require the resistor you mentioned?
That part includes a 150 ohm resistor. It is perfect for this application as it is.

However, if I'm reading things correctly, it costs more than five dollars per piece from Digi-Key! A discrete LED and separate resistor are much, much less expensive.

Quote:
If it does, can you point me to some documentation or website that explains why I need resistors with LEDs and why different resistances to different colors. I saw no documentation on the Driver Station that would send me down this path. I want to understand why I wire LED's up this way to the DriverStation.
LEDs, like all semiconductor diodes, have a voltage drop across them that is essentially independent of how much current is flowing. If you supply more voltage than that, they will pull as much current as the supply is capable of delivering, and will very likely overheat and die. The series resistor is chosen to drop the rest of the supply voltage across it at the current you wish to flow through the LED.

Different LEDs have different forward voltage drops, and work best at different currents. That's why you will need different resistor values for different colors.

Section 3.1.6.2 Driver Station Digital Outputs of the 2009 FRC Control System manual says: "The DS digital output pins are driven directly by 5V transceiver (SN74LVC4245A device). Be sure to use caution as each pin can source/sink more than 40mA. It is possible to damage the device if too much current is driven on a single pin or the total current supplied by the device on all pins is excessive. Best practice should be to use a limiting resistor to prevent external loads from drawing excessive current, especially for LEDs, be sure to use a series resistor to limit the current." The overview of Driver Station ports earlier in the manual also mentions them: "Digital Output pins 5V output level (8) – Provides 5V TTL for interfacing to digital devices and to drive LEDs (with current limiting resistors)."
  #5   Spotlight this post!  
Unread 22-01-2009, 08:24
sircedric4's Avatar
sircedric4 sircedric4 is offline
Registered User
AKA: Darren
no team (The SS Prometheus)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Lousiana
Posts: 245
sircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond repute
Re: Wiring LED to Driverstation

Quote:
Section 3.1.6.2 Driver Station Digital Outputs of the 2009 FRC Control System manual says: "The DS digital output pins are driven directly by 5V transceiver (SN74LVC4245A device). Be sure to use caution as each pin can source/sink more than 40mA. It is possible to damage the device if too much current is driven on a single pin or the total current supplied by the device on all pins is excessive. Best practice should be to use a limiting resistor to prevent external loads from drawing excessive current, especially for LEDs, be sure to use a series resistor to limit the current." The overview of Driver Station ports earlier in the manual also mentions them: "Digital Output pins 5V output level (8) – Provides 5V TTL for interfacing to digital devices and to drive LEDs (with current limiting resistors)."
I read this which was why I got a resistor with a current drop like I did. My problem was figuring out which of the 3 wires from the digital output should I put to my 2 wire resistor. I didn't want to mess up my DriverStation by wiring it wrong through trial and error.

That Digi-Key part is already wired, big, and ready for panel mounting so I figured why re-invent the wheel if they had a part I could use? :-)

So to repeat I go from red 5V from digital output through my LED and then to the signal pin on the digital output? Is this correct? And then my program can turn it off and on by cycling the digital output in code?
  #6   Spotlight this post!  
Unread 22-01-2009, 08:31
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Wiring LED to Driverstation

Quote:
Originally Posted by sircedric4 View Post
So to repeat I go from red 5V from digital output through my LED and then to the signal pin on the digital output? Is this correct? And then my program can turn it off and on by cycling the digital output in code?
It will work that way, though the LED will be off for a "1" value and on for a "0". Since the DS's output can source current as well as sink it, I'd connect from the digital output through the indicator to ground instead. That way the LED will be off for "0" and on for "1".

The way you connect it should depend on whether you want the LED to be on or off when the system is reset, before the cRIO software has a chance to control it.
  #7   Spotlight this post!  
Unread 22-01-2009, 09:21
sircedric4's Avatar
sircedric4 sircedric4 is offline
Registered User
AKA: Darren
no team (The SS Prometheus)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Lousiana
Posts: 245
sircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond repute
Re: Wiring LED to Driverstation

Quote:
Originally Posted by Alan Anderson View Post
It will work that way, though the LED will be off for a "1" value and on for a "0". Since the DS's output can source current as well as sink it, I'd connect from the digital output through the indicator to ground instead. That way the LED will be off for "0" and on for "1".

The way you connect it should depend on whether you want the LED to be on or off when the system is reset, before the cRIO software has a chance to control it.
I originally tried it this way, from the center pin (indicator, signal) through to ground in the direction where the signal wire went into the positive side of the LED and it didn't do anything when I commanded it to. I thought I was just wiring it wrong. I may have to check to make sure the PWM cable was hooked to the correct pin. Couldn't FIRST have bothered to label their pins, its so easy to miscount!

Thanks everyone, I imagine with the info here I can get it to work. I'll let you know after I get a chance to try it tonight. I can't exactly bring the control system to work so have to wait till the evening to play with it.
  #8   Spotlight this post!  
Unread 22-01-2009, 10:05
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,830
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Wiring LED to Driverstation

Quote:
Originally Posted by sircedric4 View Post
I originally tried it this way, from the center pin (indicator, signal) through to ground in...
The top pin is signal.
The center pin is 5v.
The bottom pin is ground.

Wiring from the center pin to ground should leave the LED on constantly.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #9   Spotlight this post!  
Unread 22-01-2009, 10:56
Robert Cawthon's Avatar
Robert Cawthon Robert Cawthon is offline
Registered User
no team
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Kansas City, KS
Posts: 275
Robert Cawthon is a splendid one to beholdRobert Cawthon is a splendid one to beholdRobert Cawthon is a splendid one to beholdRobert Cawthon is a splendid one to beholdRobert Cawthon is a splendid one to beholdRobert Cawthon is a splendid one to beholdRobert Cawthon is a splendid one to behold
Re: Wiring LED to Driverstation

Quote:
Originally Posted by Alan Anderson View Post
Different LEDs have different forward voltage drops, and work best at different currents. That's why you will need different resistor values for different colors.
"
Could you point me to something that would tell me what resistances are required for which color? I am not extremely knowledgable about electronics design, but I can wire things up and solder them if given the design. This may be my first foray into design during the off season.
__________________
Formerly a mentor with Team Stealth, 1802. Thanks, kids. It was fun!
2008 Greater Kansas City Regional Winner (Thanks 476 and 1806)
2010 Greater Kansas City Regional Gracious Professionalism Award
2012 Greater Kansas City Regional Imagery Award
"It doesn't hurt to be smart as long as you don't out-think yourself." -- Steve Fujita Former KC Chiefs player.
  #10   Spotlight this post!  
Unread 22-01-2009, 16:43
ay2b's Avatar
ay2b ay2b is offline
Registered User
AKA: Andy
FRC #2928
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 1994
Location: Seattle, WA
Posts: 211
ay2b has a brilliant futureay2b has a brilliant futureay2b has a brilliant futureay2b has a brilliant futureay2b has a brilliant futureay2b has a brilliant futureay2b has a brilliant futureay2b has a brilliant futureay2b has a brilliant futureay2b has a brilliant futureay2b has a brilliant future
Re: Wiring LED to Driverstation

Quote:
Originally Posted by Robert Cawthon View Post
Could you point me to something that would tell me what resistances are required for which color? I am not extremely knowledgable about electronics design, but I can wire things up and solder them if given the design. This may be my first foray into design during the off season.
Read the spec on the LED -- it should give you a current and a voltage rating. The voltage rating will probably be somewhere in the 1.5-3.0 volt range; the current rating will probably be somewhere in the 10mA-60mA range. Suppose you have a 2v, 30mA LED.

Suppose you have a typical 5v supply, like on the driver station. Some of that voltage is "used up" by the LED, and some is "used up" by the resistor. The current through both will be the same. If the LED takes 2v, then the resistor takes 3v, to make the total of 5 from the supply. The Voltage/Current/Resistance formula is "V = I * R" (where V = Voltage, I = Current, R = Resistance). In our example, the voltage drop across the resistor is 3v and the current is 30mA (or 0.03A -- always make sure you get your decimal points right). 3v/0.03A = 100 ohms, so you would want a 100 ohm resistor.

I picked example numbers to make the math easy. If you get some value for a resistor and can't find common resistors with that value, just pick something close. The brightness of the LED is related to the current through it. If you pick a resistor which is too small, then the current will be higher and the LED will be brighter (and burn out sooner, up to the point of burning out right away). If you pick a resistor which is too big, then the current will be higher and the LED will be dimmer.
__________________

2011 - SD Quarterfinalists (980), LA Quarterfinalists (980)
2010 - LA (2404) Finalists (980), AZ Motorola Quality (980)
2009 - LA Semifinalists (980); Las Vegas Quarterfinalists (980); SD (2404); IRI #1 Seed, Finalist (980)
2008 - SD Quarterfinalists (980), LA Champions (980), LA Rookie Inspiration Award (2404); CalGames Finalists
2007 - So.Cal Finalists (980), SD Quarterfinalists (980); CalGames Finalists
2006 - So.Cal Regional Champion (4), Toronto Judge's Award Day 1 (4)
2005 - SVR Champions, Delphi "Driving Tomorrow's Technology" (980); AZ Xerox Creativity (980); So.Cal Finalists, RadioShack Innovation in Control (980); Championship Archimedes Division Semifinalists; IRI Finalists (980)
2004 - So.Cal Regional Champions, Leadership in Controls (980); AZ GM Industrial Design (980); Championship Galileo Division #2 Seed; IRI Champions
2003 - PNW Semi-finalists (488)
2002 - PNW Finalists (488)
2000 - X-bot / 488 - Mentor / Founder
1994 - Sunny Delight - Driver - champion
  #11   Spotlight this post!  
Unread 23-01-2009, 07:18
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Wiring LED to Driverstation

Quote:
Originally Posted by Robert Cawthon View Post
Could you point me to something that would tell me what resistances are required for which color? I am not extremely knowledgable about electronics design, but I can wire things up and solder them if given the design. This may be my first foray into design during the off season.
Robert -

Wikipedia has a decent list of colors and voltages here. If you have documentation for your LED, I would go with that, but if you don't this should give you some hints.
  #12   Spotlight this post!  
Unread 23-01-2009, 08:31
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Broadcast Eng/Chief Robot Inspector
AKA: Big Al WFFA 2005
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 10,792
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: Wiring LED to Driverstation

Robert,
As you can see from the above reference, most LEDs are near 2 volts when turned on. The exceptions are the blue and white and combinations of those. To make the resistance calculation, subtract the LED voltage from the power supply voltage. In our case, 5volts-2volts(LED)=3 volts. This is the voltage the resistor must drop. A good rule of thumb for most general purpose LEDs is 20ma. Using Ohm's Law solving for resistance R=V/I=3/20ma=3/.02A=150 ohms. 150 is a standard value of resistance but if you can't find one, 180 ohms is also a standard value. Using Ohm's law for current I=V/R=3/180=.016=16ma. Although the LED would be not as brite at 16ma, you might never see the difference. As pointed out in the documentation, the output circuitry is limited to a maximum amount of current so using the 180 ohm resistor is better for the circuit but gives a dimmer output for the LED.
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing to DriverStation cRio screen alexjplant NI LabVIEW 2 17-01-2009 10:59
Wiring an LED from the OI Windward Electrical 6 21-01-2007 13:54
Team LED Gamer930 Control System 1 18-02-2006 15:57
Led tyguy2021 Electrical 7 15-11-2005 21:30
LED Flashlights Justin Chit-Chat 3 06-08-2004 05:35


All times are GMT -5. The time now is 03:17.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi