Utah Makers

Full Version: Arduino and L293D controlled chicken coop door opener
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm almost done with the brain of my chicken coop door opener. All I need is my H-bridge and to build the pulley system. I'll attach photos of what I have now.

The idea is a light sensor on the roof reaches a certain measurement, checks again in 6 minutes, then lowers the draw-bridge style door. Waits 12 hours and pulls the door back up.

What I have used:

BBB Freeduino
TI SN754410
12v motor from a car window
photoresistor
caps, resistors, etc
Cool project!

I see a couple potential problems. (That you may have already addressed)
- Light sensors can be easily covered by snow / etc. You may want an alternate method (after a certain time if the light sensor hasn't reached its trigger level, it will open anyway)

- You may need a RTC (real time clock) module to do any kind of real timing. The onboard timing is a little buggy at best.

Eric could explain much better then I can. Maybe him or someone else can jump in on this.

Project looks great though! Keep us updated.

EDIT:
SparkFun RTC

You may be able to build something for cheaper, or hack something together. ($5 wal-mart alarm clock maybe?)
(02-01-2010 04:28 PM)Deven Wrote: [ -> ]Cool project!

I see a couple potential problems. (That you may have already addressed)
...
You may be able to build something for cheaper, or hack something together. ($5 wal-mart alarm clock maybe?)

Thanks! Good points. I'm thinking a walmart alarm clock Smile I've already hacked one of those into a daylight alarm clock so it would be a "cake walk" haha
http://www.allaboutjake.com/projects/watch-winder/

This recent project on make, while not a chicken coup, could have some insight for you on using an RTC chip for task scheduling, iff'n the hacked Wally World clock doesn't pan out.
Do you think calling
delay(43200000); //12 hours

Would work for it to just "sit around" for 12 hours? Currently my code looks like this:


#
void loop()
#
{
#
if (sensVal > darkVal){ // duh
#
delay(360000); // waits 6 minutes
#
if (sensVal > darkVal){ // checks the sensor again to make sure its really the sun not just some retard in the neighbors driveway
#
doorDown(); // lets door fall open gracefully
#
delay(43200000); // waits 12 hours.
#
doorUp(); // pulls door back up
#
}
#
}
#
}
Looking into it a bit online, I found this thread which may be helpful to you as well.

http://www.arduino.cc/cgi-bin/yabb2/YaBB...1215338347

It seems that the arduino clock is only 2-4 seconds off per day, which isn't good enough for a clock, but it will likely do for 'about 12 hours later, close the door.' The real problem you run into here will be the overflow reset for millis() which occurs every ~9 hours or so. You would need to write some code that takes into account that millis() will jump from a giant number back to 0. Otherwise you can probably get away with just using the arduino 16MHz clock to keep time 'well enough.'
Ahh cool. I'll just set it up to delay 6 hours twice. kludgey but it w ill work I guess.
I think I am going to go with the arduino DateTime library http://www.arduino.cc/playground/Code/DateTime and shave the few seconds it will be off every day.
That looks like it'll be close enough for the kind of accuracy you'll need. Good luck to you in getting it all put together.
Reference URL's