Thread: Limit Switches with LED's
Hybrid View
-
29-12-2012 #1
-
29-12-2012 #2
Hi Robin
Thanks, i'll give it a go, can you recommend a particular NPN transistor, and what is the Resistor rating for the one in front of your 5v mark.
Regards
Ray
-
29-12-2012 #3
I am a dinosaur when it comes to transistors, how about a BC547.
Assuming 20mA to drive the LED and a 1.2 Volt drop across it, about 190 Ohms for the resistor.
I drew it up to minimise the component count, when the transistor switches on the Volts it has to play with fall away, may need a third resistor so don't lay any PCB's until you have tried it.
-
The Following User Says Thank You to Robin Hewitt For This Useful Post:
-
29-12-2012 #4
Personally I'd have gone with a resistor for each LED (to get their respective brightnesses balanced right)...therefore I'd connect the common anode direct to 5V & then place a current limiting resistor in each of the the LED cathode legs (the fwd voltage of a red led is about 2V, whereas a green led is about 3.2V ...therefore to get the right level balanced you'll likely need different value resistors).
Also 20mA - depending on LED - is gonna be very bright, I'd have aimed for 10mA or less.
Edit: Actually the way Robin has drawn it, for the red led you'll get a drop across the tranny itself, which pretty much balances the fwd voltage difference out for the red & green LEDs, so you may get away with a 180R single resistor for both....a 180R resistor will yield about 10mA through the LEDsLast edited by HankMcSpank; 29-12-2012 at 09:09 PM.
-
The Following User Says Thank You to HankMcSpank For This Useful Post:
-
29-12-2012 #5
-
The Following User Says Thank You to Robin Hewitt For This Useful Post:
-
30-12-2012 #6
Last edited by manofgresley; 30-12-2012 at 05:54 PM.
-
30-12-2012 #7
So you don't have a seperate ground.
That means every LED up stream of the one that goes red will go out.
If you accept that limitation, dump the transistor and the 10k resistor, not required.
Connect one LED cathode to NO, one cathode to NC and the common anode to your 190 ohm off 5V.
-
The Following User Says Thank You to Robin Hewitt For This Useful Post:
-
30-12-2012 #8
-
31-12-2012 #9
If you're happy with just one colour LED - i.e. red when the switch is pressed, off otherwise, which basically tells you the same thing as having red/green, then it's a lot simpler. Just put an LED with series resistor in parallel with each switch.
Since you will use normally closed switches, when the switch is open (pressed) the supply voltage to the switches is now present across the switch, so will light the LED. If multiple switches are pressed, the same is true except the voltage is now divided by the number of switches that are pressed so the LEDs would be dim, hence you need to choose the resistor values carefully. If you're happy with that limitation then this is a simple solution to implement, but for the sake of one extra component Robin's solution is better.
You could instead do it in software - make a box on the gui turn red/green for each switch.Last edited by Jonathan; 31-12-2012 at 02:10 AM.
-
The Following User Says Thank You to Jonathan For This Useful Post:
-
31-12-2012 #10
Good try, but what happens if two switches open?
Will 2 diodes and two resistors all in series sink enough curent to switch the Bob?
How about three?
Edit: I'm not explaining that very well am I? You aren't actually breaking the circuit, you are still requiring current to flow and light the LED's.
-
The Following User Says Thank You to Robin Hewitt For This Useful Post:
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
EMC2 home/limit switches... only acting as limit?
By vputz in forum LinuxCNC (EMC)Replies: 4Last Post: 15-10-2014, 09:51 AM -
Limit Switches
By Leadhead in forum General ElectronicsReplies: 1Last Post: 16-10-2013, 10:41 AM -
Limit switches and Mach3
By cropwell in forum Artsoft Mach (3 & 4)Replies: 1Last Post: 06-03-2013, 10:51 AM -
Uniport and limit switches.
By D-man in forum General ElectronicsReplies: 14Last Post: 13-02-2012, 11:37 PM -
Limit Switches
By Lee Roberts in forum General ElectronicsReplies: 13Last Post: 27-06-2008, 02:21 AM
Bookmarks