XRAD
Well-known member
I am trying to build a water sensor with the design in the image below (JUST the high water sensor). I have substituted a 2n3904 for the BC548C (because I don;t have any of these). I thought they were similar enough to work...but...no luck.
I want the RED led to come on when water is sensed(the boiler 'pins' are in contact). Pins changed for teensy 3.2
Any suggestions? Is there an easier way? the Base probe is going into a mini boiler....
right now with current design, the LED blinks on set-up, and then stays on...whether or not the boiler probes are in contact with water....
I want the RED led to come on when water is sensed(the boiler 'pins' are in contact). Pins changed for teensy 3.2
Any suggestions? Is there an easier way? the Base probe is going into a mini boiler....
right now with current design, the LED blinks on set-up, and then stays on...whether or not the boiler probes are in contact with water....
Code:
#define sensorPin 23
#define ledPin 3
void setup() {
pinMode(sensorPin , INPUT);
pinMode(ledPin , OUTPUT);
digitalWrite(ledPin , HIGH);
delay(3000);
digitalWrite(ledPin , LOW);
delay(1000);
}
void loop() {
if (analogRead(sensorPin == LOW)) {
digitalWrite(ledPin , HIGH);
} else {
digitalWrite(ledPin , LOW);
}
}