Raspberry Pi Pico nightlight pillow for babies

When teacher Amanda Haughs found herself in the familiar position of driving her baby around to try to get them to sleep, she noticed that, when it got too dark outside, they fussed until she turned an interior light on. So she decided to use her new Raspberry Pi Pico to make a plushy nightlight for the baby’s car seat.

How it’s made

Once Amanda figured out how to blink LEDs, she researched Pulse Width Modulation to get them twinkling. Then, she found a really simple tutorial to program a photoresistor (a light-dependent resistor or LDR) in MicroPython.

With the LEDs pulsing and the photoresistor sensing, she put both programs together. She created a function for twinkling lights and a function for no twinkle, then programmed the Pico to pulse the LEDs on and off randomly, depending on the level of light in the area.

Amanda found this How To Use A Photoresistor With Raspberry Pi Pico tutorial really helpful. She also used our own getting started guide.

The sewing bit

Velcro strips along the seams mean that it’s easy to get at the Pico for updates and troubleshooting. And Amanda sewed a buttonhole to allow her to run a power cable to the microcontroller inside the pillow. She used standard polyester crafter’s stuffing and chose to stay away from expensive conductive thread, instead using regular diodes and sewing them into the pillow.

This wearables tutorial was helpful for the sewing part.

Free computer science resources created by this maker

Amanda Haughs is a teacher and learning designer at the new Campbell School of Innovation in California’s Silicon Valley. As well as this nightlight pillow, she has created tons of free computer science resources for teachers and shares them all for free on her blog. She also made this tote-ally awesome Raspberry Pi bag.


Lars avatar

Wow, that pillow is a cool project, but I would think that this somehow might hinder the baby to sleep? But I guess, that with limiting power, the LED’s can be dimmed down to a more sleep-compatible level.

Liz Upton avatar

Honestly, you’d be amazed; one of my kids sleeps with a star projector that most adults would find it impossible to sleep through (and it MOVES) – but she finds it immensely soothing. The other one has a projector that creates sharks circling the walls. Kids are weird.

Comments are closed