Smart Alarm Clock
Using ESP32 you can have your own alarm clock that is controllable via the web!
Created by
mavory
Tier 4
3 views
0 followers
mavory
submitted Smart Alarm Clock for review ago
1Mon ⚡
requested changes for Smart Alarm Clock ago
really impressive project! please make sure your BOM.csv includes the prices for all of the parts you are buying! additionally please read through https://blueprint.hackclub.com/about/submission-guidelines to ensure your project is good to resubmit!
Tier: 4
Tanuki ⚡🚀
submitted Smart Alarm Clock for review ago
mavory
submitted Smart Alarm Clock for review ago
Iamalive 🚀
requested changes for Smart Alarm Clock ago
Hey! Great work, you have awesome journals :) It looks like you're not asking for a grant? I see you have a bom.csv... Just resubmit and explain in the note to reviewer!
mavory
submitted Smart Alarm Clock for review ago
mavory
added to the journal ago
SMART ALARM CLOCK IS DONE!!
Using ESP32 you can have your own alarm clock that is controllable via the web!
Why did I do this?
I was always late or needed some encouragement! So I created SAC, which is web-controlled and very compact and minimalist. Now I can adjust my alarm clock via the web on my PC while I'm in the kitchen (for example).
Features
- Web interface
- You can edit alarms via the web
- You see diagnostics on the display
- Day/night mode
Scripts
It's the only script you need and it's about 460 lines long! It contains everything from libraries to the website.
Just edit the WiFi and password on line 237 and you can upload it straight to the ESP32 and everything should work.
Home page:

How it works?
On the website you choose what you need, for example, you create a one-day alarm clock with vibration and buzzer for 21:30. At 21:30 your alarm will start and you can turn it off using the button on the website or via the button directly on the alarm clock.
Also, if you press the button twice, you will see all current alarms on the display and if you hold the button, you will get to the diagnostics, where you can see all important information!
Libraries:
- Arduino.h
- WiFi.h
- ESPAsyncWebServer.h
- AsyncTCP.h
- Adafruit_NeoPixel.h
- LittleFS.h
- SD.h
- SPI.h
- Wire.h
- Adafruit_GFX.h
- Adafruit_SSD1306.h
- RtcDS1302.h
- ThreeWire.h
- OneButton.h
- time.h
3D models
Here is a view of the top and bottom of the case:


Wiring Diagram

BOM (Bill of Materials)
| Item | Quantity | Price | Link |
|---|---|---|---|
| ESP32 | 1 | $5.43 | Buy |
| OLED display | 1 | $1.44 | Buy |
| SD card module | 1 | $0.56 | Buy |
| Breadboard | 1 | $2.56 | Buy |
| Vibration motor | 1 | $0.8 | Buy |
| Buzzer | 1 | $1.28 | Buy |
| Jumpers | Much | $4.73 | Buy |
| Button | 1 | $.2.02 | Buy |
| RTC modul | 1 | $1.78 | Buy |
| Shipping to CZ | / | $3.96 | / |
There is the final video of how it works!!
Here is a youtube video where you can see how it works: Link

mavory
added to the journal ago
GitHub editing
When I was done, I started editing the GitHub repo. I exported everything one by one and later uploaded everything to the aforementioned repo.
It took me about half an hour in total, because I always have to convert .STL to .STEP and also always find out where my schematic is saved...
Later, I started writing README.md, Journal.md, Info.md... That probably took me the most time, because it was quite difficult and then I had to edit it a few times anyway. When I had it, I saved everything and made a video of how everything works.

mavory
added to the journal ago
Circuit diagram is finished!
So when I had everything ready, I started connecting things to the ESP32.
At first I had to look at the code because I couldn't remember the pins where the components were connected, but as I got closer to the end, I started to remember...
After about 0.8 hours I had everything finished and I rendered it all and uploaded it straight to GitHub!

