Need help with School Project [4-Digit Door Lock System]

Thread Starter

hedgyuwu

Joined Nov 12, 2024
2
We were asked to design and simulate a digital lock system using logic gates and switches. This project will simulate a basic 4-digit PIN lock system that requires the correct sequence of switch positions to unlock a "door". We have to provide a project report that includes the system's logic design, circuit diagram, truth tables, PCB layout and explanation of how it works. Luckily there's no hardware or anything hands on involved. Everything will be done through software.

The main materials to use are:
  • Circuit Simulator Software (you may choose what software to use)
  • Set of switches (4 toggle switches)
  • LEDs
  • Logic Gates (AND, OR, NOT)

And the requirements are (Bold text indicate most of our issues):
  • Use four switches for input to simulate the 4-digit PIN entry.
  • The system should have a predefined 4-digit PIN sequence of switch positions that, when correctly set, will unlock the system.
  • The system should have a lock and unlock state.
  • When the correct 4-digit PIN is entered in the lock state, an LED should indicate that the system is unlocked.
  • Incorrect PIN entries should keep the system in the locked state.
  • Use AND, OR, and NOT gates to design the logic for checking the PIN.
  • Provide a reset button to reset the system to the locked state.
  • Use LEDs to visually indicate the lock and unlock states.

Since we're beginners we thought it'd be easier if we went straight to breadboarding using tinker cad here.1731429694786.png
So this is our circuit right now and it has some flaws.
  1. Red LED doesn't light up on incorrect input
  2. I don't know how to make reset function a push button instead of a switch
  3. Circuit Looks too complex

If anyone is willing to help me with my issues with this circuit I would gladly appreciate it. I'm not too bright when it comes to these but I really need people who can help me with designing and improving this. Including help with creating the schematic diagram and pcb layout
 

liaifat85

Joined Sep 12, 2023
200
Replace the reset toggle switch with a momentary push button in your design. You can achieve this in TinkerCAD by selecting a push button from the component menu.
 

boostbuck

Joined Oct 5, 2017
1,041
Since we're beginners we thought it'd be easier if we went straight to breadboarding....
I really think that as beginners you should start by drawing a circuit diagram, rather than leaping straight to breadboarding. Not only is it a better discipline and makes it easier to conceptualise your design, but the circuit diagram is a better way to communicate with people you want help from.
 

bertus

Joined Apr 5, 2008
22,909
Hello,

There are also a lot of gates unused.
You could create the circiut with less chips.
Also there are no decoupling capacitors shown.

Bertus
 

boostbuck

Joined Oct 5, 2017
1,041
Anyone here will assist you further. Have you tried drawing a schematic diagram yet? If you do, you should be able to see your errors more easily, and it will be easier for you to communicate with us.

For example you have connected the OUTPUT of the last inverter to +ve through the fifth switch.

You have used one gate from each package, except for the last package where you have used two gates. You have 24(!) unused gates in on your breadboard. You are only using four AND gates, and there are four in each 7408, so you only need one of those chips. Same with the others - there are six inverters in a 7404, etc.

Without a schematic, it is almost impossible to determine your design thinking. For example, if you are making a PIN system, doesn't the circuit need to remember each successful button until all are pressed? I'm just guessing, since you haven not explained your thinking at all, but your circuit is only used a set of gates giving a combinational circuit with no memory of button presses, so what does the 'reset' button actually reset?

Does that help?
 

boostbuck

Joined Oct 5, 2017
1,041
Ok, rather than just playing with your hardware, here's some real help.

You have a project with a reasonable set of design goals given to you, and you have reached for the parts box and started wiring things up at random. That is not going to work. At all. Ever.

You've been given instructions that tell you the path to follow: "We have to provide a project report that includes the system's logic design, circuit diagram, truth tables, PCB layout and explanation of how it works".

From the design goals, FIRST produce a logic design with truth tables, and from that derive a circuit diagram using 74HC logic elements. Only then can you proceed to breadboard it up to prove the hardware, then put it on a PCB layout.
 
Top