2026-04-25
Categories: Computers
So a couple months ago I made my own alarm clock. I did this partly just because I thought it would be a fun project, and also because I actually needed an alarm clock and didn't feel like buying one(buying things is lame). The project took about two months (Jan & Feb 2026) and overall I'd say the clock turned out a success. I learned a ton of stuff, had some fun, and ended up with a working alarm clock. Now that its been a while I want to share some photos of the process and how I did it.
Starting off was hard because I really had no idea what I was doing. I didn't really know anything about building hardware electronics, I didn't know how to solder, I didn't know how to design a PCB, or even what exactly I wanted. However, I stupidly still felt confident on building an alarm clock and figured I'd be able to deal with the questions & problems as they came.
So one of the most important things an alarm clock needs to do is keep the time reasonably well. I had an Arduino and had completed a few basic projects aimed at little kids. In one of the projects you build a little digital "hour glass". The project teaches you that the Arduino doesn't actually keep time very well and would drift at least several minutes over the course of the day if not more. To keep the time accurately the Arduino's ATMEGA328PU chip would need the help of an external chip that was designed for keeping the time. So the first thing I did was go to online electronics retailer and order the first few parts needed to complete the project(buying these things was totally not lame). In the order was a DS3231 real time clock chip, a proto board, and a cheap soldering iron beginner kit. With all this, it would be possible to stick the chip into a breadboard and begin building out some prototypes.
My very first attempt at soldering the DS3231 into the proto board went alright. It took some messing around with trying different iron tips and moving the temperature dial on the iron around, but eventually the solder started to stick. Before this I had watched a bunch of youtube videos on soldering which pretty much made me an expert before I even started. Once the DS3231 was in the breadboard all that was needed was some boilerplate I^2C protocol logic before I could begin interfacing with the chip to accurately read and set the time in software. Soldering in the chip was the hardest part of the prototype, the rest of prototype just involved hand wiring in buttons, a buzzer, and a little LCD display.
It immediately became obvious that the small LCD display was way too small. The alarm clock was going to need a much bigger display to be easily readable, especially to be able to read the time from across the room. Nothing online was both within my price range and in the ideal size range. So instead of using an LCD or prebuilt display I decided to build a custom display using 5mm LEDs since I already had a bunch of those.
A simple seven segment display with just four digits would require a lot of LEDS. Even just one LED per segment would require 28 LEDS. This posed several challenges. Firstly, the arduino's ATMEGA328PU chip did not have 28 pins, meaning there would need to be some more circuitry to control all those LEDs. Secondly, powering that many LEDs would require a decent bit of voltage that the chip might not be able to supply. It took quite a while to figure out how to solve these problems, but I landed on using a bit shift register along with some transistors for multiplexing. The multiplexing greatly reduces the power required since only one digit is turned on at a time, and the bit shift register handles the problem not having enough pins. It would work via a series of 4 transistors that would first select which digit to display. Then a byte would be shifted into the bit shift register to control which of the seven segments to enable for that digit. Together this would diplay just a single digit. To display all four digits, the program would loop through all four digits performing this process extremely fast, fast enough to make the display look to the human eye like all four digits are on simultaneously.
Once the circuitry was figured out, there was still the question of if the display would actually look any good. I had some transluscent polymer clay and thought it could be cool to embed the LEDS into the clay so that they could shine through. At first it seemed possible to do this by just sticking the LEDs into some cardboard and soldering each LED to wires that could be stuck into a solder board. This was a terrible idea, the cardboard was flimsy, and soldering 28x2 LED connections directly to individual wires would suck. Begrudgingly, I came to accept the idea of learning an EDA software to build my own frickin custom PCB. I was excited but also very duanted by this as I had no idea how hard this would turn out to be. After downloading easyEDA it luckly wasn't too long before I started getting the hang of it. In a couple days I had my first simple little PCB laid out. Getting it printed and shipped took a couple weeks as it had to come all the way from China.
Once it showed up, I did my first major soldering session and inserted all 28 LEDs into the display. This first soldering session was basically a failure in terms of general soldering health & safety. I soldered from my desk with a tiny little desk fan trying and failing to direct the soldering fumes out the window. It took maybe something like 30-45 mins and the next day I had quite the headache and my throat felt scratchy. I was feeling really unsure about all this soldering stuff and still am. Infact I almost gave up the project all together after that first soldering session. Something about dealing with toxic fumes isn't all that pleasant to me. However, soldering does allow you to create some cool stuff and the little display turned out to work pretty nice. All it took was molding some clay into shape and there was a nice proof of concept that this clay display could actually function as a way to tell the time.
That first PCB had broken the seal. The original plan was to not make any PCBs and just build the alarm clock on perferated solder board and just solder and wire the connections in manually. That would have taken a lot more soldering, which I was not feeling too keen on after that first experience. And because easy EDA had lived up to its name, I decided to design the rest of the alarm clock with it as well. This next PCB was much more complex, and took quite a bit longer and required learning more about how to use easyEDA. Putting up screenshots of the PCB several times on a reddit forum for review PCB designs helped tremendously. I got tons of good advice, and after several reviews from strangers on the internet I felt completely confident that the design would get the job done. I pulled the trigger and ordered the final PCB, along with all the parts it would require. Again it took a couple weeks before everything showed up.
The final soldering session went a lot better than the first but it still wasn't the most enjoyable experience. The fan had been set up in a much better position, and the soldering was done much closer to the window. It seemed like much more of the fumes were going out the window, however this soldering session ended up being a lot longer than the first given there were so many more components to solder. It was simultaneously very satisfying and nerve racking soldering each part into place. It kept feeling good that with each part the plan coming further into place, but it becamse increasingly worrying that something could be wrong that would ruin the whole design. Only until everything was put together and turned on would it be clear if the clock was working.
While prototyping with the arduino board, the process of loading programs onto the ATMEGA328PU chip was done somewhat automatically. The final clock PCB design would require boot loading the alarm clock program on to ATMEAG328PU manually. This would require some new third party library or software that I would have to write. Instead of doing that however, I just asked Claude and it pretty quickly wrote out all the Rust needed to do this. At this time Claude Code usage was being pushed very hard at my work place, and I was experiementing quite a lot with using Claude. This is one part of the project I would go back and revisit as I somewhat regret using an LLM here. Using an LLM to work on your fun educational project kinda defeats the purpose of it being a fun educational project doesn't it?
Once I had my program loaded onto the board, I watched nervously, and to my despair things were not working! The display was acting very strange and seemed like the LEDs could no longer be controlled properly. I tested and debugged, and loaded lots of experimental programs onto the board in attempt to figure out what was going wrong. Turns out I had a COM pin(which I still don't really understand its purpose) grounded when it should've been disconnected or tied to VCC. So I took my wire cutters and snipped that pin and once that was done everything was working! So the PCB had one flaw, but thankfully it was fixable. And thankfully after all that work I had a working alarm clock. Whoopieee! Oh but actually at this point it was still just a naked PCB, and needed a case so I could safely keep it one my nightstand. This last part of creating the case was tedious, but essentially I just wrapped up the PCB in wooden skewers covered in clay and the case was done.
All in all the alarm clock works pretty great. Its small, keeps the time well, is loud enough to wake me up on time, and looks pretty.
There is a few things I would change if I were to do a V2. The display is hard to make out in the direct light (its hard to read) and might do good with more LEDs or possibly a different type of LED. Also the buzzer works, but doesn't sound so great. A full on speaker would be pretty cool, but that would require quite a few more new parts. Overall though I'm happy with what I made, I had fun, and I learned alot. And now I can wake up on time which is nice.