User Tools

Site Tools


Home Environmental Sensor Array


Summary Status

After experiencing a minor flood in the basement when the water softener turned on and the sump pump was not installed, I realized that my water softener runs without electricity. So, I changed the design of the HESA to turn on power to a submersible pump when it detects water rather then turn off power to the water softener. I also added graphing capability to the web page and made the code more reliable.

Click here to read the latest updates on my blog.

Final Solution


  • Auto-startup on power up.
  • Auto-recovery on program failure
  • Status light that shows when pi is running.
  • Check for water in the basement. If found:
    • Turn on power to submersible pump
    • Send email to mail address. If internet is down, wait until it is up to send message.
    • Update local status page and internet database
  • Send all clear email when water clears
  • Read temperature and humidity in basement
  • Store hourly readings to SQL tables on internet
  • Check internet connectivity
  • All components mounted in enclosure that is mounted on wall and connected to 120v power

External Features

  • Email address that forwards mail to several email addresses as well as texting
  • Web site that displays reading results in tabular and graphical form



Bill of Material


  • 120v to 5v USB power converter and USB cable for Raspberry Pi
  • Duplex power outlet (2)
  • Power plug for input with power cord for PC
  • Power switch
  • Powerswitch tail to control power
  • Water sensor cable
  • Connector plugs (2)
  • Ethernet cable
  • Enclosure


  • Wires to connect Raspberry Pi ports to devices
  • 100k resistor for LED in enclosure
  • Flat edge connectors for electrical wires
  • Eyelet connectors for electrical wires
  • Wires to carry 120 volts of electricity
  • Solder


Create a device that will sense when water is spilling in to the basement. The device will shut off power to the water softener and notify people that there is a problem.


  1. Order Raspberry Pi and its components – Done
  2. Order Powerswitch tail – Done
  3. Setup Raspberry Pi with basic configuration – Done. View the blog entry.
  4. Create email group on my website to redirect email to multiple accounts – Done. View the blog entry.
  5. Write Python module to send email – Done. View the blog entry.
  6. Assemble Powerswitch tail – Done. View the blog entries here, here, and here.
  7. Write Python module to control Powerswitch tail – Done
  8. Write Python program to incorporate all features for phase 1 – Done
  9. Design a sensor to detect water – Done. Decided to go with bare wires.
  10. Design portable test system – Done
  11. Obtain materials for portable test system – Done
  12. Ensure that the basic design works 100% – Done
  13. Design enclosure – Done
  14. Obtain materials for enclosure – Done
  15. Build enclosure – Done
  16. Mount device in basement and test – Done
  17. Install FTP on raspberry pi – Done
  18. Install website files to the raspberry pi – Done

Follow-up tasks

  1. Make a backup of the SD card – Done
  2. Publish on Instructables – Done
  3. Install Avahi to be able to access the pi by its host name rather than IP address – Done
  4. Print a raspberry pi base on the 3D printer – Done
  5. Replace ethernet faceplate with one with one or two openings rather than four – Done
  6. Install MySQL administration tool – Done
  7. Populate MySQL tables – Done
  8. Store readings to local table, then update internet table, if available – Not started
  9. Make monthly graphs
  10. Make daily routine to consolidate daily temp and humidity data to a summary table – Not started

Future Ideas

  • Display status on LCD screen
  • Reset button
  • Add a battery backup feature so the system can send alerts and shutdown gracefully in case of a catastrophe.
  • Add a button to shutdown the Pi, then shutoff power
  • Add a button to reboot the Pi

Members: Ken Becker

projects/home_environmental_sensor_array.txt · Last modified: 2014/11/22 16:44 by kennethsbecker