Almost every one of my kids went through a phase of being terrified of the dark. We tried regular nightlights, leaving the hallway light on, glow-in-the-dark stickers - the usual stuff. Nothing really stuck.
Then I realized: the fear isn’t really about the dark. It’s about not having control.
The IdeaWhat if the kid controls the light? Not with a boring switch - with claps. Clap twice, light turns on. Clap again, it changes color. To a 6-year-old, that’s basically magic.
How It WorksThe sound sensor module listens for clap patterns - two sharp sounds within a short window. When detected, the Arduino cycles the NeoPixel ring through preset colors. Another double-clap cycles to the next color. A long pause turns it off.
The detection logic uses a simple threshold + timing approach: the sound sensor outputs an analog signal, and the code looks for two spikes above threshold within 500ms of each other. This filters out regular room noise while catching deliberate claps reliably.
The BuildWiring is straightforward:
- Sound sensor analog out → Arduino A0
- Sound sensor VCC → 5V, GND → GND
- NeoPixel data in → Arduino D6
- NeoPixel VCC → 5V, GND → GND
I used a simple diffuser over the NeoPixel ring - a frosted plastic cup works surprisingly well for prototyping. For the permanent version, a 3D-printed enclosure with a translucent top gives a clean look.
The CodeThe code handles clap detection, color cycling, and a sleep timer. I used a tool called Make-it (make-it.ai) to generate the initial wiring diagram and code, then tweaked the sensitivity threshold to work in a kid’s bedroom.
Full project with wiring diagram and code: View on Make-it
What Happened NextThe fear completely flipped. Instead of “I’m scared of the dark” it became “watch what my light does!” She shows it to every friend who comes over.
But the unexpected part: it became an ongoing project. First we added more colors. Then she wanted it to blink when it’s bedtime. Now she’s asking if it can respond to her voice. She’s 6 and she’s learning basic electronics without realizing it.
What You Could Add- Voice activation using a microphone module (her next request)
- Bedtime timer mode - light slowly dims over 15 minutes
- Brightness control via a potentiometer knob
- Multiple lights in different rooms synced via WiFi (ESP32 upgrade)
If you have kids who are afraid of the dark, consider building something with them instead of buying a nightlight off Amazon. Giving them control over the thing they’re afraid of changes the whole dynamic.


_ztBMuBhMHo.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)











_3u05Tpwasz.png?auto=compress%2Cformat&w=40&h=40&fit=fillmax&bg=fff&dpr=2)
Comments