Washing hands has never been more important, we all need to do it right. The proper process involves rubbing soap and water over every surface of your hands, and taking a full 20 seconds to do the job.

A no touch, sound activated 20 second timer can help with getting the timing right, and blinking LEDs has made it more fun for my boys to wash hands properly.

It’s a simple process to build it and I’ve chosen to use a Circuit Playground Express board.

This is a great beginner project to show how to make a real product with a few ‘blocks’ of code!

Description

The Circuit Playground Express (CPX) hand wash timer is created with MakeCode. If you’re new to MakeCode, check out this guide on getting started.

This is what I ended up with:

MakeCode Project

When the CPX is first powered on or reset, the on start block will run. In it we set the NeoPixel brightness to 10, call the blink function with arguments of 1 for color and 2 for times .

Then the pixels are turned of and the on-board red LED is turned on by setting the pin high.

When the loud sound is detected, the code in the on loud sound block runs. This calls the prep_countdown function and the countdown function.

Once the blocks and JavaScript are connected and written, you can download and copy the make code on your Circuit Playground Express board.

MakeCode Project Download

Hopefully you should end up with something like this:

If you want to try this project out yourself, you can either:

Copy over the JavaScript code for this project:

https://github.com/lsarikonda/CircuitPython/blob/lsarikonda-20Second-HandwashTimer/Handwash.js

Or import the project file:

Circuitplayground-Hand-Wash-Timer