Giter Site home page Giter Site logo

edbartley / arduinochickendoor Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 21 KB

This is the code for an arduino to control the opening and closing of a chicken door at sunrise and sunset, respectively. Hint: we don't need no stinking photosensor.

License: MIT License

C++ 100.00%

arduinochickendoor's Introduction

ArduinoChickenDoor

This is the code for an arduino to control the opening and closing of a chicken door at sunrise and sunset, respectively. Hint: we don't need no stinking photosensor.

Hardware Configuration: Arduino Uno RTC3231 Real Time Clock with Battery Backup from DIYMORE HiLetgo DC 12V 2 Channel Relay Module pn 3-01-0342 Add-A-Motor - Chicken Coop Automatic Door Motor - Model D20

After uploading the code to your arduino you must send an 'r' over the terminal to initialize the RTC to the DATE TIME of your compile. So send the 'r' right away or your RTC will be off. The code awkwardly converts the time to UTC and uses that time to compute the time of sunrise and sunset. Different locals use DST and some don't. Knowing if you are in a DST observent local is not my thing so you'll need to adjust the code accordingly. It's easy. If you're in a local that does not observe DST then make checkIfDST() always return false and you're done.

Terminal commands: 't' reports the current time, what time the door is scheduled to close, and what time the door is scheduled to open.

'b' sumulates a button press to manually open/close the door.

'r' initialize the RTC to the DATE TIME of your compile.

's' report the current state of the door: "closed", "open", "closing", "opening".

Fault Tolerance There is some basic fault tolerance built in. When the door changes state we write that state to the available memory on the RTC chip. This only works as long as the battery backup is working on the RTC.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.