Author Topic: Single momentary push-button for on-off (toggling) a signal connection  (Read 3812 times)

0 Members and 1 Guest are viewing this topic.

Offline belzrebuthTopic starter

  • Frequent Contributor
  • **
  • Posts: 508
  • Country: gr
Hi all,
I've been struggling to implement a push button toggle action to connect point A of a circuit to point B.
Signal to be switched is a unipolar 5.6V pulse with varying pw going to a trigger input.
PW is not important as the trigger input works at positive rise.

I want to press the button once to latch it and then de-latch when I press it again.
This is not a single switch power-on power-off where there are already many examples on the net.

I initially thought about using a 4066 switch with a flip flop so the momentary switch can latch the flip flop to an "on" state thus activating the switch control input for the switch to make the connection.

I haven't managed to make it work in multisim for some reason but this already feels like two wasted ICs for what is seemingly a trivial(?) task.

I've attached screenshots of my simulation.The blue trace is the FF output and the yellow trace is the switch output.
It seems like there is considerable amount of signal passing thru the 4066 even with its control switch to 0 volts.
I don't see any reason for that and I don't care using this exact circuit as it is already as it requires two logic ICs.

Is there a simpler approach maybe with nor gates only?
I have spare nor gates in the circuit that I could use to make the flip flop but what about the switch?
Can I get rid of that too?
Or is there an even simpler approach?

 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 13911
Re: Single momentary push-button for on-off (toggling) a signal connection
« Reply #1 on: December 17, 2020, 01:37:46 pm »
The signal leak through problem is because you aren't grounding the output when the 4066 pass switch is off.  Use another switch in U2 to do that, with an inverted control signal.

Yes, you can make it a lot simpler, reducing it to a single chip :- the remaining two switches in U2 can be used with pullup resistors to implement two inverters, then you can use the inverters to implement a latching toggle flipflop with Q and /Q outputs to drive the signal switches.

I suggest 4.7K pullups on each inverter output, a 47K feedback resistor and a 470K charging resistor for the toggle capacitor.  To get it to power up in a known state, add a 1nF cap from the input of the left inverter to ground.

However it would be better and easier to use a CD4053 triple SPDT switch.  The sections used as inverters would no longer need pullup resistors and the NC pin of the signal switch could be used to ground the output (COM pin) when it isn't connected to the signal source on the NO pin.
« Last Edit: December 17, 2020, 06:28:52 pm by Ian.M »
 

Offline belzrebuthTopic starter

  • Frequent Contributor
  • **
  • Posts: 508
  • Country: gr
Re: Single momentary push-button for on-off (toggling) a signal connection
« Reply #2 on: December 17, 2020, 03:59:15 pm »
Τhanks!I'll try that.
Sadly the 4053 does not seem to exist in multisim so I can't simulate this circuit..

So I need both the flip flop to latch the "on" signal and the 4053 to do the actual switching.

I'll try the inverter solution and post back!One chip solution would be great..
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 13911
Re: Single momentary push-button for on-off (toggling) a signal connection
« Reply #3 on: December 17, 2020, 04:20:46 pm »
You wire two switch sections of either the 4066 or 4053 to act as inverters.  A 4066 switch is on when its input is high so to make it an inverter, you wire one side of the switch to ground and the other to a pullup resistor.  A 4053 switch connects common to x when the control input is low and to y when its high, so to make it an inverter, connect x to Vdd and y to ground and take the output from common.

I've attached a LTspice sim of the 4066 version.
Note that it includes debouncing for the switch (and a test of that).  Your original concept of connecting the Clk input of a flipflop direct to a switch has no debouncing so would be extremely unreliable, even if you added an input pulldown resistor to get a valid logic low level.
 

Offline belzrebuthTopic starter

  • Frequent Contributor
  • **
  • Posts: 508
  • Country: gr
Re: Single momentary push-button for on-off (toggling) a signal connection
« Reply #4 on: December 17, 2020, 04:24:57 pm »
I just tried your suggestion above with the inverters and the 4066 grounding the output with the inverter control signal.
It works a treat!
Off to try the single chip solution:)
 

Offline belzrebuthTopic starter

  • Frequent Contributor
  • **
  • Posts: 508
  • Country: gr
Re: Single momentary push-button for on-off (toggling) a signal connection
« Reply #5 on: December 17, 2020, 05:24:19 pm »
Last question!
Could this be powered by 12V?
My circuit runs on +-12V (the pulse that needs to be switched is still around 5.6V so the 4066 won't need to handle a 12V signal) .
I think the 4066 might be tolerant in unipolar operation up to 15V but maybe I'm wrong...
I should really check that datasheet..

edit: It works in simulation so I'll try breadboarding this later to verify everything's well.
Thanks for your time Ian, I really appreciate this.
« Last Edit: December 17, 2020, 05:40:53 pm by belzrebuth »
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 13911
Re: Single momentary push-button for on-off (toggling) a signal connection
« Reply #6 on: December 17, 2020, 06:00:10 pm »
A real CMOS 4000 series 4066 (as opposed to a 74HC(T)4066 or similar)  will be rated for operation up to 18V.  As you've got to switch a 5.6V pulse, you cant use a 5V supply, so power it between your +12V rail and ground.

If you need to handle bipolar signals, use a 4053 as that has a separate negative supply pin Vee , so can handle signals that go negative of the logic ground Vss.
 

Offline belzrebuthTopic starter

  • Frequent Contributor
  • **
  • Posts: 508
  • Country: gr
Re: Single momentary push-button for on-off (toggling) a signal connection
« Reply #7 on: December 17, 2020, 06:01:48 pm »
Thanks!
I'll keep that in mind, it might prove useful for future projects that might involve electronic switching of bipolar signals.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf