Coding Grace Foundation

Quick Maker Project - Counting down 20s while you wash your hands with Circuit Playground Express

whykay profile image whykay 👩đŸģ‍đŸ’ģ🐈đŸŗī¸â€đŸŒˆ (she/her) ãƒģ2 min read

Alt Text

(Note: This is a x-post from Coding Grace)

This project was during the "you better remember to wash your hands for 20s" back in April. But I wanted to post it here as well to share with folks.

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)
  • Laptop
  • 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

Check out the guided tour of the CPX here: https://learn.adafruit.com/adafruit-circuit-playground-express/guided-tour

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

Alt Text

Alt Text

Alt Text

🎉 Result

Alt Text

đŸ“Ŋ 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. 😊

ℹī¸ Source code for project

Here's the code on github: https://github.com/whykay/cpx_clap_wash

Posted on by:

whykay profile

whykay 👩đŸģ‍đŸ’ģ🐈đŸŗī¸â€đŸŒˆ (she/her)


Volunteer: Coder, tech event organiser, mentor, advocates diversity in tech | Working as Maker Advocate

Coding Grace Foundation

We are an Irish not-for-profit group that run diversity-friendly workshops.


markdown guide