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.
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.