Introduction: DIY Automatic Shower Timer
We've all been told to take 5 minute showers. However, do we really know how long our showers actually are?
Here's a simple weekend project that is both fun and practical. This circuit uses an ATtiny85 chip that automatically starts a timer as soon as you close your shower door. When 5 minutes are up, a piezo speaker starts beeping to let you know that time is up. If you finish your shower early, the timer resets.
Step 1: Gather Materials
Parts and Components
- 8-Pin IC Socket
- SPST or SPDT Limit Switch (also called Microswitch)
- 8 ohm Piezo Speaker
- Green LED
- Red LED
- LED Holder - 5mm (2x)
- 220 ohm Resistors (2x)
- Male and Female Header Pins
- Mini Solder-able Breadboard
- Stranded Hook-up Wire 22 AWG
- 2x AAA Battery Holder
- AAA Batteries (2x)
- Adhesive Velcro Strips
Small Project Box or Enclosure
( Most of these materials can be purchased from Sparkfun Electronics )
- Soldering Iron
- Diagonal Cutters
- Rotary Tool (with drill bits)
To program the Attiny, you will also need an Arduino and a few jumper wires, as well as the latest version of the Arduino IDE.
Step 2: Program the ATtiny
Download the attached "ShowerTimer.ino".
Open the sketch and select "ATtiny85 @ 1MHz" under Tools > Boards. Hook up your Arduino to the Attiny and upload the sketch.
If you do not know how to program Attiny chips using an Arduino, check out this tutorial.
Step 3: Wire Up the Circuit Board
While your soldering iron heats up, examine the circuit shown above for a couple of minutes. Notice that the limit switch acts as a power switch, turning the Attiny on and off.
To begin with, solder the IC socket somewhere in the middle of the PCB. You may have to tape it down first. Then solder on the piezo speaker, connecting the positive lead to Attiny pin 6 and the negative lead to ground (Attiny pin 4). Next, solder the LEDs and their respective resistors to Attiny pins 2 and 3.
Here comes the interesting part. Using your diagonal pliers, snip off two pins of both the male and female headers. Bend the leads of the female pins at a right angle, and solder one pin to ground. Finally, connect the positive wire of your battery holder to Attiny pin 8 and the negative wire to the second pin of the female header. The female header should jut out from the side of the circuit board as shown above.
When you have finished soldering, carefully insert the programmed Attiny chip into its socket and place the batteries in their holder.
Step 4: Hook Up the Switch
You will now need your hook-up wire, a tape measure, and a pair of wire strippers.
Measure out a couple feet of wire and cut it off. Repeat so that you have two identical lengths of wire. Strip half an inch off of both, and twist the ends slightly to keep them from fraying.
Solder one end of both wires to the male header you previously prepared. Then solder the remaining ends to the leads of the limit switch. When the limit switch is depressed, current should be able to run from one pin to the other.
Note: It's a good idea to add heat-shrink tubing to insulate any solder joints you have made in this step. Just remember, put the heat-shrink on before you solder.
Step 5: Make the Enclosure Case
Hopefully you have purchased a project enclosure that is sturdy, but easy to cut through, like the Radioshack plastic project enclosure shown above.
Measure the approximate diameter of the speaker and note the spacing of the LEDs. Using your rotary tool, cut out a large hole for the speaker and two smaller holes for the LEDs in the lid of the enclosure. Insert the LED holders into the smaller holes.
Now carefully place the circuit board into the lid, so that the speaker and the LEDs fit into their respective slots.
Note where the female header is and cut a small hole in the side of the enclosure so that the female header can be accessed.
Once you are satisfied with your enclosure, place the battery pack and the circuit board inside the case, and screw the lid on.
Step 6: Mounting Your Project
At this point, you should have a nice looking enclosure housing your circuit board and a spool of wire with a limit switch at one end. Notice that the male header on the wire spool fits nicely into the female header of your project enclosure.
Stick a strip of the adhesive Velcro to your enclosure. Then stick a similarly sized strip on the wall next to your shower. Your can now attach your project to your bathroom wall (make sure the female header side faces up).
Next, mount your limit switch in the corner of the frame of your shower door as shown above, so that when you close the door, the switch is depressed ( I used tape in the picture, but it's probably a better idea to use hot glue or something more permanent). Run the wire over and out of the shower stall and plug the male header pins into the female header pins of your enclosure.
To test your shower timer, gently close the door of your shower. The green LED should light up.
After 5 minutes (of patiently waiting), the red LED should switch on and the speaker start beeping.
Step 7: Final Words
Congratulations! You just built your own Automatic Shower Timer.
I hope you enjoyed this making this project and spending the time to reduce water usage.
Taking 5 minute showers helps save thousands of gallons of water and hundreds of pounds of carbon dioxide emissions each years, so you can pat yourself on the back for helping lessen the impact of global warming.
Third Prize in the
MAKE ENERGY: A US-Mexico Innovation Challenge
We have a be nice policy.
Please be positive and constructive.