Author Topic: Automatic chicken coop door  (Read 28880 times)

chickenturd

  • Newbie
  • *
  • Posts: 15
Automatic chicken coop door
« on: September 12, 2012, 10:43:31 am »
When my digisparks come in, I'll be using one to build a solar powered automatic chicken coop door.
Small solar panel uses small charge controller to charge a small 12v battery.
Charge controller has 12v output. Guess I'll have to find a 12v --> 5v adapter for the digispark.
Digispark will use a time keeping shield I already have to get current date/time.
Every day, the digispark will use an algorithm to calculate the sunrise and sunset times for my location. Every morning at the sunrise time, the digispark will lift the chicken coop door to let the chickens out. I'll be using a 12v motor from an automotive antennae lifter thing. It has a 12v relay that allows it to turn on for a given time and then turn off automatically. I'm not sure if the relay will trigger at 5v, but it takes very little amps.

Then at sunset time + 15-30min delay, the digispark will release the motor's relay, causing it to close the coop door.

Any ideas?
« Last Edit: September 12, 2012, 10:43:31 am by chickenturd »

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Automatic chicken coop door
« Reply #1 on: September 12, 2012, 01:27:44 pm »
We have chicken too - and duck, and geese!

A few things - Digispark can run on 12v no prob, it has a regulator built in to take it down to the 5v it needs.

You could use a MOSFET (or transistor) to switch 12v to the relay.

Your setup sounds really awesome - I\'d probably just use a light sensor + delay instead, but I like the completeness of your solution.


DoktorJ

  • Newbie
  • *
  • Posts: 14
Automatic chicken coop door
« Reply #2 on: September 21, 2012, 05:49:48 am »
I think using a MOSFET to switch the relay would definitely be a good idea.  Make sure you select a logic-level MOSFET though for best results; the RFP12N10L should fit the bill, with a 12A continuous drain current and \"full rated conduction at gate biases in the 3V to 5V range\".

headingwest

  • Newbie
  • *
  • Posts: 1
Automatic chicken coop door
« Reply #3 on: September 28, 2012, 03:18:39 pm »
I built a timed chicken door the same way using a different micro controller.

The fun part is the board, relays, programming etc. The REALLY difficult part is moving the door. Finding good motors, getting good sensors to detect the door is fully open and stop the motor.

There\'s a lot of weight in a chicken door that\'s fax/badger proof, so you need a strong motor. These are expensive and draw a lot of inductive power starting and stopping.

Do you have a timer to control how far the door opens? Or a microswitch? What happens if your microswitch fails?

I wish the world was made with pre-built interfaces to digisparks so you could just \"plug in\" the chicken door component.

chickenturd

  • Newbie
  • *
  • Posts: 15
Automatic chicken coop door
« Reply #4 on: September 28, 2012, 03:37:04 pm »
I\'m using a car antenna motor. It has three wires: Ground, 12v power, and 12v relay.
Ground and 12v power are always \"on\", or hooked up to a power source.
When the 12v relay is powered on, the motor extends the antenna until it has been extended. The 12v relay must stay \"on\" while the antenna is to be extended, for if the 12v relay is powered off, the motor retracts the antenna.

In theory, by hooking the door straight up to the antenna, I will never have to deal with open/close sensors because the antenna will always extend a certain distance and retract a certain distance with internal sensors to know when to turn on/off. Hopefully making it simple for me.

chickenturd

  • Newbie
  • *
  • Posts: 15
Automatic chicken coop door
« Reply #5 on: November 13, 2012, 04:25:32 pm »
Wanted to make a parts list for my own records:

Software:
Time Library (http://www.arduino.cc/playground/Code/Time)  
TimeAlarms Library (included with Time)
Any RTC library (there is also one included with Time)
Sunset/Sunrise library (I will open source my code soon)
Code that drives everything (I will supply this)

Arduino hardware:
Digispark
Relay shield (12v)
RTC shield (optional but highly recommended)
Other misc (jumpers, wire, power adapter for digispark)

Arduino support hardware:
12v battery
12v battery charge controller
12v solar panel
Weatherproof case?

Chicken door hardware:
Wood (to custom fit your coop)
12v car antenna motor assembly
2 x pulleys
Cordage
Sheet metal (door)
Aluminum tracks for sheet metal door

« Last Edit: November 13, 2012, 04:26:48 pm by chickenturd »

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Automatic chicken coop door
« Reply #6 on: November 14, 2012, 03:51:12 pm »
RTC shield we\'ve been playing with - cheap, rough, but works: http://www.ebay.com/itm/New-Arduino-I2C-RTC-DS1307-AT24C32-Real-Time-Clock-Module-For-AVR-ARM-PIC-/170794823401?pt=LH_DefaultDomain_0&hash=item27c42a2ee9

You should be fine powering the Digispark right from the 12v battery, if you want an adapter to connect it you could buy/make something like this http://microcontrollershop.com/product_info.php?products_id=4271 and plug it into the vin and gnd header, I\'d probably just use a proto shield and solder some wires on (to VIN not 5v!) and hook them to the battery.

chickenturd

  • Newbie
  • *
  • Posts: 15
Automatic chicken coop door
« Reply #7 on: November 14, 2012, 04:21:47 pm »
Thanks Erik,

I bought my RTC from a domestic guy for a little more, but I like it so far: http://myworld.ebay.com/tommyvdp/

Also thanks for the heads up on supplying 12v via the VIN. I did not think about that. I thought I would have to build/buy a USB adapter.

I like the terminal header/adapter you linked to. I will try to find one like that with mounting adapters because I will be mounting all components (digispark, rtc, relay, power header) to the base of a water-proof box of some sort.

What is the current ETA of Digispark? :) I am currently proto-typing all of this on a DueMilaNove and I\'ll then substitute the Digispark in right before roll-out. I am a bit worried my program will be too big for the digispark 6K limit, but we\'ll see when it\'s done.
« Last Edit: November 14, 2012, 04:25:00 pm by chickenturd »

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Automatic chicken coop door
« Reply #8 on: November 22, 2012, 09:25:54 pm »
It looks like they\'ll start shipping around the 10th, but we are working with the factory to hopefully push that up a bit.

