Timing Soap Dispenser
With the current health situation, I realized that I have never really thought about how long I wash my hands. It is recommenced to wash for at least 20 seconds, but counting is so boring and I think we've all had enough of the Happy Birthday Song. That is why I decided to create an Arduino-powered timing soap dispenser. Press the button and the lights will function as a timer, going out after 20 seconds! Although I did not use a LED Strip, I technically used a strip of LEDs to create this design.
Please note that the photos above show a 3D rendering of what a more finished version of this product will look like. Being in quarantine, I do not have access to the equipment to make this refined version. I also do not have an advanced technical background, so I will definitely call things by the wrong name.
Supplies
- 1 Soap Dispenser
- There should be a lip on which the button can be glued that allows for the pump to activate it
- 1 Arduino Uno
- 5
- 5 Resistors between 100 and 100 Ohms
- 1 10k Resistor
- 1 Small, 4 prong button
- 1 Breadboard
- 1 Small, Disposable Container
- 1 Portable battery pack with USB connection
- A handful of assorted jumper wires
- I used mostly male to female but there are many ways to connect everything
- Super Glue
- Electrical Tape
- Scissors
The Circuit
The circuit is fairly straight forward. Attach each positive side (longer leg) of the LEDs to a port on the Arduino. My code uses pin 8 for the first light, pin 9 for the second, and so on until pin 12 for the last LED. There needs to be a resistor between 100 and 1000 Ohms between the LED and the Arduino or else the LED may burn out. I did not have 5 of the same resistors on hand so 2 of my lights are brighter due to the lower resistance value of the resistors they are paired with. I put these as the first 2 lights. Ground each LED back to the Arduino.
One leg of the button should be grounded using the 10k resistor and also going to pin 2 of the Arduino. Another leg should be going to a 5V output on the Arduino.
The Code
Upload my code to your Arduino Uno. If wired correctly, this code causes all LEDs to light up when the button is pressed and a light will go off every 4 seconds until they are all off at 20 seconds. I also created a function in the code that allows for the timer to reset if soap is dispensed in the middle of a countdown.
Downloads
Cable Mismanagement
I'm going to be honest here. It was a nightmare putting this all together without the proper tools. If I had PCB boards and a soldering iron, this would have gone much smoother. But try transferring this circuit off of the breadboard so that it can be utilized for the dispenser. I did, however tape the breadboard to the back of the Arduino and connected all the ground wires to it.
Connecting the resistors can be done by simply twisting them on the legs as shown in the photos. I used electrical tape and super glue to hold the connections strong. Don't make the same mistake I made in using too much super glue. This can make connections unstable.
Gluing the Button
This actually proved to be the hardest part of the entire project. Find a way to glue the button onto the soap dispenser in a position where it will get pressed when soap is dispensed. I found that first sanding the surface of the dispenser where the button will go to roughen it and then using Gorilla Glue as adhesive worked best. Tape the wires and top of the button to stabilize and allow adequate time to dry.
Putting It All Together
Puncture 5 holes in the top of the container to hold the LEDs. Push the LEDs through the inner side and tape the wires. I taped the 5 powers and the 5 grounds seperately. Tape the Arduino to the breadboard and wire everything up. Poke a larger hole for power where the power port on the Arduino will be. I used separate jumper wires for the button so that the female sides would come out the back so that the soap dispenser can be unscrewed and refilled.
I ended up gluing the dispenser to the top of the container, but I would advice against doing this unless your container is able to hold the weight of you pumping the soap. I also used glue and electrical tape in the areas where water could get through.
All Done!
Fill with soap, attach to the portable battery, and disinfect those hands!