I am curious if something like a schmitt trigger will work in this type of scenarios.After doing some wire management I was having trouble stabilizing the Float Switch signal after reconnecting. There was some bouncing going on with the switches it seemed that would keep the switches always on, so I've added a software time mechanism to clear that up. I've also changed to having a python script for each float switch to keep things clean and easy. So a script for ATOfloat1.py, ATOfloat2.py, ATOfloat3.py, etc. Then add the scripts to rc.local again to start on boot. The new scripts look like this...
Code:#ATOfloat1.py import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP) while True: input_state = GPIO.input(21) if input_state == False: print ('ATOtank Fill') time.sleep(10)
In the code example there the float is connected to GPIO 21. Also there's a print command to see if it's working in the terminal. Hope this helps if anyone has issues where everything looks like it should be working, but the switches just wont turn off due to bouncing.
