In southern Arizona we have epic sunsets. Heck, it's even our state flag!
At my house, we celebrate the sunset most days on the patio. So after taking our Intro to Electronics and Arduino class, I decided my first project would be a countdown clock to tell me how long it would be until sunset.
You are probably aware the the time of day when the sun sets varies every day. So there's some non-trivial math involved with that. Fortunately, some folks had already done the heavy lifting and shared a few libraries on the GitHub repository. My first task was the evaluate those and decide which one I could integrate with my intended Adafruit 7-segment display.
Did I mention that I don't know C++? And haven't coded in years? "Ah, how hard can it be?" I thought. There is absolutely a learning curve. The Arduino and Adafruit communities have loads of sample code and online tutorials with libraries that make it really very manageable, but you are definitely gonna learn some things.
My first iteration was on my trusty Arduino UNO and breadboard from the class. But I wanted that to be a development platform for future projects, so I bought a TINY little board called an Adafruit QT PY. It's a powerful little thing about the size of a postage stamp. I needed to add a battery backed Real-time Clock to ensure reasonably accurate timekeeping. Doing math on hours and minutes isn't a trivial thing either. Lots of head scratching. The ultimate answer was decimal hours, and then converting them to minutes for display.
Since Arduinos and LEDs go so well together, I wanted to incorporate some blinky lights as well. Enter Neopixels, the handy color LED strips that are really great to work with. So now, as the day winds down and the sky turns to orange and pinks, so does my clock!
At this point, I'm mostly software complete, and have started to migrate the project from the temporary breadboard to a protoboard with actual soldered components. (Oh, did I mention I've never soldered components before? Yay, more learning!)
After I get done soldering all those little connections, I'll be 3D printing a chassis for the electronics and making a nice wooden box to hold it all.
SUPER BIG thanks to Hans for the great class, and hardware selection advice.
If you're thinking about learning Arduino microcontroller programming and hardware, get signed up for the class at Xerocraft.
It's a rabbit hole you can have so much fun exploring!
Step 1: Case and chassis design
(It's really more like Step 4)
While I'm waiting for a new soldering iron to arrive*, I'm designing the case and chassis.
I started in Fusion 360, but I hadn't used it in probably a year, and it didn't go well. Fortunately, I'm a wiz at Sketchup, and I found an extension that lets you export STL files from Sketchup. Problem Solved!
I'll 3D print the base chassis and laser cut the front panel from frosted acrylic so the Neopixel colors will shine through.
I also found a nice piece of scrap mesquite for the case, so that should work well.
(*Seriously, do not scrimp on a soldering iron. My current one was marginal when new and now quits working without warning. ARGH!)
Step 2: Building the Chassis
The case for the clock has 4 parts, a 3D printed base with standoffs to support the protoboard and the front panels, acrylic front panels to mount the 7-segment display, a louvered back panel for ventilation, and a mesquite hardwood case.
The acrylic front panel is engraved with a view of the Catalina mountains which often turn pink from the reflection as the sun sets in the west.
During the day, the acrylic panel is lit by white LEDs.As sunset approaches, the panel turns pink like the mountains. Then overnight, it changes to a twilight purple until dawn.
Every afternoon, we can watch the clock count down to the end of the day and another sunset light show by Mother Nature.