Introduction: Chicken Coop Sliding Door Prototype

So, we recently bought some chickens. As it starts getting dark the chickens will head into the coop for safety and snoozing. At first light they'll be up and about and head out into the chicken run. The problem is; the sliding door to/from the coop has to be manually opened/closed each day. That's what I'd like to automate.

I'd like it to be light sensitive, so you'll definitely need a light dependent resistor (LDR) with 10K resistor, a full servo (with 100uF capacitor) to control the raising/lowering of the door. I'll say that again: a FULL servo. Not a 180 degree one, but a full 360 degree servo. A couple of LED's (with 220 ohm resistors) are nice to show when the door is open/closed. Oh, and an Arduino would be handy too.

I'm also taking this a step further by including a temperature/humidity sensor and LCD screen (with 10K pot for controlling the screen brightness) just for the giggles.

Teacher Notes

Teachers! Did you use this instructable in your classroom? Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: The Basic Build

I started by wiring up the servo (and 100uF cap) to the Arduino (a Nano v3 in this case) and added two LED's with 220 ohm pull down resistors. Also added the LDR with 10K ohm pull down resistor.

In my code you'll see values for sunUp and sunDown. These are quite subjective to the environment that you're in. I was in a well lit room tinkering on this and it worked OK with the values I'd entered. As the day went on I found the results quite sporadic. This was due to the light in the room getting less and the sunUp and sunDown values being wrong. To check your light levels, open the serial window and check the value for 'light' when the LDR is covered/uncovered.

The two IF statements do the winding/unwinding of the door using a string attached to the servo. I used two screws side by side, but in the final thing I'll replace the screws (and attachment) with a decent bobbin of some sort to save the string getting tangled on the servo.

Only after getting all of that to work did I add the humidity sensor and LCD screen.

Step 2: Hotting Up

With the main task done I added in the humidity sensor and 16x2 LCD screen.

At the moment it checks the temperature every 3 seconds, but I'll change that to several minutes when I install it in the coop.

----

So, now all I need to do is put it all in a box and lengthen the wires. I have a cheap Wansview IP camera in the coop too and plan to put the LCD screen within viewing angle of the camera. That way I can keep an eye on the coop occupants and their living temperature.

This is a great idea! I had chickens growing up and we would have to go shut the door at night. Sometimes they would perch in tree branches and barn rafters though so we would always have to go hunt them down and bring them in all the time, haha.