Author Topic: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)  (Read 6937 times)

0 Members and 2 Guests are viewing this topic.

Offline bluevdTopic starter

  • Contributor
  • Posts: 12
Hello folks,
To keep is short and concise:
I'm trying to build a switch to drive a mosfet with 2 momentary buttons (1st button ON, 2nd OFF). I've got to a thyristor configuration using 2 transistors, but here's where it gets difficult for me (EE level: noob).
The switch is design to drive a motor (via a mosfet). The OFF button is actuated mechanically by the motor shaft. The problem is that I want the switch to be in OFF state once the 2nd button is pushed indifferently of the 1st switch state. That is, if the user keeps it pressed, once the 2nd switch is triggered, the circuit would not re-engage until the user depresses the ON switch and presses it again. My goal is to build it without the use of any IC (I want to use only passive elements). The thyristor configuration would normally work, but the motor inertia actuates the OFF switch and releases it (thus if the ON switch is still pressed, the motor keeps on spinning).
Any simple schematic will do (even without the explanation, I'll go step by step to figure it out and thus maybe learn a few things).
Thanks!
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)
« Reply #1 on: April 03, 2015, 08:59:47 pm »
Capacitively couple the switches so they must be released to let the capacitor recharge/discharge through a resistor before they can deliver another pulse to the bistable or thyristor.  Make sure the capacitors are big enough for reliable triggering . . .
 

Online janoc

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: de
Re: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)
« Reply #2 on: April 03, 2015, 09:25:26 pm »
I have just found exactly this sort of circuit in a small solar powered controller for a garden pond pump.



I am sorry for the messy schematics, this is a small part copied from a larger circuit, reverse engineered directly from the PCB. I didn't really clean it up as I am not done with the board yet. The transistors are some Chinese jellybean parts, in this case they are rated up to 1.5A collector current, but they are not really critical - size them depending on your needs. The battery voltage is around 6V (6V sealed lead acid battery).

Basically pushing the SW1 turns on the Q2 transistor, which turns on Q1 too. Q1 "shorts" the SW1, keeping the entire thing latched on. Pushing SW2 forces Q1 to close by grounding its base, thus Q2 closes too and the load goes off.

EDIT: I have realized only later that the objective was to make the load stop regardless of whether or not the user holds the start button down. The circuit above won't do that as-is. The simplest method is to add a normally close (NC) push button in series with the R6 resistor and remove the original OFF switch. Then when the new switch is triggered, the circuit will turn off, no matter whether the ON button is held down or not.

If you want to use a MOSFET for switching the load, you can either replace the Q2 with a P-channel one or use Q2 to drive a MOSFET - e.g. by putting a resistor to ground in the collector of Q2 and using the voltage drop on this resistor to drive a gate of an N-channel FET.

Disclaimer: This is a reverse engineered circuit, I haven't tried to build it. There could be mistakes in the schematics. YMMV.

Dave has an excellent video on a similar circuit too:
http://www.eevblog.com/2012/03/30/eevblog-262-worlds-simplest-soft-latching-power-switch-circuit/
« Last Edit: April 06, 2015, 12:43:40 am by janoc »
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)
« Reply #3 on: April 03, 2015, 10:21:33 pm »
A simple relay, using one contact pair to latch the coil voltage.
One NO momentary PB to 'turn on'
An NC contact to release the relay at the end point of the motor.
No other parts.
Don't ask a question if you aren't willing to listen to the answer.
 

Offline JesusCB

  • Contributor
  • Posts: 12
Re: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)
« Reply #4 on: April 04, 2015, 11:06:51 pm »
Last semester I did something like that with an arduino, but there are other ways to do it like SL4P said.
 

Offline cosmicray

  • Frequent Contributor
  • **
  • Posts: 308
  • Country: us
Re: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)
« Reply #5 on: April 04, 2015, 11:08:55 pm »
A simple relay, using one contact pair to latch the coil voltage.
One NO momentary PB to 'turn on'
An NC contact to release the relay at the end point of the motor.
No other parts.
A 2-coil latching relay would also do that. One switch/coil to latch, one to unlatch.
it's only funny until someone gets hurt, then it's hilarious - R. Rabbit
 

Offline bluevdTopic starter

  • Contributor
  • Posts: 12
