Jk flip flop with preset and clear

Discussion in 'General Electronics Chat' started by Nathan Hale, Dec 18, 2013.

  1. Nathan Hale

    Thread Starter Active Member

    Oct 28, 2011
    125
    2
    hello guys! hope all is well. i just put together the circuit that is pictured below to make a jeopardy style led system. the first guy to push the button gets his led lit up. firstly i am using "7476 DUAL JK FLIP FLOP WITH PRESET AND CLEAR" instead of the d type flip flops shown in the figure. i figured it should work.
    i am also making sure the clear and presets going into the flip flops are low by using a hex inverter.

    here the problems begin.

    firstly after the clear button is pushed all the leds are supposed to turn off and stay off. this is not happening. what is happening is after i hit the clear button ( which is a momentary contact switch ) led "D" turns on and stays on forever while led B is blinking at random intervals.

    secondly while led "D" is on, i went ahead and turned on switch A which is a normal spst switch. right away the other three leds start flashing at random. Ideally, when i turn on one of the switches ( be it switch A,B,C,or D ) the corresponding led and ONLY that led is supposed to light up and stay lit. this is not happening. the leds are blinking randomly and then shut off and then one starts blinking for few seconds and then shuts off and then another other turns on and then stays lit. they are blinking haphazardly with no rhyme or rhythm.

    Do you guys have any thoughts as to why the circuit is not behaving the way it is supposed to?
    Thank You very much.

    here is the original website i got it from and the author's explanation .....

    http://www.zen22142.zen.co.uk/Circuits/Misc/quiz.htm

    Circuit Operation
    Pressing the reset switch will clear all flip flops and extinguish any lit LED's. Under this condition the Q outputs will all be low (logic 0) and NOT Q outputs will be high (logic 1). All four NOT Q outputs are fed to a 4 input AND gate, the 4082 whose output will also be high. The output of the 4082 is wired to one input of each 2 input AND gate (4081). Switch inputs A,B,C,D are all non latching push button switches, the first person to press their switch will cause the corresponding AND gate (4081) to go high and trigger the preset input of the 4013 D-type flip flop. This will latch and light the appropriate LED. Also the triggered flip flop will have its NOT Q output, set at low, this changes the 4082 output to low and prevents any further triggering of the other flip flops.Switch contact de-bouncing is not required as the first press will latch one of the bistables. Pressing the reset switch, restores the circuit to its former state. I would recommend using heavy duty push button switches, as in use they are likely to be under some stress.

    [​IMG]
     
    Last edited: Dec 18, 2013
  2. MrChips

    Moderator

    Oct 2, 2009
    12,439
    3,360
    We cannot see your circuit.
    In any case, be aware that you cannot mix TTL and CMOS gates.
     
  3. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    It is impossible to guess what went wrong without seeing YOUR schematic, not another schematic that inspired your work. That would explain what you mean by "clear and presets going into the flip flops are low* by using a hex inverter."

    *A wire is typically used to keep inputs low.
     
  4. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,791
    1,103
    If you can't get it working as intended, all those randomly flashing LEDs will at least make a nice Christmas decoration :D.
     
  5. sheldons

    Active Member

    Oct 26, 2011
    616
    101
    Heres his schematic....
     
    • quiz.png
      quiz.png
      File size:
      14.4 KB
      Views:
      243
  6. MrChips

    Moderator

    Oct 2, 2009
    12,439
    3,360
    Without seeing your modified circuit, here are some more tips.

    You cannot use a 1kΩ resistor to pull down TTL inputs. The resistance has to be less that 220Ω.

    You do not need inverters in order to invert the logic from the RESET push button. Simply use a 1kΩ pullup resistor and connect the RESET push button between CLR and GND.

    The original circuit shows some serious flaws. You cannot leave unused inputs not connected, i.e. D and CLK. Connect all of these to GND.

    As I said before, you cannot mix 4000 series CMOS gates with 7400 or 74LS00 TTL logic. Try to keep all logic ICs in the same family or compatible families. For example, you can use 74C00 or 74HC00 with 4000 series.
     
    Nathan Hale likes this.
  7. Nathan Hale

    Thread Starter Active Member

    Oct 28, 2011
    125
    2
    Thank you for all replies guys. I am using strictly TTL ICs only. I posted the schematic just to give you guys a rough idea about what i am doing. anyways as Mr Chips said, i will go ahead and not leave any unused inputs unconnected.
     
  8. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    Nope, he's made several changes.

    Actually TTL tolerates floating inputs very well you can get away with it for most breadboards... but terminate them anyway.
     
    Nathan Hale likes this.
  9. Nathan Hale

    Thread Starter Active Member

    Oct 28, 2011
    125
    2
    Just made all the J and K inputs GND and also the CLK inputs GND.
    Here is what is happening.....
    When i hit the Reset switch all the LEDs turn off as they are supposed to. The moment after i release the reset switch one of the LEDs ( LED "B" which is amber ) is turning on and is staying on.
    While this amber LED is on and....When i turn on switch A or B or C or D, LED B is turning off and the corresponding LED is lighting up which is a good thing. ( Just that you know when i hit switch B the amber LED is glowing a bit more brighter.)

    I need all the LEDs to stay off after I hit clear. This is because if one of the LEDs is on even before the quiz master asks his question, the quiz master will end up getting confused.I am also incorporating a buzzer in parallel with each LED. It would be one annoying game show if the buzzer corresponding to LED B turns on and stays on the whole time.

    Do you guys know why LED B is turning on right after i trigger CLR? Can you tell me what i could do to get this LED B to stay off and only turn on when a contestant hits switch B?

    Thank You

    p.s. I do know that somewhere some how the Q out put corresponding to LED B is going high. Thats why the LED is turning on.
    http://forum.allaboutcircuits.com/attachment.php?attachmentid=62750&d=1387421586
     
    Last edited: Dec 18, 2013
  10. Nathan Hale

    Thread Starter Active Member

    Oct 28, 2011
    125
    2
  11. absf

    Senior Member

    Dec 29, 2010
    1,492
    372
    Are you supposed to removed all the resistors at players' buttons?
    And where are the resistors to limit the LED current?
    The Reset button should be connected to ground with a 1K resistor to Vcc..

    Allen
     
    Last edited: Dec 19, 2013
  12. Nathan Hale

    Thread Starter Active Member

    Oct 28, 2011
    125
    2
    Hi! i just didnt show the resistors because i was rushing to draw the circuit. no you are not supposed to remove the resistors at players' buttons.
    Thank you for your reply. Can i know what software you used to draw that schematic? thanks!
     
  13. MrChips

    Moderator

    Oct 2, 2009
    12,439
    3,360
    1) I would reduce R5, R6, R7 and R8 to 220Ω.

    2) Reduce R9 to 1k to 3.3kΩ

    3) Replace U2 with 74LS series gate such as 74LS08, 74LS11 or 74LS21.
     
    absf likes this.
  14. Nathan Hale

    Thread Starter Active Member

    Oct 28, 2011
    125
    2
    1) why 220 ohms? Can you please elaborate the math.
    2) why 3.3k ohms? Can you please elaborate the math.
    3) i am already using a 74LS21
     
  15. MrChips

    Moderator

    Oct 2, 2009
    12,439
    3,360
    Sorry. I did the math incorrectly based on my prior knowledge of 7400 series gates. The 74LS00 series gates have lower input current requirements.

    For the math, check the datasheet of a 74LS08 gate.

    For pull down resistor, look at the input current and voltage for logic low.
    R = Vi/IiL = 0.4V/0.4mA = 1kΩ
    Hence 560Ω is a good choice.

    For pull up resistor, look at input current and voltage for logic high,
    R = (Vcc -Vi)/IiH = (5V - 2.7V)/20μA = 115kΩ
    Hence 10kΩ is fine.

    Edit: Oops! I forgot that that the RESET pull-up is on four 7476 pins.
    You have to go and check the 7476 data sheet and multiply the input HIGH current by four.

    For 7476 CLEAR IiH is 80μA
    R = (Vcc - Vi)/4IiH = (5V - 2.4V)/4 x 80μA = 2.6V/320μA = 8.125kΩ
    Hence I would choose R = 4.7kΩ or lower.
     
    Last edited: Dec 19, 2013
    absf likes this.
  16. absf

    Senior Member

    Dec 29, 2010
    1,492
    372
    It was drawn on Proteus ISIS. Though it is not free, you can get a demo copy here...

    proteus isis

    Allen
     
  17. JoeJester

    AAC Fanatic!

    Apr 26, 2005
    3,373
    1,157
    You might want to review the attachment ...
     
  18. Nathan Hale

    Thread Starter Active Member

    Oct 28, 2011
    125
    2
    Here is the updated circuit with pull up and pull down resistors.. It wont even work the way it is supposed to e ven in Multisim. The whole scenario starts off with the quiz master clearing all LEDs by pushing on key "Q". Then he asks his question and the ICs figure out which player pushed his switch first and light up the corresponding LED. This way the contestants wont argue and fight over whose light turned on first.It also helps when 2 contestants hit their switch in a time interval which is too short for the quiz master or judges to decide.
    As always ...thank you for your replies.

    [​IMG]
     
    • NOM.png
      NOM.png
      File size:
      44.5 KB
      Views:
      333
  19. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,791
    1,103
    The 7400 gates each have have one of their inputs floating: they should be tied to V+.
    Try using 74HC00 gates instead of 7400. Mixing logic technologies can cause difficulties.
     
  20. Nathan Hale

    Thread Starter Active Member

    Oct 28, 2011
    125
    2
    the other guy told me to tie them to ground with a pull down resistor. post # 11
     
    Last edited: Dec 26, 2013
Loading...