PySumpMon is a Sump Pump Monitor using Python and Arduino. The Arduino uses the EVShield to determine the distance to the water in sump. As distances are read by the Arduino every second, they are sent to a Python server over serial. The Python server polls the serial port every 30 seconds. The current distance is then logged and can be viewed on a web page. If the distance to the water is less than 10 cm, a text message is sent via Twillio using the parameters set in the configuration file.
- Computer to run the Python server
- Arduino with EVShield
- NXT Ultrasonic Sensor
- Arduino IDE
- Python 3
- GIT
- Twilio Trial Account
These installation instructions are for Windows and will need to be modified for Linux.
- Open the command prompt
- Navigate to the root directory using the command
cd C:/
- Clone this Git repository using
git clone https://github.com/tnewman/PySumpMon
- Connect the EVShield to the Arduino
- Connect the NXT Ultrasonic Sensor to port
BAS1
on the EVShield - Connect the USB cable to the Arduino and the PC
- Install the
PySumpMon/ArduinoDistance/ArduinoDistance.ino
sketch on the Arduino using the Arduino Software
- Open the command prompt
- Navigate to the
PySumpMonFolder
using the commandcd C:/PySumpMon
- Initialize the database using the command
python dbinit.py
- Open the file
pysumpmon/config.py
in a text editor - Set
DISTANCE_SENSOR_PORT
to the serial port for the Arduino - Set
TWILLIO_ACCOUNT
to the account credential provided by Twilio - Set
TWILLIO_TOKEN
to the token credential provided by Twilio - Set
TWILLIO_NOTIFICATION_FROM
to the phone number that will be used to send the message provided by Twilio - Set
TWILLIO_NOTIFICATION_TO
to the phone number that the text messages should be sent to.
- Point the NXT Ultrasonic Sensor at the bottom of the sump pump
- Connect the Arduino to the PC
- Open the command prompt
- Navigate to the
PySumpMonFolder
using the commandcd C:/PySumpMon
- Run the Python Server with the command
python app.py
- Distance can be viewed by going to the page http://localhost:5000 in your web browser.