Alarm Clock
Hardware- 6 Devlogs
- 4 Total hours
I'm building a clock for my desk using an ESP32 C3 mini, a 2.8 inch screen for nicer UI, and mechanical keyswitches.
I'm building a clock for my desk using an ESP32 C3 mini, a 2.8 inch screen for nicer UI, and mechanical keyswitches.
I now have all parts and firmware, and everything is in the GitHub. The total cost of all parts in the BOM is $39.91 after sales but not including shipping or taxes. With that, it will probably be a little more than $50. The actual cost of everything (no sales) is $51.05. I didn’t include the 4 screws and nuts because they are optional. The screen will fit as a pressfit in the enclosure, but there are screw holes in case a user wants it more secure. I will be adding screws because I already have some M3s so I might as well. For assembly, I will 3D print the enclosure. I’ll put the switches in the top and then start soldering wires and connecting everything on the perfboard. I’ll use heatshrink for the pins of the keyswitches to make sure they don’t short each other. I don’t have a heat gun so I’ll either use a match/lighter or a hair dryer.
I did more coding. I decided to change how I want to have the screen work and how it should be organized, so I started working on that. I also made sure the wifi ssid and password use placeholders and not my real ssid and password because I don’t really want those on GitHub for the whole world to see. I also wrote out a description of how the clock should work so I can come back and continue later without forgetting what I was trying for. I changed the firmware so I think I only need alarm-clock.ino instead of a bunch of other files too. This is the new firmware folder.
I did more CAD. I was taking screenshots to put on the GitHub when I realized there was no way to access the inside to put the parts in the first place. I just separated the back panel. It’s not an particularly elegant solution, but I think its good. I also updated the README in the GitHub. Next, I’ll make the BOM.
I wrote the firmware. It took a bit of figuring out to get started but I think it’s good now. There is a home and an alarm page. The left button decreases time for the alarm and the right button increases it. The middle button is like a mode button, so on the home page pressing it takes you to the alarm page. Then pressing it changes the focus from editing the hour to editing the minute, then back home. I’m not sure I’ll keep this structure but it’s what I thought of first so I made it.
The CAD is now done. I gave the clock a bit of an angle and added screws and nuts to the CAD. I think the angle is good because it will make it easier to read while I’m sitting at my desk or lying in bed. The final design uses 3 switches, a piezo buzzer, 4 M410mm screws and 4 nuts, an ESP32 C3 mini, a 2.8 inch ILI9341 LCD screen, a 70mm50mm perfboard, pin headers, and jumper wires, along with a USBC cable. For firmware, I’ll use wifi time so I don’t have to set the time. I’ll also add a place for it to show the current weather from openmeteo. There will be an alarm, a timer, and a stopwatch. The screen is touch sensitive so I can add functionality for that later. For now, though, the middle key will be snooze when an alarm is going off. Otherwise, it will switch modes (home, full weather forecast, alarm, timer, stopwatch. The left and right buttons will help change the time for the timer and alarm. I may also add a web-based dashboard to set things from my computer.
I chose the parts that I’m going to use, made a schematic, and did most of the CAD. I’m going to use an ESP32 C3 mini, a passive piezo buzzer, a 2.8” ILI9341 LCD, cherry mx style switches with keycaps, and a 100 ohm resistor, along with perfboards. I chose to go with perfboards instead of a PCB because it will be faster, and I think its better because I’m going to be wiring the switches and screen anyway, so there’s no point in paying and waiting for a PCB just to hold the ESP32 and the buzzer. I also did most of the CAD. I might go back and make it look a bit better but I think its fine as is. The only changes I think I may make are closing the sides and giving the screen a bit of an angle.