Here is the link to download the PDF: ESP32
mavory
added to the journal ago
Circuit diagram
When I finished the overall wiring and the 3D case, I started making a circuit diagram in KiCad.
It took me quite a while because I had been doing it for a long time, but then I remembered how to do some things.
I gradually added various devices and connected them to the ESP32. The photosensor was probably the most difficult for me because I couldn't find the exact module for it, but after some time I found it. Later I added a 10K resistor to it and slowly everything was done.

mavory
added to the journal ago
The case is finally closed!
After a long time, I finally finished the case!
Everything works very well and so sjem decided to glue the upper part to the lower one - but it wasn't that easy.
First I had to bend the cables to the photosensor and buzzer so that the jumpers wouldn't fall out, and even then it happened a few times, so it took me a while.
I also had to rewire the buzzer on the breadboard a little, but everything else is great! When I had it, I finished the last things and closed it (I just stretched it with tape to test it...)
Everything worked, but suddenly the buzzer didn't work on the second try, so I wondered why, but when I opened the case, a wire just fell out, so I said, goooood.
So when I made the 4th try, everything worked beautifully and I was happy. So I closed the case with glue and could continue with the circuit diagram!!
Cable connection:

Closed case:

mavory
added to the journal ago
Placing things in the top of the 3D case
When I finished the cosmetic adjustments, I moved on to putting things in the top of the 3D case!
- First I started with the buzzer, which held there beautifully and didn't need glue.
- Then I added a button that needed a very small amount of glue so that it wouldn't fall off when I pressed it...
- I also put a photosensor in the hole, but that one went worse - the hole was about 1mm too small (even though I measured it correctly, so there's still a gap there), but then I put it in there and connected the wires.
- Last I put the OLED in the top, which I didn't want to glue, so I decided to stick it with electrical tape and everything worked beautifully!
So when I had everything ready, I had to wait for a while for everything to dry and in the meantime I did a few things in KiCad (but that's a later topic)
.jpg)
mavory
added to the journal ago
Cosmetic treatment for 3D case
After printing everything, I prepared things for gluing, editing, etc. 3D case.
At the beginning, I also prepared a buzzer and a photosensor to connect to the jumpers so that they could be inserted into the case! I also adjusted the cables so that everything fit well and something didn't fall out right away...
Next, I took a knife and cut off the edges that were sticking out and generally sanded the surface of the 3D case a little!

mavory
added to the journal ago
Code editing!
While I was waiting for the upper part of the 3D case, I decided to finish the code to make it more stable.
I also edited the labels to make it a little easier to understand. Before, the photosensor didn't work very well for me, sometimes after a reset the ESP32 worked and sometimes it took a break... So I rewrote some more and it works beautifully!

mavory
added to the journal ago
Making a top cover for a 3D case
Right after measuring, sjem moved back to TinkerCad and continued modeling the top cover, which was important to make as accurate as possible.
I placed holes on the top for the OLED, buzzer, photosensor, and button.
Everything has a little gap, so everything should fit well!
(I also created a 3D model of the button that will be glued to the switch)
Overall view of the 3D model:

Top view:

Hopefully everything will work out and I will be able to move on!
mavory
added to the journal ago
Printing and measuring
In the meantime, I started measuring all the components that I would place on the top.
I started with the OLED display and gradually continued with the photosensor, button,....
The hardest part was probably figuring out the right dimensions for the displays so that everything would fit and work.

mavory
added to the journal ago
Making a 3D case!!
After finishing the code, I started working on the 3D case, which is very important to print well. I do everything in Tinkercad, because I find it to be the lightest and free program running on the web, so I liked it a while ago.
At first, I started making the bottom part, which has dimensions of 174x64 (the walls have a size of +- 2mm). When I had the bottom part, I later moved to the top part, which will be heavier, mainly because of the components that will be there.
Bottom part:

mavory
added to the journal ago
The code is done!!
After the website was finished, sjem started to redo the code to make it modern and have all the features!
Home screen:
- You can see the date
- You can see the exact time
- Signaling if you are connected to WiFi
- Day mode or night mode
Diagnostics:
- IP address
- RAM
- How long the system has been running
- How many times has the alarm been set
Alarm page:
- You can see all your set alarms
mavory
added to the journal ago
Web interface
After a few hours I finished the web interface. I completely redesigned it because it looked like space at first and wasn't black and white - Now it's modern and minimalist with elements and buttons to control the alarm clock!
Here is an older version:

Here is the new modern version!!

In the new version there are:
- buttons for testing the vibration motor, turning off the OLED, adding a new alarm (you can choose if you want a buzzer or a vibration motor)
- I can also see how much space is left on the SD card
- I can see the temperature of the ESP32
mavory
added to the journal ago
Rewriting the code but without the speaker
When I recovered from everything, I started to redo the code so that it would work even without a speaker. I redid all the pins to make it as easy as possible and started coding. I had to start all over again...
The website was completely redesigned into a space theme, but I might change it. I was more bothered by the fact that the ArduinoJSON library didn't work for me, so after about an hour I immediately put it away and continued without it.

mavory
added to the journal ago
ONE BIG MISTAKE
When I had the code ready, I could move on to connecting the Speaker to the ESP32, I added another 10uF capacitor there to cover the noise, I also connected a 100uF to the power supply... So when I changed the code and uploaded it to the ESP32, unfortunately it didn't work at first, I don't know why, it just made noise.
I tried editing the code, playing music only on the bits that the ESP32 reads,.. and nothing. So I spent a lot of time just testing if it works and probably doesn't work. So I removed it from the whole project.

mavory
added to the journal ago
Continuing coding
I thought everything would go quickly, but as soon as I started coding, I was looking for a library that would be good for Bluetooth, I couldn't find the one I wanted, but after some time I found it: BluetoothA2DPSink.h.
It worked well and I was able to connect my phone to the ESP32, but I had one big problem... The antenna can only handle Bluetooth or WiFi, so I came up with a brilliant solution that when Bluetooth is turned on, WiFi stays in "standby mode" and waits.
Everything worked and I was able to connect the speaker later.

mavory
added to the journal ago
MicroSD card works!
When my SD card didn't work, I decided to put it in my computer again and suddenly it showed nothing, I formatted the card, I don't know why... So I put it on FAT32 so that the ESP32 could read it and upload the files important for the next code there.
I started to redo the errors in my code that had been bothering me so far and I made a function to always tell me if the SD card was fine.
I connected everything and it worked, the website didn't look very nice, but I didn't bother with that yet, because I knew that more important things were waiting for me.

mavory
added to the journal ago
Start of coding
After successful soldering, I quickly moved on to writing the code. I had never written any code before and I was wondering how I would make the speaker work and everything together.
At first, I came up with the code when I would not use the speaker yet and later I would put it there. I was more confused about the functionality of the MicroSD card module, which always blubbed 💀 - today too... When I uploaded the code, writing to the card did not work for me and I also did not know why, the website did not work.

mavory
added to the journal ago
Soldering
Since I had just bought an amplifier and a speaker, I had to connect them somehow first. I thought I would do it easily - I would use a pin strip, but it wasn't that easy. The holes were too close together, so I thought I could put it in a breadboard and it wasn't...
So I decided to solder it with wires. I first prepared the wires for powering the amplifier itself and when I had them, I also soldered the speaker.

mavory
added to the journal ago
Component testing!
When I had it connected, I started testing each thing one by one on short codes, because I hadn't worked with a few things yet. At first, the display didn't work, so I wondered why...
After a while, I found out that it was the code, so I was relieved and I thought about whether I should still use the breadboard power supply, but I decided not to use it. When I had everything ready and tested, I moved on to soldering.

mavory
added to the journal ago
Connecting the components :)
At first I was wondering if I should use a smaller breadboard or a bigger one. I decided to go for the bigger one so that I wouldn't get lost later.
First I started connecting the cables to the components and later I connected them to the breadboard, unfortunately I don't have female to female, so I had to use the 2x more cables method again...

