Friday, April 1, 2016

Hello World! (Dog feeding timer)

This will be my very first blog post ever, so exciting! To celebrate my very first blog post ever I will present you with my very first Arduino project ever! So grab yourself a glass of wine, some wires, and sit on back!

The problem: my roommate and I have a dog (Illyah) that we both take care of. Frequently we would either both feed the dog, or neither of us.
The solution: a timer that resets when the dog is fed.



I don't quite remember all the steps I took to build this project (it several months ago), but I’ll give you the best breakdown I can! This project was very basic, originally I built in on a Uno, but when my nano arrived I switched it over to that.

Wiring:

The code is the most fun part of this project for me. Originally I had the LED flashing quite long and simply (which is probably fine for your application). However, in our little flat the LED would flash so brightly I could see it in my room and it would keep me up at night! So this code is designed with that in mind.

Code

The simplest way for me to write this function was to pull on the Arduino’s integrated millisecond counter and converts it to hours. When we feed Illyah we reset the board.  The flashing LED uses the hours to determines how frequently to flash. When the timer is first reset the green LED flashes so rarely that you probably won’t see it unless you stare at the setup. Then, after eight hours, the flashing switches to yellow and flashes more frequently and stays on slightly longer, although the duration of the flash is still quite insignificant at this point. Finally, once twelve hours has passed, the buzzer sounds, the color switches to red, and LED flashing and duration increase. As hours pass after the twelve hour mark, the light and buzzer become incessant to remind you to feed the dog. And, viola! Never forget to feed the dog again!

No comments:

Post a Comment