Yes I know, why automate a chicken coop? Well we just wanted to do a starter home automation project and one thing led to another and now I have the fanciest chicken coop around. Spoiled chickens lay good eggs… It also is because I am a little lazy and don’t want to get up every morning to let the chickens out and go out each night to close the coop. So I automated a coop door actuator that runs on a timer (every morning the door opens, every night the door closes). While I was at it, added lights to fool the chickens biological clocks during winter by extending the days. The light is also actuated by a timer, but a light sensor is used to turn the lights off if there is enough daylight. I added a fan to exhaust the coop. The fan is run on a timer to exhaust the stink once a day for one hour. The fan will also come on if the temperature gets too hot or if the methane levels get high. So The following sensors are also used to control all of this: temperature, methane gas, smoke, and voltage. All of this is run automatically but can be run locally or via the internet! A small web page is served up if the IP address is typed into a browser. The SD card on the Arduino Ethernet shield stores the page. The web page shows the current status of the coop (temperatures, voltages, gas levels, lights on/off, fan on/off, door open/closed, etc. The web-page also allows you to manually turn on lights, fan, battery charger, or actuate the door. The router is set up to port forward the local IP address of the Arduino Mega Ethernet shield so the coop can be monitored and controlled locally or from anywhere with a internet connection. The Arduino Uno is used to push messages using a API called PushingBox. The Pushing Box notices can be set-up to send instant messages, emails, etc. priority can be set, etc. So notice is sent when the lights are turned on or off, etc. A high priority message is sent if smoke or methane levels are high, etc. For the most part the program just runs on its own with not need to interface, etc. with it. The lights come on and off each day and the door opens and closes, etc. with no problems or interaction. The Mega is synced with a NDT time server so it does not miss its cues. The chickens are happy and now that its finished, I dont have to do much at all. The water is automatic, just have to add feed every once in a while and collect the eggs each day!
The figure shows the layout of the components that were used. All of these components were put in a NEMA box to keep it dry. I cut a opening for the LCD so I can see the messages, etc. Wired in few switches to run things manually. The block diagram is just listing the major components, things like fuses, terminal blocks, etc are not listed. There is a bunch that goes into home automation including messing with AC power which you should only mess with if you know what you are doing.
The components used are listed below. I ended up using two Arduinos because after many failed attempts I concluded you can not set up a Arduino to be a client and a server at the same time. If anyone has figured out how to do this, let us know because looking at other forums, etc. lots of other people have struggled with with same thing. All said and done including the actuators, enclosure, wire, terminal blocks, hardware, fuses, Ethernet Cables, etc. its probably about $600 worth of cool stuff.
- Arduino Mega 2560 R3, MCU-049-000
- SDR Custom Arduino Mega Shield, MCU-055-000
- Arduino Uno R3, MCU-050-000
- Qty 2 Arduino Ethernet Shield R3, MCU-056-000
- Ethernet Switch Module – 3 Port 10/100M, TE-202-003
- ASUS 3-In-1 Wireless Router, TE-238-000
- 4×20 Parallel LCD Neg Mode w/ white LED backlight, LCD-011-000
- Interstate 12 Volt 7.2 Ah Sealed Lead Acid Battery (SLA), TE-177-007
- Smart Charger for 6V-12V Lead Acid Battery 3A, TE-133-612
- H8054 Mini Pyroelectric Motion Detector Module, TE-232-805
- Photoresistor 5mm GL5537, TE-231-537
- DS18B20 Waterproof Temperature Sensor – 3 Meter (9.8ft), TS-069-030
- Qty 2 DS18B20 Waterproof Temperature Sensor – 1 Meter (36in), TS-069-010
- Pololu Methane Gas Sensor MQ-4, TS-056-MQ4
- Pololu Flammable Gas & Smoke Sensor MQ-2, TS-056-MQ2
- Qty 2Pololu MQ Gas Sensor Carrier, TS-056-MQ0
- 4 Relay, 7 Channel High Curr TTL Driver Module, TE-249-040
- DPDT and SPDT Relay with TTL Driver, TE-010-502
Keep posted, we will be updating this in future posts to include the code, more details, etc.
#IOT #homeautomation #techthursday #arduino