mavory
added to the journal ago
The beginning of my project!!
I was thinking about what to create and suddenly it occurred to me that I could create a SMART ALARM CLOCK! It would have:
- ESP32
- RTC Module
- OLED display (128x64)
- Passive buzzer
- Photosensor
- Vibration motor
- Button
- MicroSD card adapter
- Speaker
Everything would work via the web, where sounds could be recorded, e.g. buzzer, vib. motor and so on could be turned off.
Also, the clock would always connect to WiFi at 3:00 local time and adjust the time!

mavory
started Smart Alarm Clock ago
1/10/2026 12 PM - The beginning of my project!!
I was thinking about what to create and suddenly it occurred to me that I could create a SMART ALARM CLOCK! It would have:
- ESP32
- RTC Module
- OLED display (128x64)
- Passive buzzer
- Photosensor
- Vibration motor
- Button
- MicroSD card adapter
- Speaker
Everything would work via the web, where sounds could be recorded, e.g. buzzer, vib. motor and so on could be turned off.
Also, the clock would always connect to WiFi at 3:00 local time and adjust the time!
1/10/2026 10:40 PM - Connecting the components :)
At first I was wondering if I should use a smaller breadboard or a bigger one. I decided to go for the bigger one so that I wouldn't get lost later.
First I started connecting the cables to the components and later I connected them to the breadboard, unfortunately I don't have female to female, so I had to use the 2x more cables method again...

