ProtoStax Touchless Musical Handwash Timer with Arduino

Touchless Musical Hand Wash Timer

ProtoStax Touchless Musical Hand Was Timer
In this project, I make a Touchless Hand Wash Timer that displays a count clock for 20 seconds and simultaneously plays a jingle from a rotating selection of 20 second jingles (give or take a few seconds!) 
Apart from being a fun and practical application that you can easily build and deploy in your house, this project also demonstrates
  1. How to achieve doing multiple things at once - counting down and displaying the countdown timer AND simultaneously playing the jingle in correct time - without the use of delay()
  2. How to program your own selection of jingles very easily using a flexible programming syntax to transcribe music notation into something that the Arduino can play keeping perfect time

We first start with horizontally stacking ProtoStax Enclosure for Arduino and ProtoStax Enclosure for Breadboard in a "Platform Configuration" - i.e with just the bottom plates - to have an open prototyping platform consisting of the Arduino and Breadboard. This facilitates doing all the wiring, trying everything out, and programming the Arduino while having full and open access to everything. 

ProtoStax Touchless Musical Handwash Timer with Arduino

Once it has been programmed and the functionality verified, you can complete the enclosure by add the side walls and top to have a fully finished enclosure. Here I'm using the ProtoStax Kit for Ultrasonic Sensor HC-SR04 to add the ultrasonic sensor to the enclosure wall. Once everything has been closed up, you can place it near your sink, plug it in, and use it to trigger your favorite jingles to assist and entertain you with your hand washing! 

ProtoStax Touchless Musical Handwash Timer with Arduino

 

I have currently transcribed 

  1. Happy Birthday to You
  2. Do-Re-Mi - Sound of Music 
  3. We Will Rock You! - Queen
  4. Jeopardy! Theme music

These max out the memory on the Arduino, so I've enabled only 3 of them. However, it is possible to move the jingle transcriptions to PROGMEM memory so that it resides on Flash and the RAM is freed up.

To give you an appreciation for the differences, this program (with 3 melodies) took up 31% of program storage and 76% of dynamic memory on an Uno. With the above variables defined in PROGMEM, it occupied 32% of program space (that's only a slight increase in Flash memory usage with plenty more still available) and only 22% (down from 76%) of dynamic memory! That means you can easily add plenty of songs to this Touchless Musical Hand Wash Timer once you move things to PROGMEM! 😊

 As with all my projects, I end with several suggestions to take the project further along to learn more and have fun along the way! I leave the moving to PROGMEM as an advanced exercise for you! (Since the music data is contained in arrays of structs, moving to PROGMEM is a more advanced undertaking but I highly recommend you learning how to do it). 

You can find the project with full details at the ProtoStax Project Hub. Here is a direct link to the project - 

https://www.hackster.io/sridhar-rajagopal/touchless-musical-hand-wash-timer-766972

Happy Making! 😊

Sridhar Rajagopal & The ProtoStax Team 😊

 

 

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.