I went for a shower one day, was getting late for office. Running tight on time, but I didn't want to come out of hot shower in cold morning. Without any clock in my bathroom I was saying to myself "Lets enjoy the shower for few more minutes, I might be over estimating the time". Result- I got really late to my office.
Solution- Put a clock in your bathroom.
Why would I put a clock in my bathroom when I can make a simple timer on my own. Well this instructable is just to build a waterproof 10 minute timer so you enjoy your hot bath and reach office on time.
Step 1: Quick Video
Here is a short 4 minute video that summarizes every thing.
Step 2: Electronics Components
Description- We will use three 3mm LEDs to display time in binary i.e. 001 means one minute is past and 111 means 7 minutes are past; here 1 means LED is ON. Now that we are using only 3 LEDs, we can indicate only 8 states using them, so lets agree on lighting up first LED not at the end on 1 minute but after 3 minute and from there every minute we will increment the count. This decision was influenced by the use of small form factor CR2032 button cell as powering source of the circuit, which has capacity of 250mAh only. We will use three 2.2 kOhm resistors for current limiting through LEDs. A latching push button DPDT switch will work as ON/OFF switch. We will use Attiny85v as controller in this circuit as it can support operation up to 1.8v at 1MHz.
Step 3: Tools
Description- We will use silicone sealant to make our timer water proof. Soldering Iron and soldering wire for assembling circuit on General purpose circuit board. Some plastic bags and plastic cups can come handy to take out sealant.
Step 4: Why Attiny85v?
To keep size of the timer small, I decided to use a CR2032 button cell. CR2032 is rated at 3v and can go down to to 2v when fully discharged. Attiny85 has minimum operating voltage of 2.7v, which will be waste of CR2032's capacity. On other hand Attiny85v has minimum operating voltage of 1.8v which is below full discharge voltage of CR2032, resulting in full utilization of button cell. Frequency of operation at lower voltages is going to be low but our application does not demand high frequency operation. Attached image is a snap from Atmel's datasheet on attiny microcontrollers.
Step 5: How to Program Attiny85v From Arduino IDE?
Arduino IDE does not have support to program attiny85v by default, you can add attiny85 (which holds good for attiny85v) as one of the board in Arduino IDE using THIS LINK.
Once you are done with that set Tools > Programmer to "Arduino as ISP", select "attiny85" as board and set "Internal 1Mhz" as frequency in Tools menu. After that make connections mentioned in above link (THIS LINK) and burn the bootloader. As a test you can modify blinky code for pin number 0 and burn it in attiny85 to see LED blink at physical pin number 5 of attiny85v.
Step 6: Schematic
Description- Circuit is quite simple. Attached image's left half shows a breadboard view of the circuit. Attiny85v is powered by a 3v coin cell CR2032, connected through a switch. Three 3mm LEDs are connected to physical pin 5,6 and 7 of attiny85v through a series resistor of 2.2 kOhm. Pins 5,6 and 7 map to gpio pin 0,1 and 2 of arduino. Right half of attached image shows the schematic view of the circuit.
Step 7: Code and Assembly on General Purpose Circuit Board
Description- Code is also quite simple. We declare a count variable. Set three pins in output mode, set them low. Put delay of 2 minute in setup function as we plan to count 10 minutes using only 3 LEDs. In loop function we wait for every 1 minute, increment the count and then update the status of LEDs using set_LEDs function. This function uses bitwise AND to update the status of LEDs.
Once coding was finished I assembled the circuit on General purpose circuit board using soldering iron/wire.
Step 8: Waterproofing the Circuit.
We will take out some silicone sealant for water proofing in a plastic cup; remember to put a brand new coin cell in your circuit before sealing it. Now take out some sealant, mix it up. Get you timer and dip it in the sealant. Spread sealant all over the timer, make sure that you don't miss a spot. Use some plastic stylus to do this don't touch the sealant with your finger as it can cause irritation. Take out dipped timer in a polythene and wrap it up, finally spread the sealant evenly on the timer using you finger.
I left my package as it is overnight. Removed plastic package in morning. Trimmed its edges using scissor and finally waterproof 10 minute timer was ready.
I tested the circuit by dipping in a jar of water and It worked perfectly.
That's all for this Instructable, thank you for your time.