Connecting a float switch
Greg LaPolla
Posts: 323
I am looking to use a float switch like the the one in the attachment.
Would it work if connected as follows:
One wiire to GND, one wire to the prop, 10K pull up to VDD on the wire to the prop.
set prop pin to input and check ina[noparse][[/noparse]PIN] for 0 or 1 to determine if the switch is open or closed?
Also should I use a 1k resister inline to protect the prop pin ?
Thanks
Greg
Would it work if connected as follows:
One wiire to GND, one wire to the prop, 10K pull up to VDD on the wire to the prop.
set prop pin to input and check ina[noparse][[/noparse]PIN] for 0 or 1 to determine if the switch is open or closed?
Also should I use a 1k resister inline to protect the prop pin ?
Thanks
Greg
Comments
That's my newbie 2 cents worth. Hope it helps.
Mark
2) Yes, a 1K inline resistor would be a good idea.
As for debouncing it probably isn't necessary as you are not counting or anything but your program obviously would have to have some sort of hysteresis that prevents the system from chattering (float high, start the pump, float low, no no no .... stop the pump, float high....get the picture).
*Peter*
There are also float switches available that have 2 separate reed switches, where one is used to start and the other to stop a system.
Greg