Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4466

General discussion • Help - GPIO Wiring & Script for Float Switch

$
0
0
Hi all - I'm hoping someone can offer me some guidance as I'm a bit lost on a project I'm putting together. I've purchased simple float switch from Amazon. It is normally open, meaning that the circuit isn't completed when the water is full and the float is up at the top. When the water level drops, so too does the float and it eventually completes the circuit. My goal is to have a bash script that is scheduled to run every hour - if the circuit is open, meaning the water is full, then the script will output "full" to a text file; if the circuit is closed, meaning the water level is low, then the script will output "low" to a text file. I currently have a one-wire temperature sensor connected to GPIO pins 1, 7, and 9, so I can't use those for the float switch.

I've been researching here and via Google all evening, but I can't seem to find a clear example in which this is accomplished. I'd really appreciate guidance on which GPIO pins I should use, how to handle the pull up versus pull down internal resistor setting, and some idea of how to handle the bash script.

For reference, here is the float switch: https://www.amazon.com/dp/B01LWX97CC

Thank you all for your help!

Statistics: Posted by craftycraft — Wed Mar 27, 2024 2:09 am — Replies 1 — Views 59



Viewing all articles
Browse latest Browse all 4466

Trending Articles