Light Alarm โ€” project presentation slide

About the Project

Sleep has always been something I struggle with. Falling asleep rarely happens naturally for me, and most nights I find myself lying awake while my mind keeps racing. I noticed that the environment around me โ€” especially harsh lighting and the habit of using my phone late at night โ€” makes it even harder for my body to slow down and prepare for rest.

Because of this personal struggle, I wanted my final project to focus on creating something that could gently support a healthier nighttime routine. The smart nightstand lamp helps the body gradually transition between wakefulness and sleep, working in harmony with the body's circadian rhythm instead of fighting it. Rather than relying on sudden darkness at night or an abrupt alarm in the morning, the lamp simulates a sunset at bedtime and a sunrise at wake-up โ€” both scheduled automatically through a companion mobile app.

Prior Art โ€” Who Has Done Similar Work?

Commercial

Philips SmartSleep Wake-up Light

A sunrise alarm lamp that gradually brightens over 30 minutes before the set wake time. Uses fixed, closed firmware with no customizable sunset simulation or Wi-Fi connectivity.

Commercial

Casper Glow Light

A Wi-Fi connected bedside lamp with gentle dimming and sunrise features. Limited to a companion app without physical toggle control or DIY customization.

My project differentiates itself by being entirely self-fabricated โ€” from the PCB milled at the lab to the 3D-printed enclosure โ€” and by using a physical toggle switch as the primary mode selector rather than relying exclusively on a phone.

How It Works

The lamp is operated by a single physical toggle switch, which selects between two modes. Toggling it once activates the Smart Light Alarm Mode. Toggling it off and back on switches into Manual Mode. The Blynk mobile app is used to set schedules and adjust brightness, depending on the active mode.

๐ŸŒ™

Night Mode โ€” Wind Down

  • Lamp slowly dims as bedtime approaches
  • Produces a warm sunset light effect
  • Fades completely to off, encouraging natural sleep onset
  • Schedule set via app โ€” brightness & color locked in this mode
๐ŸŒ…

Morning Mode โ€” Wake Up

  • Light gradually increases from zero to full brightness
  • Simulates a gentle sunrise instead of a harsh alarm
  • Helps the user wake up naturally and calmly
  • Runs automatically every day at the scheduled wake time
๐Ÿ”ฆ

Manual Mode

  • โ†’Toggle switch off then on again to activate
  • โ†’Light turns on instantly at full brightness
  • โ†’Full brightness control from the app
  • โ†’Daily schedule is paused in this mode
๐Ÿ“ฑ

App Control (Blynk)

  • โ†’Set sleep time and wake-up time
  • โ†’Adjust brightness slider in manual mode
  • โ†’Communicates via Wi-Fi (ESP32-C3)
  • โ†’Dashboard built on Blynk IoT platform

Project Specifications

Category

Smart Wellness Device

Input

Toggled switch (two modes) + Blynk mobile app (schedule & brightness)

Output

WS2812B addressable LED strip

Microcontroller

Seeed Studio XIAO ESP32-C3

Fabrication

3D Printing ยท Laser Cutting ยท PCB Milling

Connectivity

Wi-Fi (Blynk IoT platform)

Phase 1 ยท 2D & 3D Design

Concept & CAD Design

I used computer-aided design to take the lamp to a manufacturable form. Fusion 360 was used for full 3D modeling of the assembly, and AutoCAD was used to prepare the 2D panel layout for laser cutting.

Light Alarm 3D CAD assembly in Fusion 360
Fusion 360 โ€” full 3D CAD assembly
3D printed box enclosure and spherical diffuser โ€” exploded view
3D-printed enclosure & diffuser โ€” exploded view
2D laser-cut layout for box enclosure
AutoCAD โ€” 2D panel layout for laser cutting
Design decisions: The enclosure uses 2 mm acrylic panels held together with 6 mm and 10 mm threaded rods and locking nuts โ€” allowing the structure to be disassembled for maintenance. The spherical diffuser on top is 3D-printed in a white translucent PLA to soften and scatter the LED light evenly.
Phase 2 ยท Electronics Design & PCB Fabrication

Electronics Design & PCB

Before committing to a custom board, I prototyped and validated the circuit on a breadboard. Once the logic was confirmed, I designed a dedicated single-layer PCB in KiCad.

Components on the schematic: Seeed Studio XIAO ESP32-C3 ยท 330 ฮฉ resistor (LED signal protection) ยท 1000 ยตF capacitor (power decoupling) ยท 2ร— screw terminals (LED strip & toggle switch connections)
KiCad schematic design
KiCad โ€” final schematic with component connections
KiCad PCB editor layout
KiCad โ€” PCB layout routed and ready for milling

PCB Fabrication โ€” CNC Milling

