I have a project in which i use want to close a relay with a float switch.
The system looks like this:
I have a brick relay that will be closed by the float, and a buzzer will turn on.
I also have a reset switch, that will close the buzzer and start the relay.
On the float switch i have a pull down resistor of 100kOhm.
The pump has a pressure sensor and it closes when it fills a recipient with water. I am using my system to close the whole power if something damages and water will fill my room.
My problem is that when the pressure sensor closes the pump, my buzzer starts and the relay will close, as if it was closed by the float device.
I am e newbie at electronics, but i cannot see how to solve this problem.
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState1 == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
//tone(8, 1200, 1000);
// delay (1000);
tone(8,800);
}
if (buttonState2 == HIGH) {
digitalWrite(ledPin, LOW);
noTone(8);
}
}
I tried to put a smaller resistor, but it acts like the the float is always on.
Then you have not got it wired up like you think you have. If it is wired up like on the schematic then this will not happen.
The long tracks on the solderless bread board has a break in the middle, and check that the ground goes back all the way to the arduino.