This project is about the journey, and not the end product. With that out of the way, this project is an alarm clock built around a microcontroller, real time clock (RTC) module, Adafruit soundboard, and 4 7-segment shift registers. This is my first time designing something in the field of electronics, and I figured that this would be a manageable challenge. This involved figuring out how to pick components, design circuits, assemble schematics, build my own PCB, learn SMD and through-hole soldering, and massive amounts of coding/debugging.
From the popular game 'Portal' the "Portal Radio" is a classic in the community, and the associated musical theme that comes with it is instantly recognizable. This being said, I wanted to make my recreation of it as an alarm clock. The functionalities I wanted to include are listed below, and I want to make it look like the game prop.
As of 3/10/2024 - I may end up dropping the original theming as that is a very low priority compared to getting it working. As a lower priority item, I may go back and design a portal radio shell that this can fit in, but for now I am not concerned with that until I get the electronics working.
The following images are the designs that I first came up with. TinkerCAD is a tool that can simulate circuitry, and I think that it's a great tool to start a project. This was my proof of concept that this could work, and this gave me the confidence to move forward with creating a schematic.
Top: Clock Display Circuit
Bottom: Original brightness circuit using a 555 circuit to generate a PWM signal to turn all 7-segment displays on and off rapidly....
Then I remembered that both ESP32 and Arduino based microcontrollers have built in PWM generators
When I combined all of the components together, the circuit became so complex, and the coding became so complicated that it was pushing TinkerCAD to it's limits. Each simulated second would take roughly 15 real-life seconds, and it became difficult to test everything. I had already proven the proof of concept though, and from here I was confident enough to move onto designing the PCB.
The picture on the right contains all the logic electronics on the left part of the top breadboard. The right part of the top breadboard has 2 74HC595 8-bit shift registers to control the music board (Adafruit Audio FX Board).
A way to adjust the time and the alarm time
A way to turn the alarm on and off with an indicating LED
A snooze button that would reactivate the alarm after a set amount of time unless the alarm switch was off
A way to switch between 24 hr (military) time and 12 hour (conventional) time
If the alarm clock is in 12 hour mode, I want an LED to indicate whether "1:00" means 1 am or 1 pm
A dial of some kind that can adjust the brightness of all of the clock displays
UPDATE 6/3/23: Instead of having 7 switches to control settings, I made a navigable menu with a rotary encoder and an LCD display
4 74HC595 8-bit shift registers control the segments (top left image), giving me more control over the exact combinations of segments turned on with possible room for an idle "animation"
I originally had plans on researching and designing my own speaker amp as well as IC that can somehow take an audio file and play it, but I did some research and that ended up being difficult for my current skill level, so for now I'm using an adafruit audio board, which can store up to 16 MB of audio files, and be triggered using Software Serial from the microcontroller, and a stereo speaker set I got from 5 Below. The board and speakers will share an AUX cable, and I think that unless I want to start embarking on learning SMD electronics, this is the way to go.
As of 1/24/2023, I believe that the schematic and PCB designs are mostly complete, however I am currently at a bottleneck, and wish to test the Adafruit Audio board before sending the PCBs to be manufactured. After getting the audio board and PCB designs double checked, I plan on having the PCBs professionally manufactured, and the project will focus on being hands-on, requiring I solder the parts to the board, as well as connecting the speakers.
UPDATE 6/3/23: Now using Altium, and I have the entire circuit tested on breadboards (including the audio board)(see below)
I will note that this is probably not the cleanest looking schematic, but it is a copy of the tinkercad circuit and it works.
As for the PCB, this was my very first time routing traces, and this is as compact as I could get it for now. I have since redesigned this with SMD resistors on Altium, among other changes.
*To come soon
Picking back up around June, I made the decision to switch the main micro-controller from the Arduino Mega 2560 to the ESP32. The ESP32 is a very overpowered microcontroller for the purposes of this project, but I wanted to gain the experience of using it. Especially in my first tests I ran into a lot of issues compared to Arduino (probably because I cheaped out on chinese knock-offs). The biggest problem is that I needed to rewrite most of my code, redesign the schematic, and redesign the PCB. Additionally, the ESP32 runs on 3.3V, whereas the parts I had picked out (and already bought) run on 5V, so I found a design from Adafruit's BSS138 based logic level converter, and put it onto my schematic/pcb.
With my projects I aim to go through growing pains so that I may be more efficient in future projects. At this point in time (6/3/23), I have a fully functional circuit on breadboards, as well as having the needed schematic and footprints. From here, I just need to make all of the connections between components, before going to a PCB manufacturer to get a V1 prototyped.
From left to right:
4 7-segment displays (diodes)
4 shift registers
4 logic level shifters (3.3v -> 5V) for the shift register data pins
Top down:
Breakout for unused pins from ESP32
ESP32
Adafruit soundboard
Breakout for unused pins from soundboard
Various breakouts to various devices (rotary encoder, LCD, RTC)
Top: The PCB design I sent to JLCPCB for manufacturing, using 0805 resistors
Middle: The PCB design as of 1/14/24, using 0603 resistors
Bottom: All the parts before organizing & laying traces.
I have everything soldered on, but after a first test, it seems that I may have missed some joints, or outright killed some of the shift registers with my soldering. I'm rusty, okay??
In all seriousness, I will order some more components, and make sure to validate everything against the PCB schematic/layout once I'm able to.
Speaking of, I recently rebuilt my PC in a smaller/sleeker case (see small projects if I end up adding that?), and all was fine until my boot drive decided to die. The computer worked for about 3 hours in the new case, before the NVME SSD with my OS seemingly died, and now my motherboard won't recognize it. That drive isn't even a year old, so I'm going to see what microcenter can do about recovering some of the data, and see about getting a new one. The timing of that happening is quite irritating... I will hopefully be able to continue working on this and other projects, but I'm not quite sure just how much data I lost, and until I know my critical files (Altium files for this project, Arduino files for the code, etc) are somewhere, progress may be slowed.
I ended up choosing to use SMD resistors to save on space (to save on manufacturing cost), so this means I have to figure out how to SMD solder.
I should probably just buy my own hot air station, but I'm waiting to see if Starforge purchase's one. Either way I would have to use it there, as my bedroom does NOT have proper ventilation for soldering.
I also made a mistake in not double checking the pin diameter of the ESP32 pins, as the holes on the PCB are too small for them. To (hopefully) remedy this, I bought an $10 jewelry drill set with various bits ranging from 0.1mm to 2mm in diameter. My plan is to use these drills to make the holes larger, while not completely removing the metal contact area (to make sure the pins can make the proper connections). After doing this to a few pins, it seems like it will work, but I have about 50 pins I need to drill out per PCB (I have 5 since that is the smallest order size from JLCPCB).
I was getting sick of programming on the breadboard, as the connections were becoming less robust (after having parts in there for months and months). This meant that whenever I powered the breadboard, certain components would sort of flicker, or just not turn on at all. This pushed me to finish the PCB first before finishing the programming.
This is a remix of a project I did with my father a while back, where he and I created an infinity mirror out of a cardboard box by using one-way mirror-film. I wanted to remake this towards the end of my senior year of high school (after developing senioritis). My general idea was to make a sturdier object, as the old infinity mirror was in rather rough shape after being buried in my closet for some time. I also had an obsession with hexagons at the time, and wanted to utilize them (instead of making a plain square frame). One additional constraint I put on myself was that I disallowed the use of 3d printing, as that made it a bit too easy (for the geometries I needed).
With this, I used Inventor to plan out a design and size the pieces I needed, drove out to Home Depot, bought a 2"x4"x10' wooden plank, and got to work. I used my dad's handsaw to cut the pieces into more manageable sizes, then brought the 6 parts to my school's woodshop where I got permission to use their jigsaw and sander to get them to the exact size required to fit together.
Shortly after I consulted my engineering teacher about how she would recommend I fuse the parts together and attain a smooth finish. She recommended I simply just use wood glue to bond the pieces to a backplane, since there would be so much surface area for the glue to hold onto. Moving forward with her advice, I went back to Home Depot to buy the supplies needed to add the finishing touches, including: wood-paste, sandpaper, acrylic black paint, 4 small rubber feet, a bottle of semi-gloss poly urethane finish, and a mechanism to keep the mirror on the back without permanently sealing it.
In the end I'm super happy with how this turned out, and I got to familiarize myself with the process used for woodworking, and make something that hearkens back to a fond childhood memory.
Top: CAD model in Autodesk Inventor
Middle: Post-cutting & shaping
Bottom: post sanding/painting
By the time I finished this project, it was the end of my senior year of high school. I felt like it would make a fun memento if I got my 12 closest friends to sign the edges of the mirror (each of the 6 sides are subdivided). The final assembly & polishing was finished within a week post-graduation.
One of the first independent projects my dad and I worked on together was an infinity mirror back in 2016. The original infinity mirror used a cardboard box, an LED strip, and a section of one-way mirror film (images on this page). Jumping forward to Senior year of HS, my classes spared me a lot of free time, and I was thinking of a project to work on. Instead of the usual 3d printed projects I wanted to challenge myself and intentionally not use the printer, as I thought it would have been too easy otherwise. Without using the printer, the choice of material to me seemed to obviously be wood.
This and the image on the right are from the V1, original 2016 infinity mirror that my father and I made together.
The LEDs still work, but evidently something is misaligned, whether it's the walls, the mirror, or the LEDs not sticking to the sides of the box.