Step 5: Building the Arduino Electronics

For those of you who are confident with a soldering iron this is a relatively straight forward task.  I have attached a full circuit diagram of the main Arduino electronics.  I basically scratch built my main Arduino board except for keypad LCD shield - you can't beat them on price and quality

You can short circuit the work involved by choosing some excellent Arduino prototyping boards which provides RTC and connectors for probes.  Do check out eBay or other distributors.  The basic digital electronics needs to provide:
  • Ardunio processor board based on either Atmega328P or Atmega168 (£7-£10)
  • Real Time Clock based on the DS1302 or equivalent (£4)
  • Onewire digital thermal DS18B20 temp probe (£4)
  • Keypad Shield 4Bit 1602 LCD Module Display with an ISP header for programming using the Arduino IDE ver1.0 (£5)
  • A couple of pull-up resistors and micro switches for door sensors, IDC connectors and ribbon cable (£2)
<p>Following up...3 years later...We started with 12 peeps, sold 4, 4 gone to predation (the risk of letting them run free). Arduino based Uno R3 running continuously all 3 years!</p><p>Now returned to door design for the next batch next spring. I modified some code from Roger Reed. My controller takes care of lighting, power ventilation in summer, shared with water heater for winter. (inverted flower pot with light inside). RTC will remain as a system clock. It also has a separate egg box light that flashes should the egg box be left open. One indoor temp sensor (no display :( (yet!)), but still actively in control! </p><p>Hope to add 2 more temp sensors and an indoor remote controller over rf this year...parts here, time not. The implementation of all features desired will require a mega 2560, and I am considering off loading door control to a subsystem for modularity. Light is currently relay controlled AC CFL, and will be replaced with LED pwm, filtered to remove flicker, and fading up/down to improv asthetics for the girls. Door will have a servo lock as I did not like the mechanical solution for the added weight. Locking will be verified by status LED, as will door position.</p><p>An addition I really like (for anyone considering a smlilar project) is an LED flashing a heartbeat. It is visible from the house, dims at night based on a light sensor, and provides reassurance that all is well, without being over bearing at night. It provided great feedback during the -20F temps last winter to know the system was surving and operating normally! (I was delighted the UNO clone kept on chugging through the 2+ weeks of sub 0 temps!)</p><p>Many thanks for your continued inspiration! Where is V2.0?</p><p>Cheers,</p><p>-fab</p>
<p>What an excellent instructable! When I first looked and saw the wooden door and the banged on latches, and rather odd looking elevator mechanism. I was a bit skeptical. But, you have thoroughly impressed me with your very well thought out design and the code is absolutely fabulous. Are you sure you want to keep raisng chickens with your time or go into product design and code development? (kidding...of course you seem totally happy doing what you do). I just wanted to thank you for a delighful experience in learning and say you have helped me with my little project quite nicely. I've gotten some very nice new ideas (for me) from your project. Thank you.</p><p>JB from Las Vegas, Nevada</p>
Many thanks JB for the comments<br><br>I originally was a modem product introduction engineer when I first left University and also a digital signal processor coder. So I kind of gone full circle! I am also a master class lecturer for The Royal Institution (of Faraday fame) so hopefully encouraging kids to enjoy building and programming Arduinos. A few of your countrymen have also built the coop controller adding their tweaks.
<br> How To <br> Build A Chicken Coop--- http://bit.ly/1HUQGpO
<p>Is there a way to make a servo with a timer used to pull a door open at <br>sunrise and let it slide down at sunset automatically everyday? It's for <br> a chicken coop. That's a good idea for sunrise and sunset, but what if I want a timer so <br> I can adjust the opening and closing at times I choose? Letting the <br>door open too early is not good because my neighbors are asleep and the <br>chickens will wake them up. I would ideally like to adjust the time of <br>opening 1-2 hours after sunset.</p>
<p>It would need to be a large servo as the door is quite heavy. </p><p>I set my time to open the door for around 6.30 in the summer so as to give my neighbours a lay-in but you need to make sure your coop is sealed from the light. You can adjust the time within the program or the menu</p>
<p>It amazes me what people can do. I too am a small time chicken rancher and have also wanted a way to open and close the coop automatically. ALso, there is a need to automate watering. Unfortunately, I know nothing about Arduino.<br><br>My rough concept is to use water trickling into an empty bucket on a lever (with the door on the other end of the lever) as a weight to eventually, gradually, open the door, which would ultimately tip the bucket into a water trough for the chickens to drink and close the door. Then the bucket would spring back up, right itself and begin filling again. Each fill/dump-open-close cycle would need to take about 12 hours.<br><br>I have not prototyped it yet. I do prefer simple machines that don't require a computer to operate. But, that's just me.</p>
I am also interested in Automatas and you idea would be brilliant to see in operation all powered by water. Outside temp may be an issue hear as it went below -10oC here in the last month
<p>Hi love the build. Do you think it could be done with a photo cell to trigger open and close instead of the timer ? That would be an ideal setup in my opinion.</p>
<p>Hi may i know all the components used in this project?</p>
Great instructable! I'm just finishing my coop and will be giving this door and controller design a go. <br> <br>With the experience you've gained, which arduino board and shield(s) would you suggest I use? I'm not very good at soldering so I'll be looking at constructed components when available. <br> <br>Thanks!
Hi I am probably about a month away from publishing ver2 which uses a rotary switch and a 4 x 20 LED screen. All the components are modules except for the Arduino board which is a modified prototype board - which you could use an Uno v3 if you don't fancy any soldering. I have attached a some of images to show you the new hardware layout and screen. As such I didn't use shields just discrete modules with interconnect wires which you can do with the ver1 design. <br> <br>Any motor module that can deliver 2-3amps usually has an LM298n chip with the 2 channels linked together will do. There are some very cheap 1302 RTC modules with battery holder. I used a cheap 20x4 LCD in 4bit mode with the standard crystal LCD library. There are some shields to fit the UNO with integrated analogue keyboard and screen you can use. Hope that helps
<p>very good job .</p><p>your project let start me learning arduino.</p><p>we wait for v2 </p><p>thanks </p>
Thanks for that, I'll look forward to seeing your v2!
Wow. I just love this idea! Great execution.
So how much would you charge for one to be built and sent to the US??
Honoured that you would buy it from me but unfortunately I just don't have the time. There are at least 3 folks in the US who have built it so perhaps they might be able to help you without putting them under too much pressure!! I suspect it will be a lot cheaper as well - happy persuading!
Love it!! But how does the door stay open, is the motor engergised all the time the door is open? if so why the top micro switch?
Hi glad you like it. The planetary gearbox is stiff enough to keep it open once the top limiter switch is triggered. So it only needs 2 amps of battery juice for about 1 second - very efficient
That lock is really smart! And well made 'ible! <br> <br>If you think about it and add a long spring to replace gravity, you can use that idea even in horizontal direction for other projects...
Well I can't take credit for the design - only the reverse engineering of it. I like the idea of the spring. I have another follower who is in the process of making his own. Really looking forward to seeing how he has improved the design - I think he is using draw runners for a smoother action.
i built a 10x10 shed for my two geese. i really like your plans, i am going to use them with some modification.. it will have a steel plated door because i live in the middle of the woods and foxes and other such animals are common. to heat my coop i have a forced air propane heater. the unit is also a a/c so in the summer the vents are blowing nice cool air. all the walls and doors are insulated, do you have a suggestion for insulating the automated door? <br>as a final comment i would like to thank you for caring for the ex-battery chickens. in a unrealted way: one of my geese broke is femer (which is inside its body, not accessiable by topical cast) so i went to the only place i know crazy enough to do sugery of a pet goose (cornell universty vet hospital) it cost me close to $2000 in medical bills, and a entire summer vacation inside caring for it.
Hello R C, <br> <br>I need first of all to congratulate you for this great design and implementation! <br> <br>I've been planning for some time to implement for my own coop an automatic door but with the use of an LDR (we have no lights where the coop is), so now that I found this I will certainly start building it! <br> <br>As I have almost no knowledge of electronics, just good soldering skills and good &quot;follow instructions&quot; skills I have probably a couple of rather &quot;dumb&quot; questions (English is not my native language so you may have already answered this in your instructable and I just didn't get it!). <br> <br>Is the output of the trickle charger connected on the power input of the H-Bridge? Is the battery connected in the same power input of the H-Bridge? <br> <br>Does everything work with the main power supply and charge the battery at the same time and when the main power fails the battery kicks in? <br> <br>Thank you very much and once again thumbs up!!! <br> <br>Regards, <br> <br>Apostolos.
Hi R C, <br> <br>Firstly, a great instructable - I'll definately be basing my set up o it in the spring. <br> <br>One suggestion That would be good is some form of timed switch to trigger an LED light in the coop that would increase the light-hours - to ensure decent egg production in the darker winter months. NOT on a battery level!!! But I've read it can be better for the chickens to have a minimum of about 11hours light a day. <br> <br>I'm not an electronic/programming buff, so there's every chance it may not be possible, but would be good if it was. <br> <br>I look forward to version 2. Any ideas when it will be ready? <br> <br>Regards, <br> <br>Matt. <br>
Firstly many thanks to those who have given me some great feedback and have built their own chicken coop controller. <br> <br>I am currently working on version 2 which has: <br>- a visual indication the door has closed successfully, <br>- ability to turn on a low power heat lamp when the temperature drops too low <br>- Improved display and time setting <br>- those who would like to keep the lights on for a little while to keep their egg production up. Chickens normally needs10 hours of light to produce a single egg <br> <br>It is likely to be a couple of months so watch this space. Further improvements for my fine feathered friends serious or funny are greatly welcomed - R-C
Thank you for a great Instructable! The door instructions and measurements really helped me build my own. <br> <br>I decided to use a remote control to open/close the door from the house. This way I could make sure no predators were around first. If you wish check out the short video - http://youtu.be/UXNF4LRmzik <br> <br>Again, thank you for a great Instructable. :)
Also Chicken lover. Nice project. Very clever all round. Three thumbs up!!!
Nice job, !! &lt;- two thumbs up.<br><br>From that last photo, one improvement that the hens would like is to add a heated towel rail for their roost ;)
Don't for get the heated floors too :) A 30+ meters of insulated wire and the 12v power source and these guys will be loving it.
That is so funny - it is almost true. The reason for the temp measurement was to turn on an infra red lamp to warm them up if it gets too cold!!<br><br>Version 3.0 will be the automated turn the straw down before they go to bed!!
&quot; I wouldn't trigger the door opening or closing on light detection alone as it could be volatile to poor weather or the garden flood light as the fox enters our garden!&quot;<br><br>I was thinking that you could skip the arduino and go just with a photodiode and a few mosfets, but that is a good point. The fox walks near the security light, the light goes on, the door opens, and the fox gets a snack. <br><br>All around great instructable. Lots of good details.. <br><br>Perhaps there is a photodiode out there that senses a wave of light that isn't emiited by the flood light but is still emitted on days with alot of overcast, maybe UVB light around 350nm. Then a temp sensor to control the heat lamp.
Well done Robot-Chicken! Nice to see you giving those hens a better life. And I will be taking some aspects of your door design!
Feel free - using any aspect of the design would be the greatest form of recognition - have fun with it
chickens create tons of dander (skin and feather dust) that coats everything, make sure all electronics and working parts are protected. Otherwise your door is going to gum up in short order. Also wood swells when damp, which means in the high humidity of summer, rainy springs and falls, depending on where you live, the door may jam. Especially when you mix the water with the chicken dander! Make sure there is plenty of free space in the slide mechanism. And, either build a sufficient overhang to keep the door completely dry, and/or better, yet prime and paint all of your wood pieces.<br><br>Roosters (plural) make a heck of a lot of noise. They have to compete with each other. A rooster (singular) makes less noise then a bunch of hens.<br><br>I've been raising free range (no fencing), chickens in a wooded area (and in the past in an open area) for more then 30 years and only one thing works to keep chicken predators at bay - a good farm type dog.
Your are right I had to create a wooden defence mechanism against the dreaded poop. Every week the door gets a good inspection to make sure everything is in order and the wood is treated so hopefully it will last a while but know doubt will need replacing. I had the manual door fitted for 6 months during autumn and winter and it seemed to fair well.
Your &quot;before&quot; and &quot;after' pictures of the hen says it all. Great job with the rescue. It's wonderful to see how they can recover from that experience.<br><br>The coop looks great too. I love it, but I am very lazy &mdash;<br><br>Alternatively, a very, very simple solution is what I've been experimenting with this past year &ndash; totally free range-ing my chickens (small flock with two very big and very mean roosters, that is essential to the plan). Anyway, mine have branches for roosting high (about 5') in a run-in shed, and several modes of escape in the event of four legged predators. It's working so far. Hawks are another thing though, but that's a daylight problem.<br><br>The beauty of 24/7 free range for me is of course not having to get up early. <br><br>There isn't a chicken enclosure made that some predator can't get in, alas, and the carnage when they do is heartbreaking.
I agree total free range is clearly best route - I live in a town so Rosters are a no-no hence the small size garden and coop - Still worth it though just for the fresh eggs
Well---it's not necessarily &quot;best&quot; the way I'm doing things. There are a ton of variables to each persons setup. I live on and surrounded by mostly open farmland, so while we do have predators, maybe not as many as someone in a wooded area. I may have just found what works well HERE, but most people go the route of shutting them in at night, and that's probably safest in 90% of the cases.<br><br>Roosters make a hellava racket :)
Hi,<br><br>as I still did not used arduino could you please consider this idea :<br>http://www.treehugger.com/gadgets/diy-solar-powered-bird-house-tweets-when-birds-arrive.html<br><br>to allow solar power battery charging / or directly to power DC motor (may be change the current motor you used due to the voltage).<br><br>I ask you this because my backyard is too steep I though to use solar powering with those cheap small photovoltaic panels :<br>http://energybible.com/solar_energy/outdoor_solar_lighting.html<br><br>Or may be given the perfect photovoltaic solar panel that must be used to get the arduino power.<br><br>Sincerely thanks for your help and have a nice day,<br><br>Miguipda ;-)
Hi Miguipda<br><br>I very much like the tree hugger link. I am seriously considering reviewing the design so I can light-weight components and reduce the Arduino power consumption so that everything can run off rechargeable batteries and solar power. I think I will need to invest in a high quality motor instead of being thrifty with my &pound;5 motor assembly
I'm wondering if the arduino is required at all for a simple version that merely opens the door at sunrise and drops it after sunset. A solar panel, a motor and gearbox, a photoresistor, big capacitors, and some glue components are all you'd need. But the arduino certainly allows for adding on functionality like monitoring temperature or even detecting a fox or thief disturbance should one want to so I'm not saying that it doesn't have its coolness too. The minimalist in me just went down the other path.
I think you are right you can get away with something simple. The only issue I have with a photo resistor are false readings opening the door in the middle of the night. In my garden we have a PIR light which comes on even when a fox is in the garden. So I didn't really want to present Mr Fox with an opening door to a late evening lunch!! In a big open space without spot lights you are spot on - pardon the pun.<br><br>However if you stripped the design down to the bare safety levels for my little ladies then everything thing you said plus a simple pwm arduino board would surfice.
Ok. I was envisioning no batteries or external power and the actual presence of sunlight on the photovoltaic would power the motor to open the door. In the middle of the night there would be no power for the motor to open the door. The photo resistor would just be to detect darkness and trigger a solenoid to drop the door in the evening. The solenoid would be powered by a large capacitor charged from the panel when the sun was still up. Another capacitor combined with a resistor would be used to delay the door closing 30 minutes.
Hi,<br><br>@Robot-Chicken : I do not remember wich kind of motor did you used to open the door but I read somewhere that a motor used to open a car window could pehaps be enough to do this job.<br><br>Have a nice day and with pleasure to read the last update instructable arduino open door.<br><br>Miguipda ;-)
further simplification: the photovoltaic itself could probably do double duty and replace the photodiode.
Nice idea - would be interesting to see how much current can be produced in moderate light I suspect that would be the main challenge. A little rechargeable set of batteries could be used to store all that sunlight energy to give the short current burst needed when opening and closing the door.
I had exactly the same idea. Wonderful how someone can play with Arduino, but is it really necessary to make it so complicated? <br><br>I was thinking of something like when your solar panel gets lid by sunlight it gives a certain voltage that might trigger a relay (or transistor?) which acts like a switch to make the motor run in any direction depending on in which position the door is. eg. When the door is open a micro-switch makes the motor run clockwise and vice versa when the door is closed.<br><br>Just a thought :-)<br><br>thanks for the instructable!
Hi,<br> this could be useful : http://www.instructables.com/id/Self-Sufficient-Arduino-Board/?ALLSTEPS<br> <br> The first way here : http://voltaicsystems.com/blog/three-ways-to-power-an-arduino-off-grid/<br> <br> http://www.cooking-hacks.com/index.php/solar-module-for-arduino.html<br> <br> Sincerely thanks for the attention you will have to this request. I seriously appreciate.<br> <br> Have a nice day,<br> <br> Miguipda ;-)
I like your idea. <br>Much snazzier than what I did, and overall much less expensive.<br><br>I put my coop inside of two dog kennels hooked together (I already had one, but thought I needed more room). Hooking the kennels together gave me an area about 20 foot square and 6 foot tall. <br><br>To have security from hawks and eagles, which are more of a threat in my area than fox, coyote, weasel, or stray dogs usually are. I ran some ropes across the top of the kennel and hooked poly tarps and nylon netting to the ropes so that the top was closed off. <br><br>However I didn't stop with my security measures there. I also lay some 4 foot wire fencing on the ground under the edges of the kennel and then secured the kennel to the fencing. I hooked down the kennel with cork screw metal anchors that I drilled into the ground (I don't know what you call these - usually you use them to secure a dog). This gave me some security from digging or just forcing the kennel up and squeezing under.<br><br>I built an L and set it in front of the door to the coop to act as a wind break.<br><br>Now except for in the winter I just leave the coop door open and the chickens come and go as they please.<br><br>I feel pretty secure unless I get a cougar, wolf, or bear with the munchies come visit, in which case my coop probably wouldn't stop them anyway.<br><br>My approximate costs: kennels cost about $350 each, the fencing $25, the eight anchors I used only cost me $1 each (dollar store many years ago), the rope, tarps, and net I had on hand - I don't remember the cost, but all together they probably ran about $20. My total $753 USD or 475 GBP.
You should write it up and send in some pics it sounds brilliant

About This Instructable


352 favorites


Bio: I am consultant who spends his spare time dreaming up stuff and reading other people's great ideas. I have a growing family and a ... More »
More by Robot-Chicken: Chicken Coop Controller v2 Arduino Chicken Coop Controller
Add instructable to: