Hi, i want to write a code for fluid level controller as shown in the attachment such that the common line will be output 5v. When the liquid level falls below low level(when its not 5v), pump output should turn on but it should not turn off untill it reach high level. Please help.
If you’re suggesting immersion sensors, you might find a common 5V is harder to implement than you think.
Insulating the U-shaped container in all circumstances will be a lot harder than expected.
Possibly, grounding the container 0V will be a lot easier, and adding positive bias to the depth probes will make more sense..
Keep in mind any voltage will expose the project to the possibility of spark ignition, and cathodic effects.
I have exactly those float switches to control the water in my irrigation system. I have a solenoid valve to control the tank filling, not a pump, but the rest is the same.
My wiring has ONE lead from both switches connected to the Arduino ground, the second wire from a switch goes to one Arduino Nano pin and the second switch wire goes to another Arduino pin. Both pins are identified as input pullup.
Has been working well for about 3 years.
Good luck,
Paul
May I recommend that once the pump is enabled that the pump runs for a time period instead of to a level. After the run time, the level is checked and if more filling needs be done, then another do another motor run time.