This circuit shows you how to build a secret code lock!
Instead of a key, you use a special code to unlock something, like a box or a door.
Circuit Working:
Parts List:
Component | Quantity | Notes |
---|---|---|
Resistors (1/4 watt) 1k | 2 | |
Semiconductors | ||
Transistor BC547 | 1 | |
Diode 1N4007 | 1 | |
Relays | 1 | |
Mini switches (ON/OFF) | 8 |
This electronic code lock circuit is characterized by its basic design employing a notable code implementation with just a single active component and a minimum of 8 button switches.
How does the circuit of the code lock operate?
In order to activate the relay, all four buttons S1 to S4 need to be pressed simultaneously.
If any of the buttons from S5 to S8 are pressed, the relay remains inactive, preventing the code from opening.
It is crucial for the supply voltage to match the working voltage of the relay.
A transistor such as BC547 can handle currents up to 50 mA, whereas the 2N2222 can manage only 0.2A for bigger relays.
Formulas:
Relay Coil Current is a tool used to determine how much resistance a bipolar junction transistor BJT needs in order to drive a relay coil.
Let us deconstruct the words used in the below formula:
R = (Us – 0.6)hFE / Relay Coil Current
- R: This is the resistance value in ohms Ω that you are trying to solve for.
- The BJT base and this resistor will be linked in series.
- Us: This is an indication of the supply voltage, expressed in volts V, that is being used to power the circuit.
- hFE: This word describes the BJTs forward current gain.
- The amount that indicates how much the BJT amplifies the basic current is dimensionless.
- Put otherwise, hFE units of current will pass through the collector and emitter for each unit of current that enters the base.
- Relay Coil Current: In amperes A, this indicates the appropriate current that must pass through the relay coil in order to activate the relay.
How the formula is applied:
Voltage Drop: The voltage drop across the base emitter junction Vbe of the BJT is taken into account by the phrase (Us – 0.6).
Silicon BJTs usually have a voltage of about 0.6V.
You may find the voltage available to drive current through the base resistor R and into the base of the BJT by subtracting this value from the supply voltage (Us).
Base Current Amplifier: The base current is multiplied by the term hFE.
In order to get the necessary current via the relay coil, a higher hFE permits a lesser base current.
Ohms Law: Lastly, we use ohms Law (R = V / I) to divide the desired relay coil current by the resistor value R.
This guarantees that the relay coil will be activated by the estimated resistor value, which will limit the current passing through the BJTs base to the appropriate level.
Said another way, this formula assists you in selecting a resistor that, taking into account the voltage present in your circuit and the gain of the BJT, permits sufficient current to pass through the base of the BJT to activate the relay coil.
How to Build:
Building the electronic code lock with the above circuit involves the following process.
Identify Components:
- Make sure you have all the required components and verify their specifications.
Circuit Design:
- Connect the positive terminal of the power supply to the common contact of the relay.
- Connect the normally open (NO) contact of the relay to the positive side of the code lock mechanism.
- Connect the negative terminal of the power supply to the negative side of the code lock mechanism.
- Connect buttons S1 to S4 in parallel.
- Connect this parallel combination to the input side of the relay.
- Connect buttons S5 to S8 to prevent activation.
- Connect them to the ground.
Transistor Connection:
- Connect the base of the transistor to the output side of the relay.
- Connect the collector of the transistor to the positive terminal of the power supply.
- Connect the emitter of the transistor to the positive side of the code lock mechanism.
Resistor Placement:
- Use resistors as needed to protect the components, ensuring proper current flow.
Optional LED Connection:
- If using an LED for visual indication connect it in parallel with the relay coil with an appropriate resistor.
Soldering:
- Once the circuit is tested on a breadboard, you can proceed to solder the components onto a PCB for a more permanent setup.
- Test the circuit to ensure that pressing buttons S1 to S4 simultaneously activates the relay allowing the door lock to open.
Safety:
- Always double check connections and component values before applying power to the circuit.
- If you are unsure or unfamiliar with electronic circuits consider seeking assistance from someone with experience or consulting additional resources for
Conclusion:
Electronic Code Locks offer advantages over traditional locks including the ability to change codes easily, monitor access and integrate with other security systems.
They find applications in homes, offices, industrial facilities and various access control scenarios where electronic security is preferred.
References:
Development of a Programmable Electronic Digital Code lock system
Leave a Reply