LED Faucet
LED FAUCET YEAH!!!
Jimmy McGrail and Spencer Laird LED Faucet
LED that changes color with the temperature of the water
when cold water hits the thermister it makes the LED turn blue. This makes it seem like the water is blue. When warm water hits the thermister the LED changes to purple depending on how hot/cold the water is. When hot water hits the thermister it changes the color of the LED to red. The code says that once it hits a certain temperature then it changes so we have the low and high temperature. If the temperature is not the high or low point then the color changes based on how close it is to the high/low.
int potPin = 2; int ledPin = 6; int ledPin2= 5; int val = 0; int blue; int red; void setup() { pinMode(ledPin, OUTPUT); pinMode(ledPin2, OUTPUT); Serial.begin (9600); } void loop() { val = analogRead(potPin); Serial.print ("Value = "); Serial.println (val); blue= map(val,400,660,255,0); red= map(val,500,740,0,255); analogWrite(ledPin,blue); delay(1); analogWrite(ledPin2,red) }
Our problems came mostly during the construction. Water proofing the wires was challenging but after a while it came easy. We were expecting to put the whole Led/thermister/wires in the hose but because they didn't fit, we put only the necessary parts in the hose. Our other problems were moving all our wiring from the bread board to the arduino board. It was hard to know where to put all the wires but we got it eventually.
We would add more LEDs so that the color would be more vibrant. We would also put the arduino board in a better box along with the wires.