Sequential switch design needed please.

Status
Not open for further replies.

Imagewerx

Member
I'm sure I could find this on Google,but for the life of me I can't even remember what it's called.

I've got a single push button that I want to use to give sequentially switched outputs in a 12 volt car type application.

At rest..............output 1 OFF,output 2 OFF
First press.........output 1 ON,output 2 OFF
Second press.....output1 ON,output 2 ON
Third press.........output 1 ON,output 2 OFF
Fourth press.......output 1 OFF,output 2 OFF

The outputs will drive relays that will switch the cars lights on and off,output 1 will be the sidelights and output 2 will be the headlights.

Chris.
 
You could do it with a schmitt triggered IC to debounce the pushbutton which would then clock a 4017 IC with the first 3 outputs routed through diodes to turn on the proper transistors to drive the relays. I hope that makes sense.
 
Last edited:
You could do it with a schmitt triggered IC to debounce the pushbutton which would then clock a 4017 IC with the first 3 outputs routed through diodes to turn on the proper transistors to drive the relays. I hope that makes sense.
But doesn't the 4017 only turn on the outputs in sequence,so 1 on/rest off,2 on/rest off/3 on/rest off etc.I need the successive outputs to leave the previous ones still switched on.

Chris.
 
Taking Brevor's idea, but adding a ULN2804, to provide both the logic you require, the transistors to power the relays, and the relay protection diodes to protect the output devices. Minimum component count for logic, switching and protection!!

Schematic ideas sketch attached.


Edit: The 'power on reset' (POR) time constant needs to be longer than the 'switch de-bounce' time constant. Make the POR resistor 470K.
 

Attachments

  • seq car light sw.jpg
    282.7 KB · Views: 538
Last edited:
But doesn't the 4017 only turn on the outputs in sequence,so 1 on/rest off,2 on/rest off/3 on/rest off etc.I need the successive outputs to leave the previous ones still switched on.

You could do it with a schmitt triggered IC to debounce the pushbutton which would then clock a 4017 IC with the first 3 outputs routed through diodes to turn on the proper transistors to drive the relays. I hope that makes sense.

The 4017 outputs are routed through diodes to give the proper outputs for each state.
 
The sketch I gave in post #4 does the same thing as Brevor's diode mixed outputs, but uses mixed 'open collectors' from the 2804 . As I say - the simplest option to do what you need.

Power on - 4017 pin 3 High. All other outputs low. Both relays off.

1st switch press - 4017 pin 2 High. All other outputs low. ULN2804 pin 1 high. Turns on output from pin 18. Energises RLY1 (connect sidelights to RLY1 contacts)

2nd switch press - 4017 pin 4 High . All other outputs low. ULN2804 pins 2 and 3 high. Turns on outputs from pin 17 and 16. energises both RLY 1 and 2. (headlights connected to RLY 2 contacts). Both headlights and sidelights on.

3rd switch press - 4017 pin 7 high. All other outputs low. ULN 3804 pin 4 high. Turns on output from pin 15 . Energises RLY 1 only again. (RLY 2 is now off)

4th switch press - 4017 pin 10 connects to pin 15 reset. 4017 pin 3 goes high again. All other outputs low. Both relays off.

It really doesn't get any simpler than that!!
 
Is that what you want?

The 4093 makes a debouncer circuit with approximately 150ms on time.

DC filtering and decoupling capacitors omitted for circuit clarity.


Boncuk
 

Attachments

  • SIDE-LIGHTS.gif
    9.8 KB · Views: 268
  • HEADLIGHTS.gif
    9.8 KB · Views: 211
  • BOTH.gif
    9.7 KB · Views: 249
  • OFF.gif
    9.6 KB · Views: 227
Last edited:
Boncuk -- you would still need to add the relay drivers (and protection diodes).

I think you might need to lengthen the debounce time constant a bit - depends on the switch of course, but with the variation of thresholds, depending on the 4093 manufacturer, a bit longer might be safer.

What's R3 for?
 
Boncuk -- you would still need to add the relay drivers (and protection diodes).

I know that! It was just a circuit suggestion.

I think you might need to lengthen the debounce time constant a bit - depends on the switch of course, but with the variation of thresholds, depending on the 4093 manufacturer, a bit longer might be safer.

