# need help with a 4bit combination lock system

#### matthew26

Joined Feb 21, 2011
6
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.

#### Papabravo

Joined Feb 24, 2006
12,765
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

Joined Feb 21, 2011
6
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.
any way could get you to show me how to put the shift register into the circuit?

#### spinnaker

Joined Oct 29, 2009
7,837
any way could get you to show me how to put the shift register into the circuit?
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.

#### Papabravo

Joined Feb 24, 2006
12,765
any way could get you to show me how to put the shift register into the circuit?
Why don't you show me how you think it should go and I'll tell you if I think it will work

#### matthew26

Joined Feb 21, 2011
6
Why don't you show me how you think it should go and I'll tell you if I think it will work
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

#### Papabravo

Joined Feb 24, 2006
12,765
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

#### matthew26

Joined Feb 21, 2011
6
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
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:

#### Papabravo

Joined Feb 24, 2006
12,765
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.

#### matthew26

Joined Feb 21, 2011
6
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.
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

#### Papabravo

Joined Feb 24, 2006
12,765
I think that will work.