• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Need circuit help? Post them in the comments! I've answered over 50,000!

Blog | Categories | About | Contact | Calculators-online
You are here: Home / Automation Projects / Day/Night Triggered Automatic Door Lock Circuit

DIY Circuits | Learn Basics | Arduino Coding




Day/Night Triggered Automatic Door Lock Circuit

Last Updated on January 31, 2024 by Swagatam 12 Comments

In this post I have explained a simple day, night triggered automatic door lock circuit, which can be used for autonomously unlocking a kennel door during day break, and locking it when night sets in.

The idea was requested by an avid reader of this blog, Mr. Norman, as given below.

Design Request and Specifications

I am working on a circuit to power a linear actuator.

I have connected a mechanism to translate the linear motion of the actuator into a rotational motion. When the actuator pushes, an 18mm linkage rotates 90 degrees which operates a latch bar to latch a dog door.

The idea is to allow the dogs to exit when daylight occurs and to latch the door during the night. It must have a one shot operation to prevent the linear actuator from burning up.

The circuit is supposed to power one relay in daylight and the other relay at dark which is supposed to latch and unlatch the dog door by powering the a vehicle door solenoid.

Circuit Description

The complete circuit diagram of the day/night triggered automatic door lock circuit is shown in the following figure.

The working of the circuit can be understood with the following points:

Day/Night Triggered Automatic Door Lock Circuit diagram

The day light and darkness detector is configured around the two BC547 transistor and the LDR circuit.

During day time the LDR resistance is low which allows the left side BC547 to remain switched ON. Due to this, the right side BC547 base is grounded and it is rendered switched OFF.

The above situation also keeps the upper DPDT relay turned OFF with its contacts resting at the N/C positions.

With the upper DPDT relay contacts at the N/C contacts keeps the lower relay also turned OFF and its contacts also remain at its N/C position.

Since the vehicle solenoid is configured with the N/O contacts of the lower relay, it also remains disabled in the current position.

In this switched OFF condition, the push-pull solenoid is initially set such that it stays in the retracted position, meaning its shaft is pulled inwards.

In this retracted position it allows the attached door lock (latch) to be in the open condition.

Hence, during day time the entire circuit remains disabled allowing the kennel door spindle to remain unlocked.

Now, during evening time when it starts getting darker, the LDR resistance increases. Finally, it reaches a point where no voltage can reach the base of the left side BC547 and it switches OFF.

As soon as the left side BC547 is switched OFF, the right side BC547 switches ON via the 10k biasing resistor, causing the upper DPDT relay to activate.

The contacts of the upper relay now shift to their N/O contacts causing a change of polarity for the voltage at its N/O contacts.

At this point, two things happen simultaneously.

The changed voltage polarity at the N/O contacts of the upper relay sends a momentary supply to the coil of the lower DPDT relay.

Due to this momentary supply, the lower relay activates so that its contacts now shift towards the N/O contacts.

Since the solenoid latch is configured with these N/O contacts of the lower relay, the solenoid now gets the required supply and it triggers ON causing its shaft to shoot and push outwards.

The above operation causes the attached door lock spindle to get locked.

The lower relay remains switched ON only momentarily, maybe for a second or two, until the two 1000uF capacitors are fully charged. When this happens the lower relay quickly turns OFF and reverts to its N/C contacts, disconnecting the supply from the solenoid terminals. This is important, because a continuous supply across the solenoid wires would heat up the device and burn its motor winding.

Thus, during nighttime the kennel door remains locked and secured.

The next day, the cycle repeats but in the opposite way. In day light the upper relay is turned OFF so that its contacts return back to its N/C position.

This yet again causes a polarity changeover for the lower relay and the solenoid such that the solenoid now gets a momentary supply with an opposite polarity.

This changed-over polarity of the supply across the solenoid wires causes its motor to rotate backwards so that its shaft now retracts and is pulled inward.

The above action causes the kennel door to get instantly unlocked.

Parts List

  • Resistors ae 1/4 watt CFR
  • 33k, 1k, 10k = 1 each
  • LDR = 1
  • Transistor BC547 = 2
  • Capacitor 1000uF / 25V = 2
  • Please also add a 1000uF parallel to the upper relay coil.
  • DPDT Relay = 2
  • Vehicle Door Solenoid 12V = 1

This concludes our article on day, night triggered automatic door lock circuit which can be used to keep a kennel door locked during night and unlocked during daytime.

The above explained lock circuit concept is universal and can be used for any similar application.

For any relevant questions and doubts, please feel free to comment below and get quick replies from the author.

You'll also like:

  • mart street light circuitSmart Street Lamp Circuit with Motion Sensor
  • simple single transistor street light circuit7 Automatic Street Light Circuits [Using Relays and Solar Panel]
  • Automatic Irrigation Circuit using Arduino
  • rat repellent continuousRat Repellent Circuit Diagram

Filed Under: Automation Projects, Pets and Pests Tagged With: Automatic, Door, Lock, Night, Triggered

About Swagatam

I am an electronics engineer and doing practical hands-on work from more than 15 years now. Building real circuits, testing them and also making PCB layouts by myself. I really love doing all these things like inventing something new, designing electronics and also helping other people like hobby guys who want to make their own cool circuits at home.

