This is a project to build solar/sunrise alarm clock, which uses a lamp to mimic the shade and intensity of the rising sun to more gradually and calmly rouse you from your slumber when compared to the blaring of a traditional alarm clock.
On the hardware side of things, I'm using a number of products from the Adafruit Feather and Stemma families, including a Feather M0 Wifi as the core microcontroller, some featherwings for 7-segment and OLED displays and playing audio (sometimes you want a traditional alarm clock too), as well as some NeoPixels for the lamp itself. For a full rundown, see the parts list.
For the body, I 3D modeled a case to be 3D printed to house all of the components. Visible on the front is the knob for the rotary encoder, as well as the OLED screen (black rectangle), 7-segment display (for time), three black buttons, and screwholes for mounting the electronics to the case. One the side are some holes for one of the speakers:
On the software side of things, I'm using PlatformIO to manage my libaries and toolchain, which has worked wonderfully. The Feather M0 is Arduino framework compatible, and most of the libraries provided by Adafruit for talking to the Feather/Stemma peripherals are written with Arduino in mind, so that's the framework that I ended up using (for better or for worse). Since the peripherals all already have libraries, most of the work I've done is to implement the glue connecting them, and create a UI. So far I've written a nice little tree style menuing system that you navigate using the rotary encoder, with submenus and the ability to edit values/toggle things on/off. For example, it's being used below to set the color of each channel of the RGBW LEDs when the system is acting as a static lamp.
I still have to actually implement the timekeeping functionality, as well as making the occasional Network Time Protocol request (that's what the Wifi is for) to keep the clock synced up. From there I also want to display local temperature and humitidy, both as measured by the sensor onboard, and as obtained via local weather forcast over the Internet. Beyond that, there are lots of other possibilities, including things like using the Feather M0 to serve up a webpage interface to adjust all the settings, using the speakers for actual music playback, etc.
Besides the standard fare of a soldering iron, solder, wire and wire strippers/cutters necessary for assembly, this project also uses:
- Adafruit Feather M0 Wifi
- Adafruit 128x64 OLED FeatherWing
- Adafriut 4-digit Seven segment Featherwing
- Adafruit Music Maker Featherwing w/ Amp
- Adafruit Featherwing Doubler Protoboard
- Adafruit Stemma Qt Mini GPS
- Adafruit Adafruit AHT20 Temperature & Humidity Sensor Breakout Board
- Adafruit NeoPixel Jewel RGBW (Warm)
- Adafruit 12 NeoPixel Ring RGBW (Warm)
- Adafruit I2C Stemma QT Rotary Encoder Board
- 2.1mm jack to screw terminal block
- 5V DC power supply
- USB Micro B Male Plug to 5-pin Terminal Block
- TI 74AHCT125
- STEMMA QT / Qwiic 50mm Cable x2
- STEMMA QT / Qwiic 100mm Cable
- 40mm 4 Ohm Speaker x2
- Rotary Encoder
- Feather Female Stacking Headers x2
- Feather Female Headers x2
- 470 Ohm Resistor
- 1000uF Electrolytic Capacitor
- Micro-usb cable
- SD card
The file src/secrets.h
is used to define the Wifi SSID and password, and is excluded from this repo for obvious reasons. To compile this project, you'll need to make your own, like:
#define WLAN_SSID "Network_SSID"
#define WLAN_PASS "password"