Go to Post When twenty people tell you your hair is on fire, you don't need to look into a mirror to find out they're right. - IndySam [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 22-02-2009, 15:02
dboisvert dboisvert is offline
Registered User
AKA: Dan Boisvert
FRC #2405 (Divided by Zero)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Michigan
Posts: 57
dboisvert is an unknown quantity at this point
Wiring Lightswitch and LED (Driver Station

Any suggestions on how to wire 2 LED's to a light switch.

When its off its one LED
When its on its the other LED

http://www.chiefdelphi.com/forums/at...9&d=1234143000

is the diagram I planned on wiring the switches with
  #2   Spotlight this post!  
Unread 22-02-2009, 16:35
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: 6,998
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 Lightswitch and LED (Driver Station

Connect the switch to one digital input port. Use the value of that port to switch the values of two digital output ports, which drive the LEDs.

If the value of the switch is 1, turn on digital output 1. If the value of the switch is 0, turn on digital output 2. The LEDs must have a resistor in series, use 680 Ohms or 470 Ohms. Connect the + side of the LED to +5 volts, connect the - side of the LED through the resistor to the digital output (which will act as a ground when switched on). (It is better to use the digital output as a ground than to supply power to the LED in this case)

One other way is to use a double-pole double-throw switch. One pole (side) of the switch is for the digital input and wired like the top diagram, the other side is used for the LEDs and has +5 on the center terminal through a 470/680 Ohm resistor, the outside terminals on the switch have one LED each, the + side, and the other side of each LED connected to ground. This approach doesn't need any programming, but is harder to debug.

Don
__________________

I am N2IRZ - What's your callsign?
  #3   Spotlight this post!  
Unread 22-02-2009, 16:55
dboisvert dboisvert is offline
Registered User
AKA: Dan Boisvert
FRC #2405 (Divided by Zero)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Michigan
Posts: 57
dboisvert is an unknown quantity at this point
Re: Wiring Lightswitch and LED (Driver Station

http://www.radioshack.com/product/in...ductId=2062322

That should do the trick correct?

-Dan
  #4   Spotlight this post!  
Unread 22-02-2009, 19:03
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: 6,998
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 Lightswitch and LED (Driver Station

Yes. But... maybe you should consider the LED you will use: Different colors need different voltages.

Calculate the resistor value by knowing Ohm's law (V=I*R), the voltage requirements of the LED and the current requirements of the LED (do NOT use the maximum LED current, use something quite a bit less. For example, 20 mA is a good value for almost all LEDs) and the voltage supply (from the driver station in this case). So, if your LED needs 2 volts, and you have a 5 volt source (the driver station), your resistor has to drop 3 volts. If your LED wants 20 mA, your resistor is (V/I = R, 3 / 0.02 = 150 Ohms, so anything from 150 to maybe 270 Ohms is OK (about a 2 to 1 ratio). So maybe my first answer, a 680 Ohm resistor, might be a little bit large (it is appropriate for a 12 volt source). It would be OK, but the LED might be dimmer than you prefer.

You can also check if a 1/2 watt resistor is enough by using Watt's Law: P=I*V, so (3*0.02 = 0.06) or 60 milliwatts, so 1/2 watt is way overkill but that's never a problem. (It's bad when you try to dissipate 1 watt with a 1/2 weatt resistor - it 'overheats'.)
__________________

I am N2IRZ - What's your callsign?
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
paper: Set and display your Auto-Mode using LabVIEW and the Driver Station PhilBot Extra Discussion 0 11-02-2009 12:32
Driver station and battery fail to communicate Peter H FRC Control System 0 05-02-2009 15:11
Driver station only regognizes USB 1 and 2 cvxdes Programming 14 05-02-2009 14:40
Camera and driver station viperred396 General Forum 8 05-02-2009 10:12
driver station and cRIO firmware update help asianfez123 FRC Control System 1 16-01-2009 02:34


All times are GMT -5. The time now is 23:00.

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