And that is the main reason why I started this website homemade-circuits.com, to share different types of circuit ideas..

If you are having any kind of doubt or question related to circuits then just write down your question in the comment box below, I am like always checking, so I guarantee I will reply you for sure!

Previous Post: « Flashlight Activated Burglar Alarm Circuit
Next Post: Simple Motorcycle Security Alarm Circuit »

Reader Interactions

Comments

Pika says:
October 27, 2025 at 11:29 am

the lock is more like the lock that u used in the diagram but it have 5 wires and 2 of them is motor wire I know how to connect them but Idk how to connect the rest three of the wires

Reply
Swagatam says:
October 27, 2025 at 2:18 pm

Sorry, I have no idea about it….

Reply
Pika says:
October 27, 2025 at 11:27 am

https://share.google/0SbuArIyqd3N63ZY4

Reply
Swagatam says:
October 27, 2025 at 2:33 pm

OK, that’s a 5 wire master car central lock actuator….
The green and the blue wires are the ones you can use with the circuit above…

Quick Bench Test To Confirm

To make absolutely sure, you can test as follows:

Connect Green to battery +12V, Blue to Ground momentarily, you might see actuator moves in one direction (say Lock).

Reverse (Blue to +12V, Green to Ground) you might see actuator moves in the opposite direction (say Unlock).

This confirms that Green and Blue are indeed the motor pair and act identical to a 2-wire actuator.

Reply
Pikapika says:
October 27, 2025 at 7:41 am

If I use 5 wire lock how to connect with 5 wire lock. 2 motors wire are connected and the rest of the 3 wire connect to ground or what?

Reply
Swagatam says:
October 27, 2025 at 8:34 am

Sorry, it is difficult to tell without seeing the internal specifications of the lock…

Reply
Luciar says:
October 13, 2025 at 9:14 am

how to connect the dpdt relay module? just connect to NC ,the others no need to connect?

Reply
Swagatam says:
October 13, 2025 at 1:51 pm

The N/C contacts of the DPDT are open, only the N/O are used. The coil of the DPDT must be connected to the 1000uF capacitors, as indicated in the diagram…

Reply
Luciar says:
October 14, 2025 at 11:34 am

sorry interrupt I am a new to electronics so I don’t really understand. Could u make video about the circuit ?

Reply
Swagatam says:
October 14, 2025 at 12:03 pm

Please let me know what you did not understand, i will try to help. If you are not able to understand the relay contacts, you can refer to this diagram:
https://www.homemade-circuits.com/wp-content/uploads/2022/06/understanding-relay-pinouts-and-contacts.jpg

Reply
Luciar says:
October 14, 2025 at 5:18 pm

so those two relays are the relay that u send not relay module? if so ,then I kinda understand

Reply
Swagatam says:
October 15, 2025 at 9:02 am

Yes, it is better to use standalone relays rather than the PCB assembled ones. Here’s the image of a DPDT relay pinouts, please let me know if you have any further doubts regarding the subject:
https://www.homemade-circuits.com/wp-content/uploads/2025/10/DPDT-relay-pinouts.jpg

Reply

Need Help? Please Leave a Comment! We value your input—Kindly keep it relevant to the above topic! Cancel reply

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

Primary Sidebar

circuit simulator image



Subscribe to get New Circuits in your Email



Categories

  • Arduino Projects (95)
  • Audio and Amplifier Projects (133)
  • Automation Projects (18)
  • Automobile Electronics (103)
  • Battery Charger Circuits (87)
  • Datasheets and Components (109)
  • Electronics Theory (149)
  • Energy from Magnets (27)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (20)
  • Health related Projects (27)
  • Home Electrical Circuits (13)
  • Indicator Circuits (16)
  • Inverter Circuits (95)
  • Lamps and Lights (159)
  • Meters and Testers (71)
  • Mini Projects (28)
  • Motor Controller (68)
  • Oscillator Circuits (28)
  • Pets and Pests (15)
  • Power Supply Circuits (91)
  • Remote Control Circuits (50)
  • Renewable Energy (12)
  • Security and Alarm (64)
  • Sensors and Detectors (106)
  • SMPS and Converters (34)
  • Solar Controller Circuits (60)
  • Temperature Controllers (43)
  • Timer and Delay Relay (49)
  • Voltage Control and Protection (42)
  • Water Controller (37)
  • Wireless Circuits (31)





Other Links

  • Privacy Policy
  • Cookie Policy
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap



People also Search

555 Circuits | 741 Circuits | LM324 Circuits | LM338 Circuits | 4017 Circuits | Ultrasonic Projects | SMPS Projects | Christmas Projects | MOSFETs | Radio Circuits | Laser Circuits | PIR Projects |

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Stack Exchange
  • Linkedin



Recent Comments

  • Swagatam on 7 Simple Continuity Tester Circuits Explained
  • Swagatam on Echo Effect Generator Circuit
  • Swagatam on Making a Cell Phone Controlled Remote Bell Circuit
  • Swagatam on Ultrasonic Fuel Level Indicator Circuit
  • Keir Vaughan-Taylor on 7 Simple Continuity Tester Circuits Explained

© 2026 · Swagatam Innovations