Quick Maker Project - Counting down 20s while you wash your hands with Circuit Playground Express
By Vicky Twomey-Lee in Dublin April 20, 2020, 4:16 p.m.
Everyone has a wee song to sing to while washing your hands for 20 seconds, since I had Adafruit's Circuit Playground Express handy, why not create a visual countdown.
👉 You will need:
- 1 x Circuit Playground Express (aka CPX)
- 1 x MicroUSB to USB cable (so the CPX can talk to your computer)
- Editor of choice, I chose Mu Editor as it recognises Adafruit components and quick way to change and upload code as well as debugging, etc.
- CircuitPython for CPX installed
- Battery to power the CPX
🧐 Why did I choose Adafruit's Circuit Playground Express?
I had one around and I wanted to put something useful on it, plus I want to play a little more with CircuitPython. The CPX has 10 bright LEDS (Neopixels) so perfect for the 20 second countdown.
It also has a "Microphone Audio Sensor" so it can pick up sounds. And there's already code handily written on detecting sound via Adafruit's Sound example.
ℹ️ More info about CPX
All the elements are there, so let's get started! 💪
🤔 What I wanted to do
- Clap hands to initiate the countdown
- Changes colour and flashes a couple of times to let you know it heard your clap, and it gives you time to turn on tap, get soup on your hands
- Each Neopixel comes on for the 1st 10 seconds going clockwise, as it reaches the end, all Neopixels turns off and each one lights up going counter-clockwise.
- When 20 seconds are done, it flashes to turn on all Neopixels to green (one colour) to state that you have comepleted the required time to wash your hands.
📸 Some pics
The CPX I have with and without the case
📽 Here's a video of it working, my hands were sore from clapping while testing so I tapped it loudly on the casing which registers the sound as well. 😊