1/10/2026 10:46 PM - Component testing!
When I had it connected, I started testing each thing one by one on short codes, because I hadn't worked with a few things yet. At first, the display didn't work, so I wondered why...
After a while, I found out that it was the code, so I was relieved and I thought about whether I should still use the breadboard power supply, but I decided not to use it. When I had everything ready and tested, I moved on to soldering.

1/10/2026 10:52 PM - Soldering
Since I had just bought an amplifier and a speaker, I had to connect them somehow first. I thought I would do it easily - I would use a pin strip, but it wasn't that easy. The holes were too close together, so I thought I could put it in a breadboard and it wasn't...
So I decided to solder it with wires. I first prepared the wires for powering the amplifier itself and when I had them, I also soldered the speaker.

1/10/2026 11:07 PM - Start of coding
After successful soldering, I quickly moved on to writing the code. I had never written any code before and I was wondering how I would make the speaker work and everything together.
At first, I came up with the code when I would not use the speaker yet and later I would put it there. I was more confused about the functionality of the MicroSD card module, which always blubbed 💀 - today too... When I uploaded the code, writing to the card did not work for me and I also did not know why, the website did not work.

1/10/2026 11:36 PM - MicroSD card works!
When my SD card didn't work, I decided to put it in my computer again and suddenly it showed nothing, I formatted the card, I don't know why... So I put it on FAT32 so that the ESP32 could read it and upload the files important for the next code there.
I started to redo the errors in my code that had been bothering me so far and I made a function to always tell me if the SD card was fine.
I connected everything and it worked, the website didn't look very nice, but I didn't bother with that yet, because I knew that more important things were waiting for me.

1/10/2026 11:53 PM - Continuing coding
I thought everything would go quickly, but as soon as I started coding, I was looking for a library that would be good for Bluetooth, I couldn't find the one I wanted, but after some time I found it: BluetoothA2DPSink.h.
It worked well and I was able to connect my phone to the ESP32, but I had one big problem... The antenna can only handle Bluetooth or WiFi, so I came up with a brilliant solution that when Bluetooth is turned on, WiFi stays in "standby mode" and waits.
Everything worked and I was able to connect the speaker later.

1/11/2026 11 AM - ONE BIG MISTAKE
When I had the code ready, I could move on to connecting the Speaker to the ESP32, I added another 10uF capacitor there to cover the noise, I also connected a 100uF to the power supply... So when I changed the code and uploaded it to the ESP32, unfortunately it didn't work at first, I don't know why, it just made noise.
I tried editing the code, playing music only on the bits that the ESP32 reads,.. and nothing. So I spent a lot of time just testing if it works and probably doesn't work. So I removed it from the whole project.

