I have a rain sensor which works like a contact sensor, when is dry the contact is close when it’s raining the contact is open.
I would like to connect this to the Argon. What is the best way to do it considering:
- Length of the cable is 2m (with eventual interference)
- The contact is closed for 70% of the time
- Connect one side to GND the other to the digital pin and use
- Connect one side to 3.3V, the other to the digital pin and use
Anything else I should consider, like resistor or ideas how to reduce interference?
If I instead decide to connect the sensor using a MCP23017/MCP23008 following this guide based the above options is this the correct configuration?
gpio.pinMode(myPin, INPUT_PULLUP); using the internal 100k resistor
gpio.pinMode(myPin, INPUT); plus a 100k resistor from the myPin to GND
Are 100k Ohm enough?