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.

Electronic Switch

Status
Not open for further replies.

Overclocked

Member
How can I use a momentary switch (like a membrane switch) To control something? I want it to turn the device On or off by pressing the button. Ive tried latches, but it seems you need 2 Switches for the device to work.
 
You could also use either a J-K flip-flop or D-Latch flip-flop circuit to get the desired results. If memory serves me well, a similar post addressed this very same topic.

Try using the search function and search for those key-words, or the IC's 4013, 7474 (D-Latch) or 7476 (J-K)

Some Examples ... http://www.cpemma.co.uk/flipflop.html
 
Last edited:
Overclocked said:
How can I use a momentary switch (like a membrane switch) To control something? I want it to turn the device On or off by pressing the button. Ive tried latches, but it seems you need 2 Switches for the device to work.
You can do it with one switch and a JK or D type Flip Flop.

However, you need a bounce suppressor to eliminate contact bounce from the switch. Otherwise, the FF will toggle at every bounce and, when the bouncing has finished, be either in the set or reset state depending on whether there was an odd or even number of bounces.

Connect the switch to the bounce suppressor and the output of the BS to the Ck input of the FF. For a D type FF connect D to Q bar.

Do a search for "bounce" in this forum. There have been several circuits posted in the past including some by myself.
 
Overclocked said:
How can I use a momentary switch (like a membrane switch) To control something? I want it to turn the device On or off by pressing the button. Ive tried latches, but it seems you need 2 Switches for the device to work.
Try This Diagram I already built.Working fine.but it has about 1s (Propogation delay) delay.(output swtching Delay)
 

Attachments

  • Latch.gif
    Latch.gif
    5.7 KB · Views: 2,804
This circuit uses a momentary pushbutton. Push and it is on. Push again and it is off. Push again and it is on again, etc. It can drive a transistor or Mosfet for more output power.
 

Attachments

  • Alternate-action.gif
    Alternate-action.gif
    3.6 KB · Views: 1,087
A very interesting, clever design,
from an old book on relay circuit design (probably 1951),
a toggle flip-flop, using only two relays, is shown in
attachment toggle1.png
 

Attachments

  • toggle1.png
    toggle1.png
    1.8 KB · Views: 915
audioguru said:
This circuit uses a momentary pushbutton. Push and it is on. Push again and it is off. Push again and it is on again, etc. It can drive a transistor or Mosfet for more output power.


This circuit should be a sticky somewhere. It is requested about once every 6 weeks! :):):):):)
 
audioguru said:
This circuit uses a momentary pushbutton. Push and it is on. Push again and it is off. Push again and it is on again, etc. It can drive a transistor or Mosfet for more output power.

Interesting. I ran a simulation on that circuit using multisim, It oscillates when the switch is open, and when the switch closes (for 1 Moment in time-I used a momentary) it stops. If I press it again it doesnt change states.

ADD: Got it to do what I want. I used a D type FF used as a toggle FF.

**broken link removed**
 
Last edited:
The latching circuit with two inverters works fine. Multisim doesn't know if it is coming or going.
 
audioguru said:
The latching circuit with two inverters works fine. Multisim doesn't know if it is coming or going.
Audio, Are you sure?

I designed to attached circuit a year or 3 ago and found that the oscillator (which is similar to your latch) had ringing at each edge. I solved it by adding C4 at the input to IC1a.
 

Attachments

  • Digital Dice_1.gif
    Digital Dice_1.gif
    12.2 KB · Views: 947
Hi Len,
You used the Classic Cmos Oscillator circuit but you used a Schmitt-trigger IC instead of a regular one. You could have used only a single Schmitt inverter instead.
 

Attachments

  • Cmos Oscillators.PNG
    Cmos Oscillators.PNG
    16.3 KB · Views: 1,187
audioguru said:
Hi Len,
You used the Classic Cmos Oscillator circuit but you used a Schmitt-trigger IC instead of a regular one. You could have used only a single Schmitt inverter instead.
Yes, I know Audio, I have used the single one occasionally but, what I don't like about it is that it is always working in the active region and therefore needs more supply current than the 2 inverter one.

This is because the 2 Inv one causes the input voltage (ie. to the second Schmitt) to go above Vcc at the transition and decay to the lower threshold level where it switches regeneratively to the other state and so the input voltage goes negative and then decays to the upper threshold etc.

So there is less time spent in the active region, therefore less supply current.
 
Hi Len,
I made 3 LED Chaser projects. This one uses ordinary Cmos Schmitt trigger inverters in oscillators from a 6V battery that lasts "forever". I also have it made with 74HC Cmos Schmitt trigger inverters so it can operate from a 3V battery that drops to 2V. The current is very low.
 

Attachments

  • 6V LED Chaser schematic.JPG
    6V LED Chaser schematic.JPG
    91.6 KB · Views: 906
audioguru said:
Hi Len,
I made 3 LED Chaser projects. This one uses ordinary Cmos Schmitt trigger inverters in oscillators from a 6V battery that lasts "forever". I also have it made with 74HC Cmos Schmitt trigger inverters so it can operate from a 3V battery that drops to 2V. The current is very low.
G'day Audio, That's interesting, I've never bothered to measure the supply current of the one Schmitt Oscillator nor look at the Schmitt data sheets (as far as supply current is concerned). So I assume that the Schmitts are designed to not consume excess current while the input is in the mid range.

Thanks for the info.

have a good Xmas
 
This circuit uses a momentary pushbutton. Push and it is on. Push again and it is off. Push again and it is on again, etc. It can drive a transistor or Mosfet for more output power.

Audioguru, that's fantastic.

But, can it divide the frequency of a square wave?

thx!
 
Below is the LTspice simulation of AG's post #5 circuit, which simulates fine.
I increased the value of C1 to be more resistance to the PB's bounces.

For more output drive you can parallel the inputs and outputs of the remaining 4 inverters in the package with U2.

upload_2017-8-9_12-10-24.png
 

Attachments

  • PB Alt Action.asc
    2.4 KB · Views: 267
Last edited:
Thanks, crutschow!

Very elegant. Wish I'd known about this latch idea a few projects ago...:woot:.
 
Below is the LTspice simulation of AG's post #5 circuit
correct me if i'm wrong, but this does not look like i can replace the whole switch block with an external oscillator. This circuit divides the switching freq, but it needs to be an switch, not oscillator, correct? This other thread seems to conclude that this design has a limited frequency bandwidth, correct?

thx!
 
The circuit in post #5 is *not* an oscillator. It is a classic positive-feedback latch circuit modified with a capacitor as a memory element. The original requirement was for something to turn a SPST momentary switch into an alternate-action output. This does that very well. Note that a firm requirement of the circuit is that neither end of the switch is tied to either power rail. Because of that, and another requirement that the switch present a very high impedance when not pushed, the circuit cannot be used as a divide-by-two for any other signals. It effectively divides the action of a mechanical switch by two, but that is all.

ak
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top