1/11/2026 4 PM - Rewriting the code but without the speaker
When I recovered from everything, I started to redo the code so that it would work even without a speaker. I redid all the pins to make it as easy as possible and started coding. I had to start all over again...
The website was completely redesigned into a space theme, but I might change it. I was more bothered by the fact that the ArduinoJSON library didn't work for me, so after about an hour I immediately put it away and continued without it.

1/12/2026 7 PM - Web interface
After a few hours I finished the web interface. I completely redesigned it because it looked like space at first and wasn't black and white - Now it's modern and minimalist with elements and buttons to control the alarm clock!
Here is an older version:

Here is the new modern version!!

In the new version there are:
- buttons for testing the vibration motor, turning off the OLED, adding a new alarm (you can choose if you want a buzzer or a vibration motor)
- I can also see how much space is left on the SD card
- I can see the temperature of the ESP32
1/12/2026 8 PM - The code is done!!
After the website was finished, sjem started to redo the code to make it modern and have all the features!
Home screen:
- You can see the date
- You can see the exact time
- Signaling if you are connected to WiFi
- Day mode or night mode
Diagnostics:
- IP address
- RAM
- How long the system has been running
- How many times has the alarm been set
Alarm page:
- You can see all your set alarms
1/16/2026 6 PM - Making a 3D case!!
After finishing the code, I started working on the 3D case, which is very important to print well. I do everything in Tinkercad, because I find it to be the lightest and free program running on the web, so I liked it a while ago.
At first, I started making the bottom part, which has dimensions of 174x64 (the walls have a size of +- 2mm). When I had the bottom part, I later moved to the top part, which will be heavier, mainly because of the components that will be there.
Bottom part:

1/16/2026 7:29 PM - Printing and measuring
In the meantime, I started measuring all the components that I would place on the top.
I started with the OLED display and gradually continued with the photosensor, button,....
The hardest part was probably figuring out the right dimensions for the displays so that everything would fit and work.

1/16/2026 7:45 PM - Making a top cover for a 3D case
Right after measuring, sjem moved back to TinkerCad and continued modeling the top cover, which was important to make as accurate as possible.
I placed holes on the top for the OLED, buzzer, photosensor, and button.
Everything has a little gap, so everything should fit well!
(I also created a 3D model of the button that will be glued to the switch)
Overall view of the 3D model:

Top view:

Hopefully everything will work out and I will be able to move on!
1/16/2026 9 PM - Code editing!
While I was waiting for the upper part of the 3D case, I decided to finish the code to make it more stable.
I also edited the labels to make it a little easier to understand. Before, the photosensor didn't work very well for me, sometimes after a reset the ESP32 worked and sometimes it took a break... So I rewrote some more and it works beautifully!

1/16/2026 10:36 PM - Cosmetic treatment for 3D case
After printing everything, I prepared things for gluing, editing, etc. 3D case.
At the beginning, I also prepared a buzzer and a photosensor to connect to the jumpers so that they could be inserted into the case! I also adjusted the cables so that everything fit well and something didn't fall out right away...
Next, I took a knife and cut off the edges that were sticking out and generally sanded the surface of the 3D case a little!