The PCB was fabricated using a DGshape by Roland CNC milling machine. The workflow: export the board from KiCad as SVG with the copper layer selected โ†’ import into Inkscape to convert to a high-resolution bitmap โ†’ load into Dr. Engraver Plus to generate G-code for the mill.

LED strip mounted inside enclosure
Export the PCB as SVG
Enclosure panels assembled
Convert to Bitmap
Internal wiring and PCB placement
Generate G-code
The Roland CNC milling machine
The Roland DGshape CNC milling machine
CNC milling the copper traces
Milling the copper traces on the board
Completed PCB after milling
Completed PCB โ€” traces and outline cut
PCB after soldering components
PCB after soldering all components
Phase 3 ยท Embedded Programming

Embedded Programming

The firmware was written in Arduino IDE and flashed to the XIAO ESP32-C3. The microcontroller connects to Wi-Fi and communicates with the Blynk IoT platform, where the user's schedule and brightness settings are stored and pushed to the device in real time.

Project architecture diagram
System architecture โ€” hardware, firmware, and app layers (AI-assisted overview)
Scheduled Mode: Flip the switch once. The ESP32 reads the stored sleep and wake times from Blynk and runs a smooth light-fade algorithm at the correct times every day โ€” simulating sunset at bedtime and sunrise at wake-up. Brightness and color controls are disabled in this mode.

Manual Mode: Flip the switch off then back on. The LED strip turns on immediately at full brightness. A slider in the Blynk app lets the user adjust brightness freely. The automatic schedule is paused.

Blynk App Dashboard

I built the companion dashboard in the Blynk web interface โ€” see Week 14 for the detailed step-by-step setup. The dashboard includes a time-picker for sleep and wake schedules and a brightness slider for manual mode. After building the dashboard, I linked the Blynk virtual pins to the Arduino sketch and tested the connection over Wi-Fi.

Blynk app dashboard
Blynk dashboard widgets
Arduino code screenshot
Arduino sketch โ€” main loop logic for mode detection and LED control
App connected to Blynk
App Connection
Blynk dashboard in the mobile app
Blynk dashboard in the mobile app
Phase 4 ยท Fabrication & Assembly

Fabrication & Assembly

Fabrication brought the digital design into physical form through three parallel processes: laser cutting the acrylic panels, 3D printing the structural and decorative components, and assembling the electronics inside the enclosure.

3D Printing

Printed on a Bambu Lab A1 printer. Regular PLA was used for the wiring enclosure, spherical diffuser, and frame mount. TPU was used for the leg protectors to allow flexibility and improve stability on a bedside surface.

2
Wall Loops
15%
Infill
0.2 mm
Layer Height
On Build Plate
Support
None
Raft
3D printing the lid enclosure
Bambu Lab A1 โ€” printing settings
3D printed spherical diffuser
3D-printed spherical diffuser
3D-printed wiring enclosure
3D-printed wiring enclosure
3D printed frame mount
3D printed frame mount

Laser Cutting

Laser cutting the acrylic panels
Laser cutting the acrylic panels for the box enclosure

Assembly

The Light Alarm was assembled with the rod-and-nut frame. The PCB was soldered, the LED strip connected via screw terminals, and the toggle switch mounted on the enclosure wall. The whole assembly was then tested for mechanical stability and electrical connectivity before final sealing.

Final Outcome

Lamperto โ€” front view
Lamperto โ€” front view
Lamperto โ€” lit
Lamperto โ€” Side View

System Integration & Fabrication Methods

Mr. Lamperto integrates skills from across the Fab Academy curriculum into a single working system:

โœ…

2D & 3D Design

Fusion 360 3D model of full assembly; AutoCAD 2D panel drawings for laser cutting; hand sketches to digital refinement.

โœ…

Additive Fabrication

3D-printed wiring enclosure, spherical diffuser, leg protectors, and frame mount using PLA and TPU on Bambu Lab A1.

โœ…

Subtractive Fabrication

Laser-cut 2 mm acrylic panels for the box enclosure; CNC-milled single-layer PCB on Roland DGshape machine.

โœ…

Electronics Design & Production

Custom PCB designed in KiCad (schematic + layout), milled at the lab, soldered by hand, and tested with continuity checks.

โœ…

Embedded Programming

Arduino firmware on XIAO ESP32-C3; controls WS2812B LEDs via addressable strip library; reads Blynk virtual pins for schedule and brightness data.

โœ…

Wireless & App Integration

ESP32-C3 connects to Wi-Fi and syncs with Blynk IoT platform; custom dashboard built in Blynk for scheduling and manual control.

Testing & Evaluation

The system was tested in stages and as an integrated whole:

Circuit validation: The circuit was fully breadboarded before PCB fabrication. LED dimming curves, toggle-switch state detection, and Blynk connectivity were verified on the breadboard first.

PCB continuity check: After milling and soldering, each trace was checked with a multimeter to confirm there were no shorts or open circuits before powering the board.

