need help with a 4bit combination lock system

Discussion in 'The Projects Forum' started by matthew26, Feb 21, 2011.

  1. matthew26

    Thread Starter New Member

    Feb 21, 2011
    6
    0
    I need to design a 4 bit lock combination that locks out after 3 unsuccessful attempts. I found somthing very close to what i was looking for on this site http://www.allaboutcircuits.com/vol_6/chpt_7/7.html but it doesnt lock out after 3 attempts. any help/advice would be greatly
    appreciated.
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,178
    1,799
    You need something that counts the three attempts. This could be an

    1. Up Counter that goes "0-1-2-3"
    2. Down Counter that goes "3-2-1-0"
    3. A shift register that shifts 1's at the right that goes "000, 001, 011, 111"
    4. A shift register that shifts 0's that goes "111, 110, 100, 000"
    And many other variations on that theme.
     
    matthew26 likes this.
  3. matthew26

    Thread Starter New Member

    Feb 21, 2011
    6
    0
    any way could get you to show me how to put the shift register into the circuit?
     
  4. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,887
    1,017
    Why not just use a microcontroller? You would have to learn programming but that is not too difficult. It would make the job so much easier and open up a whole bunch of options.
     
  5. Papabravo

    Expert

    Feb 24, 2006
    10,178
    1,799
    Why don't you show me how you think it should go and I'll tell you if I think it will work
     
  6. matthew26

    Thread Starter New Member

    Feb 21, 2011
    6
    0
    View attachment 4bit drawing.pdf

    if i split the 2 grounds from the red and green LED's and put the red LED into the D flip flops and ran it back into the circuit. after the 3 attemps of (high's) 1 going into the D flip flops would it then lock out until it was reset?
    sry for the bad drawing it wouldnt let me edit the original picture i got from this site
     
  7. Papabravo

    Expert

    Feb 24, 2006
    10,178
    1,799
    Your "Go/No Go" signal should be used to derive the clock. The data_in for the first stage should be set to zero or one and then you need to decode three identical outputs of all zeros or all ones depending on the data in choice.

    Last you need a way to RESET the shift register
     
  8. matthew26

    Thread Starter New Member

    Feb 21, 2011
    6
    0
    last question
    what would be the best way to reset the shift register?
    I need a hint cause I really have no clue or i would do it myself
     
    Last edited: Feb 23, 2011
  9. Papabravo

    Expert

    Feb 24, 2006
    10,178
    1,799
    That is a really good question. From a logic standpoint another switch would do the job. From a security standpoint you would have to think about where to put it, how to access it, and how to activate it.
     
  10. matthew26

    Thread Starter New Member

    Feb 21, 2011
    6
    0
    couldnt i just put the "go" through to the clear? and reset it when the right combo is used? then after the power went off the D flip flop would just reset itself? because its suposed to lock up and not work after 3 attempts
     
  11. Papabravo

    Expert

    Feb 24, 2006
    10,178
    1,799
    I think that will work.
     
    Xufyan and matthew26 like this.
  12. matthew26

    Thread Starter New Member

    Feb 21, 2011
    6
    0
    thank you for all your advice, i'm off to go build this on my bread board and attempt to get it to work. i will post back after i finish it and let you know how it went. Thanks again
     
Loading...