Make a 20-second hand washing timer with an LED, random 20-music clip, activated with a motion sensor.

With the global pandemic, health officials are recommending that we wash our hands often and for at least 20 seconds each time. To help myself wash my hands for 20 seconds, I’ve put this motion triggered musical timer in my bathroom. In addition to lighting up an LED, there are 10 different songs that it randomly plays each time it is triggered.

I originally did this project with a Pimoroni speaker hat and after I completed the project, I realized that the Pimoroni speaker hat had been discontinued.
Original project video:

To replace the speaker hat, I’m using an LED for the visual and a speaker with a 3.5 mm jack for the audio aspect.

GitHub repository:

Prerequisite: Raspberry Pi OS Setup on a microSD card –

Raspberry Pi Zero with Headers –
or Raspberry Pi 3B, 3B+ (3A, or 4) –
MicroSD card –
Motion Sensor –
3.5mm male-to-male audio cable –
Portable speaker with 3.5mm Aux Audio Jack –
Small Breadboard –
LED & 330 ohm resistor –
2 Female to male jumper wires –
3 Female to female jumper wires –

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission.

Icons made by Freepik