I\'d think you could get it in the 6k limit no problem!

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Automatic chicken coop door
« Reply #9 on: November 22, 2012, 11:13:24 pm »
I\'ve played around with mounting stuff like this outside in weather proof boxes a bit and it can be really annoying - somehow condensation always found a way in. Seeing as you\'re building it in to a chicken coop though it shouldn\'t be much trouble - if the electronics are well protected by the roof I doubt a box would even be needed. If you have trouble, dipping in regular candle wax is an easy way to insulate little circuit boards.

pjsg

  • Newbie
  • *
  • Posts: 7
Automatic chicken coop door
« Reply #10 on: December 12, 2012, 06:30:31 pm »
I already have an automatic chicken door controller (based around a linear actuator that I bought off ebay). However, it was based around a PIC which had to drive a pair of reed relays to interface to the linear actuator motor controller. Anyway, the reeds would stick and it was generally unsatisfactory.

My new controller is to be driven by a digispark and the grove shield talking to a pair of real relays that I hope will be more robust. For timing, I\'m cheating and using a time switch designed for controlling lights -- it will just close a pair of contacts and signal the digispark that way.

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Automatic chicken coop door
« Reply #11 on: December 16, 2012, 05:17:25 pm »
It occurs to me that the time when chickens want security probably has more to do with sunset than time of day? A light sensor seems like it might be a better way to go

pjsg

  • Newbie
  • *
  • Posts: 7
Automatic chicken coop door
« Reply #12 on: December 18, 2012, 06:34:00 pm »
I have a light on a timer that comes on in the morning to try and encourage them to lay. If I ran off a light sensor, then I would worry about the morning. Maybe I could close based on the light level and open based on a time switch.

Anyway, I did port the code from the PIC to arduino and now have it running.

Now to wait for the digispark.....

While waiting, I did add support for the light sensor. Now I need to wire up the linear actuator.....
« Last Edit: December 18, 2012, 07:24:50 pm by pjsg »

kcbudd

  • Newbie
  • *
  • Posts: 11
Automatic chicken coop door
« Reply #13 on: December 28, 2012, 09:07:55 pm »
I built a \"linear motor\" for my chicken coop door by coupling the shaft of a geared 12v motor to a standard piece of threaded rod.   Then I just welded a matching nut onto a 90 degree aluminum bracket which I attached to the top of the square door.   By doing this a 1A 12V motor can raise and lower the door both reliably and securely.   The only drawback is it\'s slow - it takes about 180 seconds for the door to complete the transition.  (OTOH, I\'m not likely to ever cut any chickens in half with a door that moves that slowly.)  It\'s like watching one of those Hollywood vault doors move.  ;)

I control the door motor with a PIC based usb circuit... (If I was building it today, I\'d definitely use the Digispark.) .. and this motor driver: https://www.sparkfun.com/products/9457   - the motor driver lets you set the direction of the motor with an input pin and reverses the polarity to the motor appropriately.  (Internally, it\'s basically a transistor \'H-Bridge\')

I used this 24v surplus motor, though I run it at 12.5 volts (since that is the max that the motor driver is spec\'d for):
http://www.herbach.com/Merchant2/merchant.mv?Screen=PROD&Store_Code=HAR&Product_Code=TM03MTR4712&Category_Code=DCGEARHEAD

This setup has worked reliably for five months now.  I\'ve also found that sunrise and (sunset plus 10 minutes) times are the best indicators for when to open / close the door, as chickens apparently use the ambient UV light level to decide when to go back into the coop.

Here\'s some pictures of the door / motor assembly:
http://www.flickr.com/photos/phreakmonkey/sets/72157632368136255/with/8319859691/

maudette01432

  • Newbie
  • *
  • Posts: 16
Automatic chicken coop door
« Reply #14 on: December 31, 2012, 01:25:38 pm »
I did one of these with a wiper motor from monsterguts.com..it\'s been in service for 2 years now without a hiccup - other than the solar panel failure keeping the battery charged.  I used an Atmega and CDS sensor for light (open at dawn close at dusk) and a bi-directional relay based motor controller as well as a couple magnetic (window) switches.  It has a status light I can see from the house that reports \"trouble\" should it not open or close fully.

The motor controller portion was the \"hard\" part - I originally used an H-bridge but it just didn\'t have the current capacity that was required and would ground the Vmotor on failure resulting in resetting.  Simple solution was a DPDT relay, protection diode and a general purpose transistor and a low Rdson MOSFET on the ground path.  This way I could control direction easily and still have on/off/and PWM speed control without the expense of a full blown H-bridge....it\'s been very reliable.  It can also handle up to 35A @ 70V if the need arises...depending on the relay used.  Here is a schematic:  

https://dl.dropbox.com/u/92156320/Screen%20Shot%202012-12-31%20at%204.25.43%20PM.jpg

It all fits on a 1.75 x 2.75 inch PCB (single sided) that I etched in my garage with one \"jumper\" on the bottom side.

The control electronics are all housed in one of these weather tight grey PVC electrical boxes meant for outside use.  I\'ve had no moisture/water problems with this approach.

As for the solar panel failure - you get what you pay for - don\'t cheap out or it wont keep the battery charged or word will short the battery if conditions are right and drain it.  I ended up switching to a 12V trickle charger (less than $5 at harbor freight stores) and an old telco 12V battery.