• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Circuit Ideas for You

Get free circuit ideas online.

  • Home
  • Privacy Policy
  • About
Home » Simple Electronic Code Lock Circuit

Simple Electronic Code Lock Circuit

Last updated on 15 May 2026 by Admin-Lavi Leave a Comment

To begin with, this is easy and Simple Electronic Code Lock Circuit; to open door or box no need of key we can use special code instead.

Also, this circuit uses buttons and code to the open lock, so only correct code can open and wrong code will not work.

Circuit Working:

Simple Electronic Code Lock Circuit Diagram

Parts List:

ComponentsQuantity
Resistors
1/4 watt 1k2
Semiconductors
Transistor BC5471
Diode 1N40071
Relays1
Mini switches (ON/OFF)8

This code lock circuit is famous because design is very simple, as it uses smart code with only one main part and 8 push buttons.

How this lock circuit work?

To turn ON the relay we must press all 4 buttons S1, S2, S3, S4 together and if we press any wrong button like S5 to S8 relay will not work and lock will stay closed.

Very important: power supply voltage must be same like relay voltage, because small transistor like BC547 can take current up to 50mA.

Also, if relay needs more power then use transistor like 2N2222 it can take 0.2A.

Formulas:

Here, relay Coil Current is tool for finding how much resistor (R) needed for BJT transistor to turn ON relay coil; so lets see what is inside the formula:

R = (Us – 0.6) × hFE / Relay Coil Current

  • R is resistor value in ohms Ω we want to find this.
  • Us is power supply voltage in volts V.
  • hFE is BJT gain how much it can increase base current.

Relay coil current refers to the amount of current, measured in amperes (A), required to turn the relay ON.

How to use this formula:

Voltage Drop:

(Us – 0.6) means voltage drop at base emitter of BJT and most BJT have drop of 0.6V so we subtract it from power supply; also this give us voltage for base resistor.

Base Current Gain:

hFE show how much transistor multiply base current, like bigger hFE = less base current needed to turn ON relay.

Ohms Law:

Use formula R = V / I.

Furthermore, this will help find correct resistor R so enough current goes in base of BJT which is not too much.

In simple words:

Also, this formula help choose good resistor so transistor work correct and switches ON relay coil with right amount of current.

How to Build:

To build a Simple Electronic Code Lock Circuit follow the below steps for connections:

Identify Parts:

  • First, check all parts in circuit diagram are there and be sure all parts match the needs of circuit.

Make Circuit:

  • Next, connect power supply positive (+) to relay common pin, connect relay NO (normally open) pin to positive side of code lock system.
  • Connect power supply negative (-) to negative side of code lock.

Button Connection (S1 to S8):

  • Now put S1, S2, S3, S4 in parallel and connect this group to relay input.
  • Also, connect S5, S6, S7, S8 to ground to stop wrong press from turning ON relay.

Use Resistors:

  • Also, put resistors where needed to save parts and control current flow.

LED (Optional):

  • If we use LED then connect it with resistor in parallel to relay coil and this will show light when relay is ON.

Soldering Work:

  • Hence, after testing on breadboard we can solder all parts on PCB for better and strong setup.

Test Circuit:

  • First, press all buttons S1 to S4 together to turn the relay ON and unlock the door and if we press the wrong button, the relay stays OFF.

Be Safe:

  • Before power ON check all wires and part values and if we are not sure how to make circuit then ask someone who knows or learn more before trying.

Conclusion:

Overall, Simple Electronic Code Lock Circuits offer more advantages than traditional key locks because users can change the code easily, monitor who enters and connect them with other security systems.

Finally, people use these circuits in homes, offices, factories and many other places.

Filed Under: Automation Circuits, DIY Projects, Hobby Circuits, Mini Projects, Security and Protection

About Admin-Lavi

Lavi is a B.Tech electronics engineer with a passion for designing new electronic circuits. Do you have questions regarding the circuit diagrams presented on this blog? Feel free to comment and solve your queries with quick replies

Previous Post: « 70 Watt Audio Amplifier Circuit
Next Post: Cable TV Amplifier Circuit »

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar




Categories

  • 555 Timer Projects (42)
  • Alarm Circuits (67)
  • Amplifier Circuits (90)
  • Arduino Projects (103)
  • Audio Circuits (166)
  • Automation Circuits (45)
  • Automobile Circuits (27)
  • Battery Charger Circuits (84)
  • DIY Projects (181)
  • Free Energy (13)
  • Heater and Temperature Controllers (29)
  • High Voltage (21)
  • Hobby Circuits (87)
  • Indicator Circuits (59)
  • Inverter Circuits (19)
  • IoT projects (1)
  • LDR Circuits (36)
  • LED and Lamps (180)
  • Meters and Testers (39)
  • Mini Projects (137)
  • Motor Controllers (24)
  • Oscillator Circuits (54)
  • Power Supply Circuits (200)
  • Remote Control Circuits (10)
  • Security and Protection (75)
  • Sensors and Detectors (190)
  • Solar Circuits (32)
  • Timer Circuits (55)
  • Transistor Circuits (142)
  • Transmitter Circuit (20)
  • Tutorials (9)
  • Voltage Regulator (16)
  • Water Level Controller (10)

Recent Posts

  • Low Current Controlled Battery Charger Circuit using LM723 IC
  • 741 Op-Amp Treble Booster Circuit
  • Simple Diode and Transistor Based Audio Limiter Circuit
  • Simple 500mW Speaker Driver Circuit
  • Easy DIY LM386 Audio Amplifier Circuit

Recent Comments

  1. colin on Simple Single Transistor Audio Amplifier Circuit
  2. How to Make a Bird Chirping Noise Easily on Chirping Bird Sound Generator Circuit
  3. Transistor Based Medium Impedance Preamplifier Circuit - Circuit Ideas for You on Low Impedance Input Transistor Preamplifier Circuit
  4. Admin-Lavi on Alternate Red Green LED Flasher Circuit
  5. Admin-Lavi on Alternate Red Green LED Flasher Circuit

Copyright © 2026 | New Circuit Ideas