6 Digit Passcode Project

Thread Starter

Raziel240

Joined Jul 29, 2017
5
Hello everyone, I'm new to this Forum. I came here to seek help.
I have currently a project running with a logic passcode secured door and there are 10 buttons, numbers from 0 to 9.
With only simplified supplies on virtual parts, I wanted to make a security system that the buttons have to be pressed in the right order for the door to be able to open up.

Let's say the passcode should be 779355


I'm limited to these parts: **The amount of the parts do not matter**
  • LED (Green and Red)
  • Switch
  • Keypad (With the numbers 0 to 9)
  • Buffer Gate
  • NOT Gate
  • AND Gate
  • NOT AND Gate
  • OR Gate
  • NOT OR Gate
  • Exclusive OR Gate
  • Exclusive NOT OR Gate
  • 3-State Buffer (High)
  • 3-State Buffer (High-Inverted)
  • 3-State Buffer (Low)
  • 3-State Buffer (Low-Inverted)
  • Delay (Adjustable)
  • Timer
  • Countdown Timer (Adjustable)
  • 3-Input AND Gate
  • 3-Input OR Gate
  • 3-Input Exclusive OR Gate
  • 3-Input NOT Gate
  • 3-Input NOT OR Gate
  • 3-Input Exclusive NOT OR gate
  • Randomizer (Not important)
  • Edge Detector
  • 2-to-1 Multiplexer
  • 1-to-2 Demultiplexer
  • 4-to-1 Multiplexer
  • 1-to-4 Demultiplexer
  • 4-Bit Sync. Counter
  • 16x4 Memory Chip
  • 4-Bit Shift Register
  • 8-Bit Shift Register
  • 4-to-2 Encoder
  • 2-to-4 Decoder
  • 8-to-3 Encoder
  • 3-to-8 Decoder
  • 16-to-4 Encoder
  • 4-to-16 Decoder
  • Half Adder
  • Half Subtractor
  • Full Adder
  • Full Subtractor
  • Set-Reset Latch
  • Toggle Flip-Flop
  • Data Flip-Flop
  • JK Flip-Flop

There is no rush to it but I'd like a secure door that if the wrong digit is pressed everything resets, the alarm goes off and the combination has to be typed in again. Thanks for any reply.
 

crutschow

Joined Mar 14, 2008
24,978
You could use the counter to go to the next digit address in memory for each button push.
You could use a 16:4 encoder to convert the keypad to a 4-bit binary number for comparison to the number in memory.
 

AnalogKid

Joined Aug 1, 2013
8,464
Does the system have to have a "learn" mode wherein you teach it the correct passcode, or is the passcode held in hardwired logic?

ak
 

GopherT

Joined Nov 23, 2012
8,012
It is held in hardwired logic.
Are you trying to make it "secure" (to safeguard something) or simply "functional" (for a school project).

I can think of a reset button clearing out everything.

Then a flip flop connected to each button to denounce the switches.

A counter connnected to each flop flop to monitor how many times it it pressed (and increment).

Once each button is pressed the appropriate number of times,
A row of 8-input AND gates will all have the correct value to give a "high" to the output and trigger a relay that opens the mechanical latch.

Or, you could do any of more than a billion other permutations of that design.

Cheers
 

Thread Starter

Raziel240

Joined Jul 29, 2017
5
Thanks for the suggestion, I'll check it out now. For now it's just a school project to present it when it's finished. But I'm planning on using it for personal purposes when I figured out how to wire it appropriately.
 

WBahn

Joined Mar 31, 2012
25,764
As a school project, YOU need to show your best attempt to tackle the problems associated with the project and not just ask people how to do it. Take your best shot and ask specific questions about specific issues you are running into.
 

Thread Starter

Raziel240

Joined Jul 29, 2017
5
I did my best shot. Yet my "passcode" was easily brute-forced because I couldn't figure out how to reset the keys. It worked to an extend but when my teacher pressed all the buttens, the LED suddenly glowed green. Now I'm doing this virtually on a simulation. My knowledge about circuits is limited. I've reached my limit with my knowledge and that is why I've asked for help. And GopherT and crutschow did help. They didn't give me a 100% solution. They gave me tasks what to do to solve the problem. And by doing so I'm learning more than when I'm left behind in a pit. FYI, this is a project I've decided to do myself whereas others chose something easier such as cars, plants, etc. With what I've learned here already using the search function and thanks to the helpful people I've learned more than I've learned in school.

