Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

6 momentary switches 6 LEDs

Status
Not open for further replies.

Digger7

New Member
I want to control 6 LED's with 6 spst momentary switches. When no switches are pushed, no LED's are lit. When switch 1 is pushed, LED 1 lights and remains lit after switch 1 is released. If switch 2 is then pushed (and released), LED 1 turns off and LED 2 turns on and stays on. (etc for all switches)

Where should I start? Thanks in advance for your help!
 
What's the ultimate goal of this? You could probably do it with a series of Set/reset flip flops on each switch, but I don't know the best way to configure it.
 
I'm going to use it to control relays for a test fixture. If I use set / reset flip flops, how do I wire it so pressing a "new" switch turns off the currently lit LED?
 
The simplest way would be to use a small microcontroller, it could all be done with just 1 IC. If your not into microcontrollers another way is to use set/reset flip flop IC's 4013 comes to mind. a pushbutton connected to the set pin turns on the latch which turns on the led. Then a short pulse is fed back to the reset inputs of all the latches to cancel any previously on led's.
That is the basic idea. I would post a schematic but I don't have a good schematic program.
 
Digger7 said:
I'm going to use it to control relays for a test fixture. If I use set / reset flip flops, how do I wire it so pressing a "new" switch turns off the currently lit LED?
Why don't you use the relays?

Button 1 operates relay 1, Button 2 operates relay 2, etc.

The relays have a holding path through the NC contacts of the higher numbered relays, ie. when R2 operates, it releases R1 & when R3 operates, it releases R2, etc.

You would need a reset button to release the last relay once it has operated, ie. when you want to release it.

If you don't know what I mean, let me know and I'll post a circuit for you.
 
Last edited:
hi digger,

If you have free choice of the type of switches you use, you can purchase a bank of 6 mechanical interlocking switches.

Any switch pressed holds in and releases any other.

Depending how much current you are switching, you may not require any relays. The switch elements come in N/O or N/C or change over.

EricG
 
Last edited:
controlling LED's

Ok:

1 - To ljcox and ronh- The relays won't necessarily be used in a specific order so I can't trigger relay 2 off of relay 1.

2 - To ericgibbs - I can use a mechanical switch bank. But this isn't as much fun as doing it electronically. The only place I found that sells these types of switches (a custom switch manufacturer) has a 500 piece minimum order. Do you know of anyplace that sells eaches?

3 - To brever - I don't have any microcontroller experience but I could probably get something to work given some guidance. Which specific microcontroller would you start with? Regarding a flip flop circuit, if you can't post a schematic because you don't have the right software, can you just hand draw something and scan it to post?

Thanks all for your assistance!!!! This is a great site!!!!!!!!!!!!!!
 
hi digger

In the UK, RS Ltd sell individual switch kits.

I'll look at their website and let you know.

EDIT: www.rswww.com

stock no
333-726 DPCO latch sw £1.75 GBP
333-760 6PCO latch sw £2.79
333-625 Latching Bar £1.70

I understand the fun part, but its nice to have a safety net.

EricG
 
Last edited:
Digger7 said:
1 - To ljcox and ronh- The relays won't necessarily be used in a specific order so I can't trigger relay 2 off of relay 1.
Do you mean that if say relay 5 is operated, then you may wish to operate R2?

In other words, is the choice random?

Or will it be only in a forward sequence, eg. R4, R6, R9, etc.?

Either way, then it can be done simply with relays.

What do the relays drive?

Are they to switch a high voltage?
 
3 - To brever - I don't have any microcontroller experience but I could probably get something to work given some guidance. Which specific microcontroller would you start with? Regarding a flip flop circuit, if you can't post a schematic because you don't have the right software, can you just hand draw something and scan it to post?

I would use a PIC microcontroller, I frequently use the 16F630 it would work very well in your application. It has 12 I/O lines, needs no crystal and costs about $1.80 US. I will see what I can do about a schematic, I dont own a scanner either. Where are you located ? I could just mail you something.
 
Last edited:
LED control

to ljcox - The final device is a test fixture for testing low pressure gauges. The gauges read from zero to 60 Cm H2O pressure. I want to push a button and the system pressurizes to 10 Cm H2O for example. I then read the gauge being tested to verify it is at 10. Then I push another button and the system pressurizes to 20. Another button for 30, etc. But I may also want to test to 10 then 60 then 30 then 60 again, etc so it is random and selectable by the person doing the test.

I will use the output to drive multiple 12v dc solenoid valves (maybe through relays or maybe just through transistors used as a gates), each solenoid valve is connected to a preset pressure regulator.

to Brevor - I live in Florida (USA)

to EricG - Thanks, that looks like it would work. I'll see if I can find something similar in the US.
 
to Brevor - I live in Florida (USA)

It sounds like we both have similar jobs, I also build test fixtures for use in the plant I work at. I have a lot of "off the shelf" designs I use and probably have something like you are looking for. If you would like by clicking on my user name you can e-mail me your address and e-mail I could most likley send you something like you need.
 
