Wednesday, January 26, 2011

Coop Door Code Update Success!

Firstly, a thank-you to Brian, who commented on my last post.  I had a very detailed reply, but commenting on Blogspot seems to be borked for me.  I'll try to answer some of your questions at some point in time if I get commenting fixed.

Now, on to the progress...    I finally implemented sunrise/sunset time-offsetting for the door.  If I enable either sunrise or sunset offsetting, the door-open time becomes a base time, and then the controller checks the day-of-year, and does a table-lookup to obtain the offset in minutes.  It adds the offset to the door-open time, and subtracts the offset from the door-close time.  Now the Winter Solstice has passed, the days are starting to get longer again, so I got this in place just in time.

I also gutted the code that checks to see if it's time to open or close the door and made it a lot simpler.

Lastly, and this was probably the biggest "bugfix", I added some "keepalive" code to the WiFi connection.  Before, if the connection dropped, the BlackWidow board wouldn't do anything to reconnect.  I would have to go out and reboot the controller in order to get it talking to the network again.   To fix this, I added a method to the WiShield object that returns the WiFi connection status.  The webserver checks this periodically and re-inits the WiFi connection if it is down.

6 comments:

Adam said...

I just discovered your chicken coop door project. Nice work, I'd love to try my hand at making the same thing for my chickens. Where or how did you come up with the door locking?

slinky said...

Hi Adam - thanks for the kind words. The latch mechanism was just a brainstorm of mine to keep the raccoons out. There could be many variants of it.

mark said...

Hello Adam, Great Chicken Coop project! I'm in the heat of working on my arduino coop door and was wondering if you'd ever considered posting your code? I've been reviewing several others code and am trying to find the best of all worlds... Anyways, I'd love to see it if you'd be amenable to sharing with me (or the wide world). Thanks a ton and great job!!

Huang Lissa said...

The acid should be diluted with an excess of water to give a 5 to 10-folddilution. The liquid should then be neutralized by mixing with an equal volumeof agricultural lime, or other alkaline material containing lead-acid batterycalcium carbonate, orsodium hydroxide. Use ofhydrated lime has the advantage of lower cost per unit of neutralizing capacitywhen compared to sodium hydroxide.

Huang Lissa said...

Coral rock may be an alternative in many PICs, although use of calciumcarbonate or sodium hydroxide is preferred. The ups backup batterycoral rock to be used shouldbe dead coral, preferably washed ashore which can be crushed finely andadded to the liquid requiring neutralization. If the ro ck is to be used, it shouldbe crushed into very small particles to increase the surface area so that the neutralization reaction can proceed as fast as possible. If large particles areadded to the acid it may take a lot longer for the same neutralization level tobe reached.

Mike Sawley said...

Slinky, you've got the best chicken door setup I've seen, very elegant, congratulations. Like another commenter I am inspired to make a version for my hens, and was hoping you'd shoot me a copy of your sketch. Either way, thank you for showing me what's possible.