Introduction: Automatic Chicken Door Opener

Hi this is my first instructable so sorry if it's not perfect.

Basically i bought some chickens a while ago and thought about making something to automatically open the door when it gets light cos im pretty lazy in mornings ;) .
After looking on ebay i found out they were between £90 - £110 so i decided to get my thinking cap on and make my own.

I have seen a few floating around but they all seem to be done by time not by light level.

What it must do:
open the door as it gets light
close the door when it gets dark
pretty simple huh? haha

Before we begin i would like it know i am planning on making some of these up and selling them online for about £60-70 if anyone cannot or doesnt have the time to make it themself. i will post it up when thery're on ebay.

so...anyway thats enough chat lets get on with it.


EDIT:
Im also plainning on adding a solar pannel with a diode to charge the batteries when its light but not allow the batteries to discharge through it.


here is the project set up as a trial in my garage  :)

Step 1: What You Will Need:

i went to http://www.techsupplies.co.uk which i would advise all of you to go to, really quick delivery (one of my orders was at 11 oclock in the evening and arrived midday next day).

Suppiles:
PICAXE-14M microcontroller
PICAXE-14M Starter Pack (USB)  (for ease of project)
IC Holders (14 pin)
IC Holders (16 pin)
L293D motor driver
Stranded Wire   (either colour will do)
Worm drive gearbox pair (solar motor)
ABS Box largest one
Solder
Light Dependent Resistor ORP12
10k potentiometer
2 x Miniature Microswitch
Stripboard (perfboard)

non-techsupplies stuff:
Fishing line
peice of wood the same size as your chicken coup door
hinge
small screws
small scraps of wood

Tools:
Soldering iron
Wire cutters
Wire strippers

Step 2: The Circuit

Here is the diagram for the circuit, its hand done so sorry about quality :P

Step 3: Building the Circuit

This is the basic build steps,

mistakes i mad:

Installed a regulator that was then removed as it is run at 6v ( 4 AA batteries) and has no problem with the voltage

also

Was going to insert the chip into the ic holder but then decided to use the prototypeing board and simply use wires to connect the boards together, i did leave the ic holder there though as it makes it easier to work out were to put the wires.

Step 4: Programming the Chip

simply insert the chip, open the picaxe programmer, make your program and press F5.

Before i give you the code i want to explain how it will work.

1) test the circuit by running the motor forwards then backwards
2) if the light levels are high then start the motor running in a direction untill the switch is pressed (the swich it pressed when the door is fully open)
3) once the light levels decrease then run the motor in the opposite direction untill the other switch is pressed.

Step 5: The Enclosure

You will have to cut some of your box's sides so that the wires can be fed out of it but thats pretty much it, simply fit the boards in place and then close it up.

Step 6: Making the Door

Simply cut your wood to the size of the coup door put a hinge at the top and a screw sticking out of it at the bottom, now mount the motor above the door and wrap a few turns of fishing line around the spindle you may want to add some tape or glue to hold it there.
now mount the LDR where it will see the sun when it rises in the morning.

now insert the batteries and wait a few seconds for the tests to run

now simply go out about 2-3 hours after your chickens have fallen asleep and turn the pot very slowly untill the door closes, now when the light is any heigher than this the door will open, thats how easy it is to tune :)

I've included my test set up, all attatched to my bench before i do the real thing, and a video of it in action i simply cover the ldr and then expose it to the light to simulate the sun rising and setting.