Firmware unit tests: Each mode (Scheduled and Manual) was tested independently by simulating toggle events and confirming LED response matched expected behavior (smooth fade vs. instant-on).

System integration test: The full assembly was tested with the app connected over Wi-Fi. Sleep and wake times were set in Blynk and the lamp was observed through a simulated sleep-wake cycle to confirm the transition animation ran correctly at the right times.

Mechanical test: The assembled enclosure was checked for structural rigidity, heat buildup from the LED strip, and stability on a flat surface with the TPU leg protectors.

Bill of Materials

All components were sourced locally in Saudi Arabia (Alrish.sa) or via Amazon.sa. Total project cost: $65.00 USD.

Item Description Qty Unit Price Source
Acrylic enclosure 2 mm acrylic sheet for laser-cut panels 1 $5.00 alrish.sa
Locking nuts (16) 6 mm nuts + (8) 10 mm nuts for rod frame 1 pack $3.00 Amazon.sa
Threaded rods 6 mm & 10 mm diameter steel rods 1 set $10.00 Local hardware
PLA filament White & black PLA for enclosure, diffuser, frame mount 2 spools $15.00 Amazon.sa
TPU filament Black TPU for flexible leg protectors 1 spool $1.00 Amazon.sa
Toggle switch Heavy-duty electrical toggle switch (mode selector) 1 $1.80 Amazon.sa
Type-C cable USB-C power cable for the ESP32 microcontroller 1 $9.30 Amazon.sa
Screw terminals 2-pin screw terminals (LED strip & toggle switch connections) 2 $0.50 Amazon.sa
XIAO ESP32-C3 Seeed Studio XIAO ESP32-C3 โ€” Wi-Fi microcontroller 1 $14.00 Amazon.sa
WS2812B LED strip Addressable RGB LED strip โ€” main light output 1 $5.00 Amazon.sa
SMD resistor 330 ฮฉ โ€” LED data signal protection 1 $0.20 Amazon.sa
SMD capacitor 1000 ยตF, 10 V electrolytic โ€” power rail decoupling 1 $0.20 Amazon.sa
Total Project Cost $65.00

References & Sources

Reflection

Looking back on the full build process, this project challenged me across every discipline covered in Fab Academy โ€” and pushed me to make decisions under real constraints of time, tools, and materials.

โœ… What Worked Well

  • The physical toggle switch proved to be an intuitive mode selector โ€” more natural to use at night than opening an app
  • The WS2812B LED strip produced smooth, convincing sunset and sunrise transitions when the fade algorithm was tuned correctly
  • Blynk made it straightforward to build a functional IoT dashboard without writing server-side code
  • TPU leg protectors gave the lamp a stable, non-slip base โ€” a small detail that made a real difference in feel
  • The rod-and-nut enclosure system worked as designed and made the lamp easy to open for iteration

โš ๏ธ Challenges Encountered

  • PCB milling required several iterations to tune the Roland machine depth settings โ€” shallow cuts left copper bridges, deep cuts cut through the substrate
  • Case-sensitive filenames on the Fab Academy server caused broken images that worked fine on Windows during development
  • Synchronizing real-time clock on the ESP32 with Blynk scheduling needed careful NTP setup to avoid drift
  • The spherical diffuser required two print iterations to achieve even light distribution without visible hot spots
  • Blynk's free tier limits the number of active virtual pins, which constrained some planned features

๐Ÿ’ก Lessons Learned

  • Test every fabrication process at the smallest scale before committing โ€” kerf testing for the laser cutter and depth testing for the CNC mill saved significant material
  • Physical interaction (a toggle switch) makes a smart device feel more intentional and grounded than a phone-only interface
  • Firmware debugging is much faster on a breadboard before the PCB is milled โ€” never skip that step
  • Document as you go โ€” retro-documenting assembly steps from memory is harder and less accurate than photographing each step live
  • Designing for disassembly (threaded rods) was the right call โ€” I opened and modified the enclosure at least four times during integration

๐Ÿš€ Future Opportunities

  • Add a light sensor to create a fully closed-loop system that adapts the brightness to ambient room light conditions
  • Integrate a sound module for optional white noise or nature sounds during the wind-down phase
  • Replace Blynk with a local MQTT broker (e.g., Home Assistant) for full offline operation and privacy
  • Develop a companion iOS/Android app with richer schedule control and sleep quality tracking
  • Explore warm-white and cool-white LED combinations for more accurate color temperature shifting rather than RGB alone
  • Miniaturize the PCB to reduce enclosure size and produce a more product-like form factor

๐Ÿ“ Project Files

All project documents including CAD files, PCB designs, firmware, and fabrication files are available to download below.

โฌ‡ Download Project Documents (4.4 MB)

Full project files on GitLab

Source code, KiCad PCB files, Fusion 360 models, and all documentation

Visit GitLab โ†’