Skip to content

Instantly share code, notes, and snippets.

@einarjh
einarjh / check-moisture.py
Created December 25, 2019 15:19
Simple script to poll moisture status for a https://thepihut.com/products/soil-moisture-sensor - suitable for Icinga monitoring
#!/usr/bin/python3
import RPi.GPIO as GPIO
import time
# Disable warnings
GPIO.setwarnings(False)
# Define channels
switch = 18
sensor = 17