Attiny85 Faucet Water Temperature Sensor
Real life testing in the kitchen sink! Note the tri-color LED. Blue is cold and fades into Green which then flips to increasing Red at 85F.
This project is an Attiny85 Arduino circuit and uses the Coding Badly attiny core available here:
For the AVR programmer, I used the Adafruit ZIF shield and Adafruit flavor of the ISP software. running on Uno. I am not using a bootloader for the tiny85 and I am not modifying any fuses other than what is specified in the Coding Badly boards.txt file:
ATtiny85 @ 8 MHz (internal oscillator; BOD disabled)
I consider this an advanced project and not suitable for newbies. There is ample support on the Internet for questions relating to programming Attiny85 with the Arduino environment. I am using version 1.0.5 and I recommend you do the same.>Please do not leave comments for personal support - I am unable to assist you in this manner. The circuit has been built twice, it works and the parts are detailed and the exact ones I used. Make changes only if you know what you are doing. The code makes use of concepts from various authors and where possible, references are provided; if you have questions you need to do your own research.
Thank you and have fun.
Save money ... $weet!
How many times have you turned on the faucet and walked away while the water warmed? Or, turned on the water and cursed because you burned your hands or the water was ice-cold?
Introducing Hot Yet? the Arduino tiny85 based temperature monitor. The low-power AVR processor monitors the 10K NTC thermistor and 10K resistor voltage divider and converts ADC readings into bands of color... blue for cold, green for cool, and red for warm into hot. And when the temperature stabilizes for 5 seconds, the AVR goes into deep sleep to conserve battery power- standby is around 6uA and the maximum current is around 6mA. Ideal for 2-AAA or even a CR2032 lithium coin cell.
There is no power switch. Every 4 seconds, the AVR will wake up, take an ADC reading and if that value is close to the previous reading (about 0.5%), the uC will go back to sleep for 4 seconds. If the ADC reading is greater that half-percent, the program will assign a color or colors, map a PWM register or registers, and monitor the ADC in real-time for the next 5 seconds, illuminating the LED appropriately.
Construction can be point-to-point in a dead-bug arrangement, a PC board can be built, or simply use perf-board. The wiring schematic is in the top part of the code. You DO NEED to add a small 100nF bypass capacitor very close to the uC across the Vcc and Gnd pins. For battery use, the standard bulk-capacitor (10uF to 100uF) is optional, but may provide a little circuit stability when the batteries start to age and the Vcc value drops due to the LED load (the point where the batteries should be changed.)
Have fun. Save water, save energy, and save money!
My intent is to find a nice, small box to mount this device; likely something in white plastic. In the past, I have found many suitable enclosures at the "dollar store" in devices such as LED closet lights, door alarms, etc. I will most likely power it from 2 AAA batteries because I have bunches of 2-cell holders for these batteries. I have tested it with a CR2032 lithium coin cell, and that works great also.
In the "Test" video, I simply used clear tape to affix the thermistor directly in contact with the aerator exit for the water faucet. In my bathroom, the faucet has a chrome cover that can be removed and the thermistor mounted (with epoxy) directly against the flow pipe.
In the kitchen, where my wife reigns, the thermistor will be mounted on the exit pipe from the mixing chamber of the faucet which is accessible from under the sink. The back of the sink is part of an island and I can snake a thin clear plastic coated double connector wire there for the display unit on top of the sink.
Every installation will require a little creativity and brain exercising to properly affix the thermistor and bring out the wiring to the control head. I have been eyeing a plastic soap dish which has a recess in the bottom... I think I can get the tiny85 and battery easily into that recess and a small hole will allow the LED to be clearly seen!
Lastly, you may be able to put everything under the faucet escutcheon plate! While looking at mine, I noticed the silicon gasket had sufficient 'flex' that I believe I can use plastic fiber optic to run the LED light to the outside and seal with some clear silicon compound. Of course, drilling for the LED and a drop of epoxy would be my desire if the spouse does not veto my proposal.
My project runs at 3.3V but you can run the circuit unchanged up to 5.5V with a corresponding increase in power. The Red LED will be the most power-hungry http://www.thediyworld.com/How-To-Properly-Use-LEDs.php but with our Red LED mapping in the PWM, we will see 98% maximum IE power if the thermistor drives the ADC to 1023 (too hot to touch!) So assuming the maximum current through the 100 Ohm resistor at 5.5V for the Red LED (neglecting CMOS output stage voltage drop):
(5.5V - 2.1Vdr) / 100 Ohm * 98% = 33mA
The output pin for the Attiny85 can sink/source 40mA, so we are well within the safety margin.
If you need sound, try connecting a piezo-sounder between Gnd and the Attiny pin for the specific LED color of interest: R, G, or B.