# Thread: Limit Switches with LED's

1. 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 01:10 AM.

2. ## The Following User Says Thank You to Jonathan For This Useful Post:

3. Originally Posted by Jonathan
If you're happy with that limitation then this is a simple solution to implement
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?

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.

4. ## The Following User Says Thank You to Robin Hewitt For This Useful Post:

5. Originally Posted by Robin Hewitt
Edit: I'm not explaining that very well am I?
No, perfectly well.

I put this diagram in the previous post, but immediately deleted it as I realised the problem you mentioned:

If V=5V, then when one switch is pressed the voltage at the node the breakout board is connected to will be the forward voltage of the LED, so about 2.1V, plus the voltage of the resistor. As you say that's probably acceptable with just one switch pressed, but still more susceptible to interference and probably not going to work with more.
We can fix this by increasing V, to say 24V, and connecting the breakout board via an op-amp used as a comparator. Set the threshold of the comparator to be just under the voltage present when one switch is pressed, then any number of switches are pressed the comparator output will switch. I guess that does loose the simplicity...I'd do it your way, except I don't really see the point of adding LEDs!

6. ## The Following User Says Thank You to Jonathan For This Useful Post:

7. Hi Jonathan
Thanks for all your help, seems like i was asking for quiet a lot when i said simple. Forgive me but you lost me at OP AMP / Comparator, and can you explain what a gui is from a previous post?
This is my latest interpration, do you think it will work, i realise that the only LED to illuminate will be the one on the activated switch.

Regards and Thank You

Ray

8. Originally Posted by manofgresley
OP AMP / Comparator gui
An Operational Amplifier is wonderful thing. It has 2 inputs labled + and -. If the Voltage on plus is higher than the Voltage on minus the output pin goes high, vice versa and it goes low. With a bit of resistor jiggery pokery you can multiply or divide a voltage by anything you like.

If they make an Op amp and it turns out to be too clunky they mod the circuit to lose the drive high on the output and call it a comparator. You connect your input to one pin, a reference Voltage to the other and the output tells you which is the higher.

GUI usually stands for Graphical User Interface.

I can't comment on your circuit because I still don't know what is coming out of the Bob.

9. ## The Following User Says Thank You to Robin Hewitt For This Useful Post:

10. The plan above won't work as having just checked the datasheet for the BOB, the limit switch input is gets pulled to ground, so it won't provde enough power to light up anything, and adding LEDs in that way will probably be enough to pull it to ground.

Using some kind of high impedence sensing is the only way to make this work without affecting the BOB input.
For design/build simplicity and to avoid dealing with individual chips, I'd suggest an Arduino UNO. A quick sketch (arduino talk for code/programme) will do what you want easily, the inputs are high impedence by default, and it'll power LEDs easily.

11. ## The Following User Says Thank You to m_c For This Useful Post:

12. Can't he just use a separate 5V supply and use the NO contact to make the circuit when the switch trips.? Simplizz enough to me.!!

Edit: Like this.?

Ray the same 5V supply that powers the Bob would work just take another feed from it.
Last edited by JAZZCNC; 01-01-2013 at 04:01 PM.

13. Or, use a double throw microswitch and have red green on every switch, fully independant and all on one 3 wire loop, easy peasy.

14. ## The Following User Says Thank You to Robin Hewitt For This Useful Post:

15. Hi Robin

Many thanks, still confused, would that be a SPDT? I thought I was trying to illustrate that in my drawing, or did I get that wrong?

Regards

Ray

16. Hi Jazz

Many thanks again, will this stop the machine from moving if activated.?

Regards

Ray

Page 3 of 4 First 1234 Last

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•