Digger7 said:
to ljcox - The final device is a test fixture for testing low pressure gauges. The gauges read from zero to 60 Cm H2O pressure. I want to push a button and the system pressurizes to 10 Cm H2O for example. I then read the gauge being tested to verify it is at 10. Then I push another button and the system pressurizes to 20. Another button for 30, etc. But I may also want to test to 10 then 60 then 30 then 60 again, etc so it is random and selectable by the person doing the test.

I will use the output to drive multiple 12v dc solenoid valves (maybe through relays or maybe just through transistors used as a gates), each solenoid valve is connected to a preset pressure regulator.
Understood, I'll post a circuit for you later today.

You did not say how many solenoids there are, But the circuit is easily expanded to how ever many you want.
 
This ain't elegant, but you can do the logic with four 74HC10's, two 74HC02's, and three 74HC74's. Or, if you need 12 volt logic, a similar solution is doable in CD4000 series. The microcontroller solution is much better if you can do the programming, or get someone to do it for you. Of course, if Brevor comes through, your problem is solved.
 
This is my suggestion.

I've only drawn 4 relays as I don't know how many solenoids you have. But it is easily expanded to however many you need.

The first and last relays are wired as per R1 & R4, the intermediate relays are wired as per R2 & R3.

Circuit description:-

When the power is turned on, all relays and solenoids are in the released state.

If you examine the "one-only" chain, you will see that there is a path through it if one and only one relay is operated.

If say Button B3 is pressed, R3 operates and holds via the one only chain, the reset button, Dx and the holding chain.

S3 is operated via the "one-only" chain, the reset button and the solenoid chain.

If say B1 is pressed, R1 operates and thus 2 relays are operated at this point. So the "one-only" chain goes open and therefore R3 & S3 release.

When R3 releases, the "one-only" chain is closed and so R1 holds and S1 operates.

When you want to release the operated relay and solenoid, press the reset button or simply turn the power off.

The diodes across the coils protect the contacts from the back EMF when the coil circuit is opened.
 

Attachments

  • Random relay chain.gif
    Random relay chain.gif
    23 KB · Views: 190
Last edited:
Hi digger

Have a look at the datasheet for the SN74278. 4 Bit Priority Regs, you would need two in cascade.
www.datasheetarchive.com

Use the outputs to drive a single 8 transistor i/c, ULN2003A series, as the relay drivers.

Couple of obvious questions. [ its not egg sucking time, I'm just interested]
You need an OFF button.
Do you want 'break before make', or 'make before break', switching ?
All relays 'OFF' at power up.

If you don't like the SN74278 route,I have an idea using low power SCR's as the relay drivers and a few other components.

Attached SCR1 dwg, sorry its a little rough, but it gets the method across. SCR's TO92 style, 100mA
Push any button, all relays RL1 to 6, OFF, release the button then the selected relay switches ON.
Break before Make.

Regards
EricG
 
Last edited:
6 switches - 6 LED's

Eric - the SN74298 looks like a good idea. I'll pick a few up and give it a try. Regarding make before break, do you mean make the new relay connection before breaking the old? If so, it would be better to break the old before making the new.

Ron - I'll try this if I can't get the SN74298 to work.

LJ - I'll give this a try too but it isn't as much fun as doing it with some type of logic chip.

Thanks All!
 
Digger7 said:
Eric - the SN74298 looks like a good idea. I'll pick a few up and give it a try. Regarding make before break, do you mean make the new relay connection before breaking the old? If so, it would be better to break the old before making the new.

Ron - I'll try this if I can't get the SN74298 to work.

LJ - I'll give this a try too but it isn't as much fun as doing it with some type of logic chip.

Thanks All!
Digger,
What he means by brteak before make is:- do you want the operated solenoid to relaese before the next one? In other words, will it matter if 2 are both operated together briefly?

If you want to make the relay version "break before make", you will need another relay. Let me know if you want to do this and I'll modify the circuit.

I'll post an electronic suggestion for you shortly.
 
Last edited:
Here is another suggestion.

It has a delay to ensure that the operated solenoid is released before the other one operates.

Is your +12 Volt supply clean? ie. could there be spikes in it? If so, the ICs will need protection against them.

Circuit description.
When the power is turned on, U1c applies a high to the reset inputs of U2 & U3 which sets their outputs low, so no solenoids operate.

If say B3 is pressed, the output of U1b goes high after about 50 ms. This enters the data on the D inputs but since the outputs are disabled no solenoid operates.

About 0.5 second after B3 is released, the output of U1b goes low and thus enables the outputs. So Q3 goes high F3 is turned on and Solenoid 3 operates.

If say B1 is pressed, S3 is released after the 50 ms delay but S1 will not operate until the 0.5 s delay expires.

The operated solenoid can be released by pressing the reset button.

I have suggested using dual colour LEDs across the solenoid coils to provide protection of the Green LED against the back EMF from the coil when it is released. The Green LED is protected by the Red LED. If you used a normal LED, it would need a diode in parallel to protect it.

You will notice a short flash of the red LED when the solenoid is released. What is the resistance of the solenoid coil?

Note that the LEDs and resistors also protect the MOSFETs from the back EMF.
 

Attachments

  • Random switch.gif
    Random switch.gif
    24.4 KB · Views: 191
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top