Timer based door opener (chicken coop)


#1

Hi there, I want to create an automated door opener for my daughter’s chicken coop. I want this door to open at 06:00 and close at 19:00. I think I have my components figured out but would like some expert advice. But I have no idea on code.
Components:
Arduino Uno
Adafruit PCF8523 Real Time Clock
L298N Motor Driver
GW370 DC 12V 120rpm High Torque Turbo Worm Geared Motor Reducer Motor.


#2

Hi there,

It looks like the components you’ve chosen are compatible for what you are trying to do, but circuito.io doesn’t support the exact motor you mentioned. There are many other DC motors in the circuito.io inventory which are also compatible for your need.

To get sample code that would give you an example of how to operate each component, please assemble your circuit by dragging and dropping the components you would like to use from the component search panel on the left side of the screen to the workspace. The schematic & sample code will be generated for you instantly. The schematic will appear directly in the workspace, and you can find the sample code files in the “Code” tab.

The examples suffice in order to understand how to build out the exact logic of opening and closing and specific times - but if you’re finding it difficult, please post a follow up and we’ll reply ASAP.

Let us know :slight_smile:


#3

You might also want to consider a solenoid to control the door catch/latch/lock.

You have some options when it comes to the timer:

  1. You find a way to set the clock, and how to set the times to open and close. If the circuit doesn’t have a backup battery, you’ll have to set this every time it loses power, whether through a power failure or when you change the battery (if it’s battery powered). This would probably involve a few buttons and some display to show you the current time, open time, and close time. This might get more complex than you want.

  2. You could “train” the door. The code might start (once power is supplied) with the door unlocked. You’d press a button when it should lock (you’d do this at 19:00) and then press it again when you want it unlocked at 06:00. The code would remember these times and wait 24 hours before doing the same thing as it was “told” to do. (Note, the actual time would almost certainly be completely different to the clock, but that doesn’t matter so long as the clock runs at the correct speed. It might think the times are 0:05 and 11:06 if it’s 19 hours behind your local time.)

With respect to daylight savings (if it applies where you live), the simplest thing would be to change the clock or re-train it, depending on your choice above.