I guess nothing has to be lengthened for the debounce time. The debouncer circuit switches output to high as long as the button is depressed + 150ms. No chip manufacturer builds CMOS IC which can't work in the milliseconds range.

What's R3 for?

R3 is a leftover of a foregoing experiment. It has now become a base resistor for T1 (relay driver for the side lights).

Last not least, how about throwing in your own suggestion instead of criticizing other member's posts?

Anyway, here is a full functioning circuit including a PCB design.

Boncuk
 

Attachments

  • TOGGLE-SWITCH.gif
    17.5 KB · Views: 287
  • TOGGLE-SWITCH-BRD.gif
    23.1 KB · Views: 282
Last not least, how about throwing in your own suggestion instead of criticizing other member's posts?

Can I refer you to the schematic I posted in post #4 ?
I thought it might be useful to include the relay drivers, and their protection diodes in one simple chip.
Shame you haven't found the time to glance at it . Could have saved you the trouble of starting all over again.

Tell me, why do you think a query about a superfluous resistor is a criticism?
 
Ok thanks Rogs and Boncuk,I like the latter design better purely for the lower component count.

Should have said I'm using a capacitive proximity switch and not an old fashioned electro-mechanical switch to operate it.Had three of them working in the car doing other jobs for the last year,so know they're stable enough for this sort of application.

Chris.
 

Sorry, I tried to read your schematic, but my eye surgeon is on vacation presently.

Tell me, why do you think a query about a superfluous resistor is a criticism?

That's a good one!

Your criticism was mainly about missing relay drivers and a too short pulse of the debouncer circuit.

I consider naming the superfluous resistor not being criticism but a necessary question about circuit function.

As shown in the simulation there is absolutely none. (Could possibly serve as wire jump using a zero Ohm resistor.)

Please, don't try to twist the words in my mouth.

Boncuk
 
Last edited:
Guys can we knock this on the head please? I see no problem with any of the advice I've been given so far but this is getting out of hand.So how about a nice group hug and everyone can be happy and put their differences behind them pleeeeaaase!!!

A massive thank you to Boncuk for the schematic and the PCB design which is a LOT more than I was expecting,is there any chance of the CAM files for this please?

Chris.
 
Chris - sorry for any unpleasantness. I guess I'm not always very good at understanding the sensitivities of people from different cultures!

I'm sure Boncuk will be pleased you've selected his design. (I'm assuming Boncuk is a 'he'? Apologies if not!)
 
In a way using someone elses design that works perfectly is good and bad at the same time.Good that it saves me time but bad that I don't learn anything if it doesn't work,which is what I want to do.If all I need to do is swap a couple of components around on a breadboard if somethings wrong,then it really doesn't worry me,in fact I think it's good if no damage has been done.
So just one more question Boncuk,the main problem I've been having with the electronic latches I've built so far (555s) is guaranteeing they always power up in their off state,I've cracked it now with a capacitor connected to ground and resistor to supply both on the reset pin.Is your design definately going to power up every time in the everything off state?
Oh and thanks to Kinarfi for that design,but it's a bit short of detail for me to understand?

Chris.
 
Hi Chris,

the original design started out with the side lights on.

After circuit modification it starts in the OFF-STATE when powering it up.

Here are the revised schematic and PCB design.

I also added a third image showing the PCB with a ground fill. Using ground fills etchant will work for many PCBs not dissolving much copper, thus being an advantage for a cleaner environment. (I'm not green.).

Board size is 100.33X46.0375mm (3.9500X1.825").

To obtain the Eagle files please PM me your full name and email-address.

Using Eagle you can print the PCB image without distortion and scaled 100%. Converting the *.brd file to e.g. *.pdf the result won't be properly scaled making it difficult (if at all) to place ICs.

Download Eagle light (free version) at

With the files I will give you instructions how to print the PCB layout.

Regards

Boncuk
 

Attachments

  • TOGGLE-LIGHT-SCH.gif
    17.2 KB · Views: 239
  • TOGGLE-LIGHT-BRD.gif
    23 KB · Views: 230
  • TOGGLE-LIGHT-FILL.gif
    24.1 KB · Views: 193
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…