For those of you who have been following my wife's chicken coop drama I thought I would give a quick update. As you may recall about 6 weeks ago we lost 3 of our 4 hens in a in coop massacre leaving one petrified hen and rooster to carry on. At that point our coop's door was automated by a webcam's TTL output connected to a relay. We had to click on the camera's URL to close the door after we watched the chickens go up for the evening. Well that night both my wife and I forgot to close the door and that Mink got in and ripped them apart it was a bloodbath! He only took one but killed the other two just for sport. The next day she bought 5 baby chicks moved my car out and set them up in the garage. She was not going to put them in the coop until I made improvements.
Fast forward to today: Our trapper took care of the Mink (Sorry Loopy I don't have the tail) and I have version one of Coop Boss up and running. My goal was to make a reliable and simple coop door control that would automatically close and open the coop door based on Sunset and Sunrise. Chickens (with religion) go into their coop just before sunset they cant see in the dark so its just mother nature.
Since the Coop Boss is standards based (ZigBee HA public clusters) it will work with existing ZigBee HA networks. SmartThings and their dev environment allows you to create custom device types for custom hardware. So at the 1000' level the propeller spends all day monitoring the ambient light level, a button on the side of the coop, and an xBee for command packets. This is a cake walk for the propeller. Via the xBee ZigBee radio the propeller gets commands from the SmartThings cloud and responds to them. It also sends reports of the current status (door open or closed, current light level, current temperature) to SmartThings. SmartThings presents this data to the iPhone (as seen below)
- Propeller based custom PCB
- ZigBee radio (xBee ZB SMT),
- Photo resistor to measure sun light
- Solid state relays to control 12v DC actuator
- 12 DC actuator connected to coop's door (same actuator that was connected to Web Cam)
- ZigBee SPIN library you can find details in this older post: http://forums.parallax.com/showthread.php/157233-Propeller-to-SmartThings-(communicating-with-the-ZigBee-HA-public-profile)?p=1291123&viewfull=1#post1291123
- Supported ZigBee Clusters 0x0000: Basic, 0x0101: Door Lock, 0x0402: Temperature, 0x0011: Proprietary X Modem Firmware Uploader
- SmartThings custom device type (JAVA code that runs in the SmartThings cloud)
- Auto Close on / off
- Auto Open on / off
- Report Current Light Level and Temperature
- Send Open door, Close door commands
- Set Close door light level to current light level
- Set Open door light level to current light level
- Reset back to factory
- EEPROM upload via xModem and XCTU from Digi. This allows you to change the Spin code and upload it over the ZigBee network.
Keep in mind since the circuit uses ambient light level to open and close the door the SmartThings network or my local internet connection could be completely off-line and our coop door will still close at night. We noted the ambient light level when the chickens go in for about a week and set the close door light level to be about 1/2 hour after they go in. This way if we forget to close the door the propeller will do it for us.
Version two is in the planning stage and I think I will start another post: I want to have some type of sensor for the door as it closes just in case a chicken is in the path. This has not been an issue in the past as we always check our web cam before we close the door. But now that it is automatic I need to have some type of safeguard.