EDIT: I'm working on it to present it after summer so I have a lot of time to improve my knowledge about circuits because that is something I am interested in.
 
Last edited:

WBahn

Joined Mar 31, 2012
25,764
Based on what you have presented here, your "best shot" is listing a bunch of parts. You say you have a "project running with a logic secured password door" but have given zero details. You say that it was easily brute-forced when the teacher pressed all the buttons. I have a pretty good guess as to what is possibly happening, but without seeing your design, that's all it is -- a guess. My guess is that you are only requiring that certain buttons be pressed, but that you aren't checking that they are pressed in a specific order or that pressing other buttons causes a failure. But that's only a guess. Notice that I said you need to "show" your best attempt -- not keep it in your hip pocket and require everyone to guess what you have and haven't tried or why it might or might not be working.
 

crutschow

Joined Mar 14, 2008
24,978
6 digits seems like overkill.
You shouldn't need more than 4.
You could put a timeout after several incorrect attempts to discourage someone from brute-force trying all the numbers.
 

WBahn

Joined Mar 31, 2012
25,764
I doesn't sound like the teacher tried all of the combinations, it sounds like they just pressed all ten numbers and that did it.

There are some design decisions that can be made to trade-off complexity for usability. How many digits is, of course, one of them. Another is whether digits can be repeated within the passcode. Not allowing repeats was a very common constraint on combination door locks for a long time and is still common on cheap mechanical locks such as are often used by realtors (but many of them have switched to better locks over the last five to ten years). Another common (though almost never advertised) constraint was that the actual code was just that the digits in the code had to be entered (and only the digits) but the order didn't actually matter. This made the mechanical design a lot simpler (and, hence, the lock a lot cheaper) and also had the benefit that when a lot of people needed to use it each person only needed to remember one of the permutations, which with a bunch of options to choose from was usually pretty easy. The door to our mail house had this kind of lock. Of course, it also greatly reduces the number of combinations that have to be brute forced -- our mail house used a four-digit combination and so there were only 210 actual combinations. Someone would be expected to get it after only about 100 attempts and since each one takes roughly two seconds to enter, you will probably gain access in under four minutes and should definitely gain access in under seven minutes. This paid off when we came home from vacation and discovered that they had changed the code while we were away. Going home and coming back is a half hour trip, so I was more than willing to brute force the combination instead of going home and going through my e-mails to get it.

On the surface, that's pretty bad -- but consider that the cheap Master Lock combination locks that they were selling up until about ten years ago could be brute forced in less time than that with just a bit of practice if you knew the constraints on their possible combinations. Also, given that a boot or a rock could be used to gain access to the mail house in about five seconds, the amount of security offered by a lock that takes five minutes to pick is actually overkill -- it keeps honest people honest, barely.

The bottom line is that the TS needs to decide what features he wants and needs (clearly distinguishing between the two) before a design should be undertaken.
 

Thread Starter

Raziel240

Joined Jul 29, 2017
5
Based on what you have presented here, your "best shot" is listing a bunch of parts. You say you have a "project running with a logic secured password door" but have given zero details.
It's not required to show my failed attempts because I knew the errors. I just didn't know how to fix them. I did list the parts to let you know that I do not have all parts available. Of course if, for example, I wouln't have a full adder I'd just use two half adder. The thing is, I'm experimenting. This is not something my teacher told me to do. I chose to do this as a project.

Agree with WB; this is a school project - no schematic, no answers.
I didn't need answers. I needed suggestions, things that I can test for myself how it works. I just couldn't think of a use for the counter until crutschow and GopherT suggested it. I'm learning from scratch basically, but I do have some basic education in this direction and this is why I'm doing it.

Another common (though almost never advertised) constraint was that the actual code was just that the digits in the code had to be entered (and only the digits) but the order didn't actually matter.
That was the case with my circuit.

6 digits seems like overkill.
You shouldn't need more than 4.
You could put a timeout after several incorrect attempts to discourage someone from brute-force trying all the numbers.
I think I just wanted extra security. But either way, 6 digits passcode are working now. And thanks for the suggestion. I'll be looking forward to add the timeout somehow.
 
Top