Re: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)
« Reply #6 on: April 06, 2015, 01:55:33 pm »
Capacitively couple the switches so they must be released to let the capacitor recharge/discharge through a resistor before they can deliver another pulse to the bistable or thyristor.  Make sure the capacitors are big enough for reliable triggering . . .
Thanks Ian,
Best answer I could have gotten! I ended up learning a few things while researching your idea.
I've attached a rough schema of the circuit (most values will need to be calculated properly based on the transistors). The 2 switches that are highlighted in red will be replaced with a 2 way momentary switch. If you guys see anything wrong with this design please let me know.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6460
  • Country: nl
Re: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)
« Reply #7 on: April 06, 2015, 06:23:16 pm »
Have a look at eevblog 262 for some ideas, dave also mentions very briefly your situation.
 

Online janoc

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: de
Re: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)
« Reply #8 on: April 06, 2015, 06:26:18 pm »
I don't think this will work as you want - if those two switches in the upper left corner are both on, the capacitor is bypassed and the circuit will be constantly on, no matter what you do with the OFF switch.

Put a normally closed switch in series, e.g. between the base of the PNP transistor and the base resistor, and drop the capacitor - in that way when you push this switch, it will break the base current to the transistor and the circuit will go off, regardless of the state of the ON switch.

 

Offline bluevdTopic starter

  • Contributor
  • Posts: 12
Re: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)
« Reply #9 on: April 07, 2015, 10:13:32 pm »
I don't think this will work as you want - if those two switches in the upper left corner are both on, the capacitor is bypassed and the circuit will be constantly on, no matter what you do with the OFF switch.

Put a normally closed switch in series, e.g. between the base of the PNP transistor and the base resistor, and drop the capacitor - in that way when you push this switch, it will break the base current to the transistor and the circuit will go off, regardless of the state of the ON switch.
Hello Janoc,
While this would be the simplest solution, the problem is that for my specific application it does not work (not do the relay solutions posted above). Here's why:
The circuit is used to power on and off a motor via a mosfet/relay/etc. The motor itself is used in a gearbox with the end gear pulling a spring based mechanism. Also, the end gear has a rigid leaver to engage the off switch once a full turn is complete. The load on the end gear is released mechanically right before the engagement of the off switch. Because of this release, the gear gathers quite the momentum, and, once the off switch is triggered, it will still rotate a bit (causing the off switch to bounce back to depressed state).
The purpose of the circuit is to ensure that one cycle is complete per each engagement of the on switch. The switch I mention above is a SPDT - ON-MON (but because I was using and online program to draw the diagram I represented it via 2 switches).
 

Offline Annakin4

  • Contributor
  • Posts: 26
  • Country: us
  • If it's fixed, I'll break it!
Re: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)
« Reply #10 on: April 08, 2015, 12:14:29 pm »
I agree with the relay idea, that would be the simplest route
 

Offline Grapsus

  • Regular Contributor
  • *
  • Posts: 242
  • Country: fr
Re: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)
« Reply #11 on: April 08, 2015, 12:25:49 pm »
What is the load to be switched ? Relay contacts tend to bounce before making and it might be a problem. Also for capacitive loads a relay might produce a huge inrush current whereas a transistor activation can be smoothed if necessary.
 

Offline Annakin4

  • Contributor
  • Posts: 26
  • Country: us
  • If it's fixed, I'll break it!
Re: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)
« Reply #12 on: April 08, 2015, 01:05:35 pm »
Can't you use both a capacitor and a inductor to help make the relay smooth and less harsh?
 

Online janoc

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: de
Re: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)
« Reply #13 on: April 08, 2015, 09:25:16 pm »
Hello Janoc,
While this would be the simplest solution, the problem is that for my specific application it does not work (not do the relay solutions posted above). Here's why:
The circuit is used to power on and off a motor via a mosfet/relay/etc. The motor itself is used in a gearbox with the end gear pulling a spring based mechanism. Also, the end gear has a rigid leaver to engage the off switch once a full turn is complete. The load on the end gear is released mechanically right before the engagement of the off switch. Because of this release, the gear gathers quite the momentum, and, once the off switch is triggered, it will still rotate a bit (causing the off switch to bounce back to depressed state).

Right. So if I understood correctly, your mechanism "bounces" and you want to ensure that no matter what mechanical oscillations it does, it stays off, even though the ON switch could be still held.

One thing you can do is to add an R-C circuit to make the ON switch produce only an impulse when it is pressed down. Holding it will not generate any more impulses. Then the bouncing of the off switch won't really matter. I believe this was actually suggested by someone already.

