Yes, that looks suspiciously like the countdown timer to a bomb. No, that is not a bomb. Why does everything I make look like a bomb? Anyways, my alarm clock broke so naturally I decided to build my own. I started by overengineering everything with features no human has any right having in their alarm clock. I realized I would never actually get to building the thing, so I dialed it back to the basics.
The Basics:
WARNING: Don't walk into an airport with this.
Materials:
Download the enclosure CAD files from Thingiverse. Print using your preferred 3d printer. I used a Prusa MK3S+. Recommended printer settings in the link.
Once the parts are finished printing, do whatever post processing you believe is necessary. Remove supports, sand rough edges, etc. There shouldn't be much. Use a soldering iron and needle nose pliers to place the threaded inserts in the enclosure base (part1_v1.0.stl). The Pico mount gets x4 of the M3 H8. The enclosure lid gets x4 of the M4 H10. The buzzer gets x2 of the M2 H4. The buzzer inserts can be tricky, but not impossible to place.
While the enclosure is printing, follow Installing CircuitPython to setup the Pico with the latest CircuitPython. You will need four libraries: adafruit_bus_device, adafruit_ht16k33, adafruit_datetime.mpy and adafruit_ntp.mpy. They can be found in the Library Bundle. Add these four libraries to the lib folder on the Pico's CIRCUITPY drive.
Download the project code from GitHub. Configure your settings.toml, replacing your_wifi_ssid and your_wifi_password with your wifi info. Alarm Clock 1.0 will use this info to connect to your network periodically (once a day) to sync its internal time with an external NTP server. I picked a Google NTP server because Google, but any NTP server should do. The Pico doesn't have a built-in Real-Time Clock (RTC), but instead uses the internal clock of the RP2040 to maintain time. This is less accurate than a quarts crystal. Still, at its worse, I found Alarm Clock 1.0 off by no more than a second. You want to be stupid accurate, you can add an RTC module and sync it with your local NTP server. Alarm Clock 3.0?
Mount the Pico in the PiCowbell being sure to orient the Pico such that the USB and STEMMA ports are on the same side. Mount the Pico, buzzer, LED display and USB panel mount in the enclosure base (part1_v1.0.stl). Pico and PiCowbell sandwich should be mounted with their USB and STEMMA ports facing inward. There should be just enough space to plug the USB panel mount into the Pico. This protruding connector and cable bend radius is what determined the enclosure width. A right angle USB cable might help reduce the footprint in Alarm Clock 2.0.
Mount the arcade button in the enclosure lid (part2_v1.0.stl). Why a white LED arcade button and not a red? The red LED arcade button requires 5V to drive while the white only requires 3.3V. We do have 5V over USB, but tapping into the 5V to drive the LED complicates the circuit slightly. Driving the white LED directly off the Pico GPIO works for Alarm Clock 1.0. Alarm Clock 2.0 will have a red LED.
Wire according to the below schematic. Remove the white connector from the arcade button quick connect wire pairs and strip for loose wire. This should make it easy to wire the arcade button to the PiCowbell.
Don't forget to add the little rubber bumper feet.
Place on your nightstand and plug your Alarm Clock 1.0 into power. Wait a few seconds while the Pico connects to your network and syncs with the NTP server. The LED display should display the current time according to PST and accounting for Daylight Saving. I hate Daylight Saving. Be prepared to wake up at 5:30AM everyday...enjoy.
Alarm Clock 1.0 was all about comprise to make it work...because I needed an alarm clock. Work it does. Alarm Clock 1.0 exceeds my original requirements list. Still, we can do better.
Alarm Clock 2.0 will have no compromises. Alarm Clock 2.0 will have...