- Joined
- Apr 11, 2019
- Messages
- 32
- Reaction score
- 66
Having some issues getting float switch to work. I've followed the circuit diagram here with the COM having a 10K and 1K on the Pin line. Then the NO straight to GND. But some reason it's just not picking up the switch on any pin. I've restarted, rewired, tried different pins, tested the switch, tried other switches, etc. Could it be impedance in the wires of my floats? Should I just use the pull_up resistors on the pi zero?
If I were to try that I was thinking of just making a python script to activate the resistors with a script like this then just use that pin on the inlet for the float?? Then I wouldn't need 3 wires to float also I guess?
#floatswitch1.py
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
#GPIO Pin of switch
floatPin1 = 21
GPIO.setup(floatPin1, GPIO.IN, pull_up_down=GPIO.PUD_UP)
If I were to try that I was thinking of just making a python script to activate the resistors with a script like this then just use that pin on the inlet for the float?? Then I wouldn't need 3 wires to float also I guess?
#floatswitch1.py
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
#GPIO Pin of switch
floatPin1 = 21
GPIO.setup(floatPin1, GPIO.IN, pull_up_down=GPIO.PUD_UP)