1/16/2026 10:48 PM - Placing things in the top of the 3D case
When I finished the cosmetic adjustments, I moved on to putting things in the top of the 3D case!
- First I started with the buzzer, which held there beautifully and didn't need glue.
- Then I added a button that needed a very small amount of glue so that it wouldn't fall off when I pressed it...
- I also put a photosensor in the hole, but that one went worse - the hole was about 1mm too small (even though I measured it correctly, so there's still a gap there), but then I put it in there and connected the wires.
- Last I put the OLED in the top, which I didn't want to glue, so I decided to stick it with electrical tape and everything worked beautifully!
So when I had everything ready, I had to wait for a while for everything to dry and in the meantime I did a few things in KiCad (but that's a later topic)
.jpg)
1/16/2026 11 PM - The case is finally closed!
After a long time, I finally finished the case!
Everything works very well and so sjem decided to glue the upper part to the lower one - but it wasn't that easy.
First I had to bend the cables to the photosensor and buzzer so that the jumpers wouldn't fall out, and even then it happened a few times, so it took me a while.
I also had to rewire the buzzer on the breadboard a little, but everything else is great! When I had it, I finished the last things and closed it (I just stretched it with tape to test it...)
Everything worked, but suddenly the buzzer didn't work on the second try, so I wondered why, but when I opened the case, a wire just fell out, so I said, goooood.
So when I made the 4th try, everything worked beautifully and I was happy. So I closed the case with glue and could continue with the circuit diagram!!
Cable connection:

Closed case:

1/17/2026 3:28 PM - Circuit diagram
When I finished the overall wiring and the 3D case, I started making a circuit diagram in KiCad.
It took me quite a while because I had been doing it for a long time, but then I remembered how to do some things.
I gradually added various devices and connected them to the ESP32. The photosensor was probably the most difficult for me because I couldn't find the exact module for it, but after some time I found it. Later I added a 10K resistor to it and slowly everything was done.

1/17/2026 3:38 PM - Circuit diagram is finished!
So when I had everything ready, I started connecting things to the ESP32.
At first I had to look at the code because I couldn't remember the pins where the components were connected, but as I got closer to the end, I started to remember...
After about 0.8 hours I had everything finished and I rendered it all and uploaded it straight to GitHub!

Here is the link to download the PDF: ESP32
1/17/2026 4 PM - GitHub editing
When I was done, I started editing the GitHub repo. I exported everything one by one and later uploaded everything to the aforementioned repo.
It took me about half an hour in total, because I always have to convert .STL to .STEP and also always find out where my schematic is saved...
Later, I started writing README.md, Journal.md, Info.md... That probably took me the most time, because it was quite difficult and then I had to edit it a few times anyway. When I had it, I saved everything and made a video of how everything works.

1/17/2026 5 PM - SMART ALARM CLOCK IS DONE!!
Using ESP32 you can have your own alarm clock that is controllable via the web!
Why did I do this?
I was always late or needed some encouragement! So I created SAC, which is web-controlled and very compact and minimalist. Now I can adjust my alarm clock via the web on my PC while I'm in the kitchen (for example).
Features
- Web interface
- You can edit alarms via the web
- You see diagnostics on the display
- Day/night mode
Scripts
It's the only script you need and it's about 460 lines long! It contains everything from libraries to the website.
Just edit the WiFi and password on line 237 and you can upload it straight to the ESP32 and everything should work.
Home page:

How it works?
On the website you choose what you need, for example, you create a one-day alarm clock with vibration and buzzer for 21:30. At 21:30 your alarm will start and you can turn it off using the button on the website or via the button directly on the alarm clock.
Also, if you press the button twice, you will see all current alarms on the display and if you hold the button, you will get to the diagnostics, where you can see all important information!
Libraries:
- Arduino.h
- WiFi.h
- ESPAsyncWebServer.h
- AsyncTCP.h
- Adafruit_NeoPixel.h
- LittleFS.h
- SD.h
- SPI.h
- Wire.h
- Adafruit_GFX.h
- Adafruit_SSD1306.h
- RtcDS1302.h
- ThreeWire.h
- OneButton.h
- time.h
3D models
Here is a view of the top and bottom of the case:


Wiring Diagram

BOM (Bill of Materials)
| Item | Quantity | Price | Link |
|---|---|---|---|
| ESP32 | 1 | $5.43 | Buy |
| OLED display | 1 | $1.44 | Buy |
| SD card module | 1 | $0.56 | Buy |
| Breadboard | 1 | $2.56 | Buy |
| Vibration motor | 1 | $0.8 | Buy |
| Buzzer | 1 | $1.28 | Buy |
| Jumpers | Much | $4.73 | Buy |
| Button | 1 | $.2.02 | Buy |
| RTC modul | 1 | $1.78 | Buy |
| Shipping to CZ | / | $3.96 | / |
There is the final video of how it works!!
Here is a youtube video where you can see how it works: Link