latching IC - how to make work

Discussion in 'The Projects Forum' started by aj7877, Jul 6, 2008.

  1. aj7877

    Thread Starter New Member

    Jul 5, 2008
    6
    0
    Hi,

    I wondered if anyone can tell me how you would generally design a circuit to do the following.

    I want to have two momentary switches, when you press one switch, it sends voltage to an IC and it latches on to drive a transistor. When you press the other switch it also sends a voltage to an IC and the IC latches another set of gates to drive at transistor. At the same time, it unlatches the first set of gates.

    I've been looking through my old electronics books and google but still can't quite figure out how it's done.

    Also, any suggestions on the IC to use?

    Thanks
     
  2. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    I believe what you are thinking of is a Set\Reset Flip Flop. They exist in almost every flip flop made. Basically they can be made with 2 NOR or 2 NAND gates, I'll draw a schematic shortly. The thing you will need to keep in mind is the pull up or pull down resistors, which keep the chip happy when the button isn't pressed.

    *******************

    This is a basic Set Reset Flip Flop....

    [​IMG]

    Just look for any flip flop IC that has S and R inputs, the CMOS 4013 or 4027 comes to mind, but the numbers of chips that have this function are so common it is completely open to choice.
     
    Last edited: Jul 7, 2008
  3. Søren

    Senior Member

    Sep 2, 2006
    472
    28
    Hi,

    Using NOR gates (like in your drawing), you need pull downs and the switches should go to Vdd. As you have drawn them, the gates should be of the NAND variety.
     
  4. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    You're right, I took about 5 minutes to draw it up and it was late.

    *************************************

    I've corrected and enhanced the drawing.
     
    Last edited: Jul 7, 2008
  5. aj7877

    Thread Starter New Member

    Jul 5, 2008
    6
    0
    So a couple of questions now. I've been doing some more reading. Is this an SR latch?

    Also, what do the resistors do? I'm guessing that they either pull the input to ground when the switch is open. Or do they limit the current when the switch is closed? What values would you suggest?
     
  6. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    With CMOS chips you could use as high as 10MΩ, though 1MΩ might be better, they provide bias for the inputs. Some logic families will assume a logic level if they pin is left with no connections, but CMOS isn't one of them so you give it something or it can just oscillate. These are refereed to as pull up resistors and pull down resistors respectively, and are very common in most logic families.

    Yes, it can be called a SR latch, latch being an alternate name for flip flop. These are the core for all flip flops, add a second set and you can make a circuit that toggles off a clock pulse, refereed to as a master/slave flip flop. Volume 4 Chapter 10 of the AAC eBook covers flip flops (aka multivibrators).
     
    Last edited: Jul 7, 2008
  7. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    If you want an SR latch in 4000 series CMOS, look up the data sheet on a CD4044. For CMOS, anything between 100K and 47K works fine for the pullups (or -downs).
     
  8. aj7877

    Thread Starter New Member

    Jul 5, 2008
    6
    0
    Thanks guys, I'm starting to get my head around it. It's been 5 years since I have done any electronics.

    What I'm trying to achieve is this. I have 3 momentary switches, when I press switch A I want a high output that is latched.

    When I press switch B I also want a high output but the output needs to be separate from switch A. Same again for switch C - needs to be a separate output from switch A & B.

    When each switch is pressed, it must cancel/reset the latch from the other two switches.
     
  9. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    See the attached. It's using a single CMOS 40106 Schmitt trigger hex inverter, a dozen resistors, three SP NO pushbuttons and a 0.1uF cap.

    It should run OK on anything between 3v and 16v. The cap makes it automatically select Out1 high on power up. One of the three outputs will always be high, the other two will be low, depending upon power up or which switch was pressed last.

    CMOS IC's will only output a few mA's. Look at using Darlington transistors or MOSFETS to power other things like relays, etc.

    If you're running at 5v or below, put a 3.3k resistor between this circuit's outputs and the load; if over 5v, use 10k resistors. If you use a Darlington driver IC like a ULN2003A (for <=5V) or ULN2004A (for >5v), they have built-in base resistors so you won't need to add them.
     
    Last edited: Jul 9, 2008
  10. aj7877

    Thread Starter New Member

    Jul 5, 2008
    6
    0
    Thanks for the drawing. I appreciate it. Can you explain how it works in a little more detail? And where do I put the Vcc?
     
Loading...