If you need something more robust, then I would likely build this using a micro and a simple state machine to ensure that all the constraints are met. Doing the interlocking in just discrete parts is going to be a PITA.

The purpose of the circuit is to ensure that one cycle is complete per each engagement of the on switch. The switch I mention above is a SPDT - ON-MON (but because I was using and online program to draw the diagram I represented it via 2 switches).

I am a bit confused about the point of the two switches (or two halves of a single switch). What is the purpose of the switch with the 100R resistor in series there? Closing the top left one (the one in series with the cap) will turn the circuit on already. The one with the resistor does nothing if the top left one is open (one pin floating). And if it is closed, the switch with the resistor will just bypass the cap, but that doesn't do anything, because the circuit is on already ...
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6460
  • Country: nl
Re: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)
« Reply #14 on: April 09, 2015, 07:39:01 am »
The requirements are getting sillier, the off switch can bounce back ?
Well then use an emergency stop actuator on top of the switch.
Check out Eaton M22 series of switches and emergency stop switches, like the M22-PV. You need the M22 switch and adapter with it or buy the complete with switches M22-PV/K11.
They can not switch back on till the user rotates or for the above mentioned switch pulls back (mechanically) the knob to re-engage it.
For motors and safety requirements you given this is almost a must.
« Last Edit: April 09, 2015, 08:01:39 am by Kjelt »
 

Online janoc

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: de
Re: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)
« Reply #15 on: April 10, 2015, 08:06:56 pm »
The requirements are getting sillier, the off switch can bounce back ?
Well then use an emergency stop actuator on top of the switch.
...
They can not switch back on till the user rotates or for the above mentioned switch pulls back (mechanically) the knob to re-engage it.
For motors and safety requirements you given this is almost a must.

I suspect that he wants to have some sort of endstop switch, not something that the user is actually supposed to actuate. If I understood it right, the user triggers the "ON" switch to cycle the machine and the "OFF" switch is actuated by the mechanism. And the electronics must ensure that the device actually stops when the "OFF" switch is hit, regardless of any bouncing or that the user is holding the "ON" down. Oh and it needs to be able to cycle again when the "ON" is actuated again after stopping.

To me this is fairly complex and a job for a state machine. It would be a good challenge to do in discrete parts, but not really economical, IMO. the circuit will be quite complicated, hard to modify and take much more space than a small microcontroller - even an 8 pin ATTiny25 or the PIC10 series ($0.40/piece) can do something like this easily.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6460
  • Country: nl
Re: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)
« Reply #16 on: April 10, 2015, 10:28:20 pm »
A flipflop like the hef4013 costing $0,40 can do this.
Make data high and the user on button to clock in.
Each press of the button clocks the flipflop to set.

Use the off switch on the reset input always overruling even when on button is pressed since the clock is edge triggered and done.
But he does not want to use an ic which is bullocks with these requirements.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)
« Reply #17 on: April 11, 2015, 02:22:23 am »
Certainly the easiest option is a low pin count microcontroller. 

Obviously it can also be done in logic, with two flipflops, one for the motor state and the other to reliably debounce the start button, + a gate or two to remove the stop signal from the motor state flipflop reset pin once its been reset to stopped so that the start (clock in a 1) will actually work, and also to provide a POR signal.

However for the hell of it I had a go at doing it with discretes in LTSPICE using an Eccles-Jordan bistable. 


The crud on the left is the supply + two pulse sequences to provide the switch timing for the simulation.  Then there's the actual switches (voltage controlled for simulation only) capacitively coupled to the bistable.  On the right is a diode coupled RC reset circuit and a Darlington pair to drive the load. 

Its incredibly fussy about component values. e.g. if the bistable coupling resistors and trigger coupling capacitors have the wrong ratio of values, it doesn't trigger, and if the pullup resistors that recharge the coupling capacitors are too small it false triggers with the opposite action when the switches open.  I certainly wouldn't want to build it for real life use!  :-DD

I've attached the LTspice file if anyone else wants to play with it.(strip the .txt extension)
 

Online janoc

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: de
Re: ON/OFF Switch with 2 momentary push buttons (1st ON, 2nd OFF)
« Reply #18 on: April 12, 2015, 01:18:57 pm »
It could probably be done with a few 555 timers too :)
 
The following users thanked this post: bluevd


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf