After getting an Arduino and doing a few basic tutorial projects I looked to see what else I could do with this kit. I landed on could I make a little digital clock for my desk? After I looking online for inspiration and to see if it had been done before I found multiple referring to a real time clock module which I didn't have. So I had the thought, well if the code has a wait function that is supposedly accurate then I can just have a loop update a counter every second. I looked a bit more and found code online for a clock that did this function and only needed a display and a few buttons, no need for any additional parts like a counter or real-time tracker.
The buttons are for adjusting the time, one to add an hour and one to add minute for calibrating the time. I later added a switch to turn the backlight on and off. I noticed over time that the code was inconsistent and over the course of a day the clock would be off by a few minutes. I would record to difference at the end of the day and adjust the wait amount until I achieved a clock that was accurate for a month and only off by +/-5 seconds. It was essentially a P-controller before I learned about PID-controllers.
Once everything was set and mounted to my recycled shoe box shelf, I was quite satisfied at the time with what I made. The adjustment to the wait function to make it as accurate as possible was the most rewarding part of this project, seeing the time not off more than a second at the end of the week was really took a long time to figure out and I couldn't believe it when my math worked out.
Key Takeaways:
Simple Circuits
Basic Arduino Coding