1. 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.
    Dismiss Notice

Electronic Switch

Discussion in 'General Electronics Chat' started by Overclocked, Dec 18, 2006.

  1. Overclocked

    Overclocked Member

    Joined:
    Oct 10, 2005
    Messages:
    783
    Likes:
    16
    Location:
    CT, USA
    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.
     
  2. SPDCHK

    SPDCHK Member

    Joined:
    May 26, 2006
    Messages:
    446
    Likes:
    17
    Location:
    South Africa
    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: Dec 18, 2006
  3. ljcox

    ljcox Well-Known Member

    Joined:
    Dec 25, 2003
    Messages:
    3,226
    Likes:
    28
    Location:
    Melbourne Australia
    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.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Gayan Soyza

    Gayan Soyza Active Member

    Joined:
    Oct 23, 2006
    Messages:
    1,822
    Likes:
    19
    Location:
    Colombo

    Try This Diagram I already built.Working fine.but it has about 1s (Propogation delay) delay.(output swtching Delay)
     

    Attached Files:

  6. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,589
    Likes:
    951
    Location:
    Canada, of course!
    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.
     

    Attached Files:

  7. em2006

    em2006 Member

    Joined:
    Nov 6, 2006
    Messages:
    98
    Likes:
    2
    Location:
    Bucharest, Romania
    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
     

    Attached Files:

  8. Analog

    Analog New Member

    Joined:
    Jul 18, 2006
    Messages:
    483
    Likes:
    4
    Location:
    Michigan USA

    This circuit should be a sticky somewhere. It is requested about once every 6 weeks! :):):):):)
     
  9. Overclocked

    Overclocked Member

    Joined:
    Oct 10, 2005
    Messages:
    783
    Likes:
    16
    Location:
    CT, USA
    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.

    http://www.doctronics.co.uk/4013.htm
     
    Last edited: Dec 19, 2006
  10. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,589
    Likes:
    951
    Location:
    Canada, of course!
    The latching circuit with two inverters works fine. Multisim doesn't know if it is coming or going.
     
  11. ljcox

    ljcox Well-Known Member

    Joined:
    Dec 25, 2003
    Messages:
    3,226
    Likes:
    28
    Location:
    Melbourne Australia
    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.
     

    Attached Files:

  12. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,589
    Likes:
    951
    Location:
    Canada, of course!
    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.
     

    Attached Files:

  13. ljcox

    ljcox Well-Known Member

    Joined:
    Dec 25, 2003
    Messages:
    3,226
    Likes:
    28
    Location:
    Melbourne Australia
    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.
     
  14. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,589
    Likes:
    951
    Location:
    Canada, of course!
    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.
     

    Attached Files:

  15. ljcox

    ljcox Well-Known Member

    Joined:
    Dec 25, 2003
    Messages:
    3,226
    Likes:
    28
    Location:
    Melbourne Australia
    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
     
  16. johnyradio

    johnyradio Member

    Joined:
    Jun 16, 2012
    Messages:
    29
    Likes:
    0
    Audioguru, that's fantastic.

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

    thx!
     
  17. crutschow

    crutschow Well-Known Member Most Helpful Member

    Joined:
    Mar 14, 2008
    Messages:
    10,623
    Likes:
    479
    Location:
    L.A., USA Zulu -8
    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
     

    Attached Files:

    Last edited: Aug 9, 2017
    • Like Like x 1
  18. cowboybob

    cowboybob Well-Known Member Most Helpful Member

    Joined:
    Oct 22, 2011
    Messages:
    3,052
    Likes:
    479
    Location:
    James Island, SC
    Thanks, crutschow!

    Very elegant. Wish I'd known about this latch idea a few projects ago...:woot:.
     
  19. johnyradio

    johnyradio Member

    Joined:
    Jun 16, 2012
    Messages:
    29
    Likes:
    0
    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!
     
  20. AnalogKid

    AnalogKid Well-Known Member

    Joined:
    Sep 22, 2011
    Messages:
    1,138
    Likes:
    161
    Location:
    Ohio - GMT-5
    ONLINE
    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
     
    • Like Like x 1

Share This Page