• 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 » Digital Code Lock Circuit using IC 4017

Digital Code Lock Circuit using IC 4017

Last updated on 14 January 2026 by Admin-Lavi Leave a Comment

Security plays a very important role in todays world, therefore electronic code locks are very useful.

This Digital Code Lock Circuit using IC 4017 is a simple.

It uses push buttons, diodes, resistors, capacitor and IC CD 4017 .

Moreover, it is low cost and easy to build and it works on 9V power supply.

Also, it is good for students and beginners.

Circuit Working:

Digital Code Lock Circuit Diagram using IC 4017

Parts List:

ComponentsValueQuantity
Resistors100k2
10k, 1k1 each
CapacitorElectrolytic 100uF 25V1
Transistor BC5471
IC CD 40171
Diodes 1N40076
LED any color1
Push Button Switch10
Relay 9V DC1
Battery 9V1

This circuit uses IC CD 4017 and it is a decade counter IC.

There are 10 push buttons with some buttons are correct keys and some buttons are wrong keys.

A relay is used as output switch and a transistor drives the relay.

Diodes are used for logic isolation and an LED shows output status.

At first, the power is applied, so CD 4017 resets to Q0.

Then correct keys must be pressed in order and each correct key sends a clock pulse.

Therefore, output shifts step by step.

Wrong keys are connected to reset and so if wrong key is pressed then IC resets.

After last correct key the output goes high and thus transistor turns ON.

Relay gets energized and the load is switched ON.

LED also glows and so user knows lock is opened.

When power is removed the system resets again.

Code Explanation:

If my code is ABCD then:

After RESET:

Pin 3 (Q0) is HIGH then B is the start state

Press Key A:

Clock pulse applied

Output moves from Pin 3 to Pin 2

So, A = Pin 2 becomes HIGH

Press Key B:

Next, clock pulse

Output moves from Pin 2 to Pin 4

So, B = Pin 4 becomes HIGH

Press Key C:

Next, clock pulse

Output moves from Pin 4 to Pin 7

So, C = Pin 7 becomes HIGH

Press Key D:

Next, clock pulse

Output moves from Pin 7 to Pin 10

So, D = Pin 10 becomes HIGH (Relay ON)

How to Build:

To build a Digital Code Lock Circuit using IC 4017 follow the below steps:

  • First, start to collect all the parts as shown in circuit diagram.
  • CD 4017 pin 16 connect to +9V supply.
  • Pin 8 goes to ground.
  • Pin 14 is clock input and correct switches connect to pin 14 through diodes.
  • Pin 13 is enable pin and it is connected to ground.
  • Pin 15 is reset pin and all wrong switches connect to pin 15.
  • Output pin 3 is Q0 connects from diode D2 and switch S1.
  • Pin 2 is Q1 connects from diode D3 and switch S2.
  • Pin 4 is Q2 connects from diode D4 and switch S3.
  • Pin 7 is Q3 connects from diode D5 and switch S4.
  • Pin 10 is Q4 connects from diode D1 to base of transistor Q1 through resistor R3.
  • Transistor Q1 base is connected to R3 resistor.
  • Emitter goes to ground and collector goes to relay coil.
  • Relay one side goes of coil to +9V.
  • Other side to transistor collector.
  • Diode 1N4002 across relay for protection.
  • LED connect in series with R4 1k resistor and is connected parallel to relay coil.
  • After that resistor R2 is connected to pin 14 of IC and GND.
  • Then, push buttons 1 to 6 one end is connected to positive supply and other end is connected to pin 15 of IC through resistor R1 and GND.
  • At last, capacitor C1 positive end is connected to 9V battery positive and negative end to battery negative.

Conclusion:

To conclude, this Digital Code Lock Circuit using IC 4017 is very useful.

It is simple and reliable and it provides good security.

Moreover, it is easy to build at home and students can learn digital logic from this project.

Finally, this circuit is perfect for basic electronic security systems.

References:

Simple Key code lock switch circuit using IC-4017 

Filed Under: 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: « Darkness Activated LED Circuit
Next Post: Low Voltage Alert Circuit for 9V Battery »

Reader Interactions

Leave a Reply Cancel reply

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

Primary Sidebar




Categories

  • Alarm Circuits (45)
  • Amplifier Circuits (67)
  • Arduino Projects (99)
  • Audio Circuits (114)
  • Automobile Circuits (19)
  • Battery Charger Circuits (65)
  • Free Energy (13)
  • Heater and Temperature Controllers (13)
  • High Voltage (1)
  • Indicator Circuits (45)
  • Inverter Circuits (20)
  • IoT projects (1)
  • LDR Circuits (26)
  • LED and Lamps (148)
  • Meters and Testers (30)
  • Motor Controllers (22)
  • Oscillator Circuits (39)
  • Power Supply Circuits (104)
  • Remote Control Circuits (10)
  • Security and Protection (29)
  • Sensors and Detectors (126)
  • Solar Circuits (29)
  • Timer Circuits (41)
  • Transistor Circuits (87)
  • Transmitter Circuit (17)
  • Tutorials (8)
  • Water Level Controller (6)

Recent Posts

  • 12V Battery Low Voltage Alarm Circuit
  • Low Voltage Alert Circuit for 9V Battery
  • Digital Code Lock Circuit using IC 4017
  • Darkness Activated LED Circuit
  • Fan Start 10 Second Delay Timer Circuit

Recent Comments

  1. TDHofstetter on DIY Variable Power Supply Circuit using Arduino
  2. feathbuff on Simple Micro Ampere Meter Circuit
  3. Admin-Lavi on Simple School Project Multimeter Circuit
  4. choke on Simple School Project Multimeter Circuit
  5. Admin-Lavi on Analog to Digital Converter Circuit using IC 555

Copyright © 2026 | New Circuit Ideas