Light Sensitive Alarm Clock

by ejackson23 in Workshop > 3D Printing

9 Views, 0 Favorites, 0 Comments

Light Sensitive Alarm Clock

Screenshot 2025-04-14 at 4.23.18 PM.png
Screenshot 2025-04-14 at 3.47.12 PM.png

We used the Adafruit Circuit Playground Express to create a light-sensitive alarm clock. We were able to make the alarm clock light up when the light hit the CPX, and an alarm went off as well. This was made possible by the code we created on Makecode.com

Supplies

Screenshot 2025-04-14 at 3.50.48 PM.png
Screenshot 2025-04-14 at 4.33.55 PM.png
Screenshot 2025-04-14 at 4.33.34 PM.png
Screenshot 2025-04-14 at 4.33.51 PM.png
Screenshot 2025-04-14 at 4.33.47 PM.png
  1. 3D printer
  2. Circuit Playground Express
  3. CPX holder
  4. Computer
  5. Cord to connect computer to CPX
  6. Battey pack

3D Design Download

Screenshot 2025-04-14 at 4.16.39 PM.png
Screenshot 2025-04-14 at 4.36.55 PM.png
Screenshot 2025-04-14 at 3.51.54 PM.png

Go to thingiverse.com and pick out a CPX holder model you would like to use. Once you find the model you want, download it to thinkcard.com and create your holder there. When you have done that, download your Tinkercad to makerspace and begin printing your circuit playground express holder. With this design, you can keep the CPX protected, and there is plenty of room to have the battery and wires stored underneath the design so they're not in the way of the sun getting to the CPX. This design worked out as we thought it would, and I am pleased with the end product.


Circuit Python Code

Screenshot 2025-04-14 at 4.20.34 PM.png

# Threshold for light detection

BRIGHT_THRESHOLD = 200 # Adjust this based on your environment

while True:

# Check if the light level is bright

if cp.light > BRIGHT_THRESHOLD:

for _ in range(10):

# Play a siren sound - simulated by tones (no siren preset)

cp.play_tone(880, 0.2)

cp.play_tone(440, 0.2)


# Show a rainbow-like pattern on NeoPixels

colors = [

(255, 0, 0), # Red

(255, 128, 0), # Orange

(255, 255, 0), # Yellow

(0, 255, 0), # Green

(0, 255, 255), # Cyan

(0, 0, 255), # Blue

(128, 0, 255), # Indigo

(255, 0, 255), # Violet

(255, 255, 255),# White

(0, 0, 0) # Off (optional)

]


for i in range(10):

cp.pixels[i] = colors[i % len(colors)]

cp.pixels.show()


time.sleep(0.2)

# Optional: turn off pixels after

cp.pixels.fill((0, 0, 0))

time.sleep(0.1)

Servo Motor

Screenshot 2025-04-14 at 4.34.05 PM.png

We did not use a servo motor for our alarm clock. We relied on the circuit playground express and the battery pack. The CPX and the battery pack were wired together using a JST PH-type 2-pin connector. Inside the battery pack were three AAA batteries. The battery pack has an on/off switch to control whether or not you want to use the alarm clock. The 3D portion was integrated by attaching it to the battery with Velcro. This way, the battery and wires from the battery pack were out of the way so the CPX could still receive the sunlight needed to set off the alarm clock. The battery pack, CPX case, and CPX all came together quite nicely, other than the case being a little deformed, making it a tight squeeze for the CPX, but those small problems can be worked out as the prototypes evolve.


The picture displayed is how the CPX and the batter pack should be connected.

Final Assembly

Screenshot 2025-04-14 at 4.23.18 PM.png

The clock is designed to be both functional and user-friendly, with a compact and lightweight structure that fits easily on a bedside table. Its light sensitivity allows it to activate based on natural light levels, making it an eco-friendly alternative to traditional alarms. The combination of flashing LED lights and a high-decibel alarm creates a dual-sensory wake-up system that is both effective and reliable. By combining sensory stimuli and natural light, our design offers an innovative way to wake up more naturally and efficiently.