For the life of me, I can not find the error in this circuit...

    Joined
    Feb 4, 2015
    Messages
    182
    Reaction score
    58
    I am building (well failing at building) a simple circuit that lights sequentially (and keeps lit) three lights in order and then turns them off. One button press for the first light on, the second button press for two lights on, third button press for three lights on, and the fourth press of the button shuts them all off. Rinse and repeat....

    I will add pictures of the circuit in it's 4 states, but here is a text description of how it is (supposed) to work:

    The counter: (c)BUTTON1 to (v) FLIP1 .... (c)FLIP1 to (v)FLIP2 and (v)NOT1 .... (c)FLIP2 to (v)NOT2
    Reading the counter: (c) FLIP1 and FLIP2 to (v)AND1 .... (c)FLIP2 and NOT1 to (v) AND2 .... (c)FLIP1 and NOT2 to (v)AND3 .... c(NOT1 and NOT2 to (v)AND4

    At this point the circuit performs as intended. Every press of the button results in a different AND being on and the rest being off.

    Light controls and reset:
    (c) AND1 to (v) FLIP3 .... (c) FLIP3 to (v) LIGHT1
    (c) AND2 to (v) FLIP4 .... (c) FLIP4 to (v) LIGHT2
    (c) AND3 to (v) FLIP5 .... (c) FLIP5 to (v) LIGHT3
    (c) AND4 to (v) BUTTON2 .... (c) BUTTON2 to (v) FLIP3 and FLIP4 and FLIP5

    This is where the error occurs. I always get more than one light lit, even after checking and rebuilding the circuit many time. I tried using an activation module instead of a button to activate the counter....no good. I also tried linking each AND into an OR and then linking the ORs into the FLIPs....no good. I tried linking each combination of the counter into an OR and then the OR into the ANDs....no good....

    Nothing I seem to try works.....here are the pictures, in sequence, from first activation on/off to the last:

    Untitled.png
     

    Attachments

    Joined
    Mar 1, 2015
    Messages
    291
    Reaction score
    176
    • Wired for Logic
    • Community Content - Bronze 2
    • Purchased!
    I had faced a similar problem with counters. You can filter out the 'noise' by adding a NOT to your button, and then connecting it to all the ANDs. This prevents the system from outputting while the FLIP-FLOPs are iterating.

    Think of it like this. You have your flip flops wired in a chain. The signal from your button takes time to propagate through the FLIP-FLOPs. You see, your circuit was momentarily in the first state, so it tripped both decoders. The NOT is like a shutter, preventing the circuit from entering any state while the signal propagates through the FLIP-FLOPs. When the button resets, the NOT with be on, allowing the ANDs to enter the correct state, without the chance of a glitch.

    I hope this is helpful.
     
    Joined
    Dec 14, 2015
    Messages
    5
    Reaction score
    1
    Other solutions that will work for unwanted signals coming out of a counter are placing other logic blocks or delay blocks in between the counter and the rest of the circuit. With delay blocks they'll also work if you put them right in front of the lights.
     
    Joined
    Feb 4, 2015
    Messages
    182
    Reaction score
    58
    I had faced a similar problem with counters. You can filter out the 'noise' by adding a NOT to your button, and then connecting it to all the ANDs. This prevents the system from outputting while the FLIP-FLOPs are iterating.

    Think of it like this. You have your flip flops wired in a chain. The signal from your button takes time to propagate through the FLIP-FLOPs. You see, your circuit was momentarily in the first state, so it tripped both decoders. The NOT is like a shutter, preventing the circuit from entering any state while the signal propagates through the FLIP-FLOPs. When the button resets, the NOT with be on, allowing the ANDs to enter the correct state, without the chance of a glitch.

    I hope this is helpful.
    Thanks a million. I added the not as you recommended and the issue is fixed. (In the meantime I also created an identical circuit using ORs linked to the lights and to themselves in place of the last FLIPs....this also was a successful workaround, lol)
     
    Joined
    Jan 4, 2014
    Messages
    48
    Reaction score
    54
    • Purchased!
    • Legacy Citizen
    Seems you solved it already but here comes another solution just because its fun with logic ;)
    Since you want 4 states of the lamp. 1 , 2 , 3 and 0 it can easy be done with binary. 00, 01, 10 and 11.
    To build a simple binary counter you just need 1 button and 3 flip flop.
    Button connected to 2x Flip flop, and 1 of the flip flop connected to a 3th. The solo and 3th will be your result.
    With that you just have to easy translate the 4 states. 00 = all off, 01 = 1 light (just 1 and with 1 not connected to first light)

    Well again dont matter. you got your answer. cheers.
     
    Joined
    Feb 4, 2015
    Messages
    182
    Reaction score
    58
    Seems you solved it already but here comes another solution just because its fun with logic ;)
    Since you want 4 states of the lamp. 1 , 2 , 3 and 0 it can easy be done with binary. 00, 01, 10 and 11.
    To build a simple binary counter you just need 1 button and 3 flip flop.
    Button connected to 2x Flip flop, and 1 of the flip flop connected to a 3th. The solo and 3th will be your result.
    With that you just have to easy translate the 4 states. 00 = all off, 01 = 1 light (just 1 and with 1 not connected to first light)

    Well again dont matter. you got your answer. cheers.
    Thanks Deez! The problem was resolved but I'm always game for new or simplified solutions. I'll be using that method for sure =)