This is a sensor to detect the presence or absence of water with the Raspberry Pi. Python code can be found here:

Changelog ============= Enno provided a better design in the comments, so I incorporated that as version 2 of this project. 

What's It Do? ============= This project is a water sensor. When it detects water, it sends an email and sounds an alarm. When the sensor is dry again, it sends another email and silences the alarm. Bill of Materials ================= - Raspberry Pi Type B - 10μF capacitor - Piezo buzzer that works between 3.3 and 5 volts. - small piece of rigid plastic - copper tape - Wire - breadboard - jumpers (MtM and FtF) Tools ===== - soldering iron - Keyboard/Screen/ETC get the script onto the Raspberry pi The water sensor ================= ### Making the sensor (see photo for final product) The sensor is made of two pieces of copper tape stuck to a piece of rigid plastic. Put the copper strips parallel, and close together on the same side of the plastic. Solder a lead to each piece of copper. I used speaker wire as the leads because it is cheap to get in long lengths. The longer the leads, the farther from the Raspberry Pi your sensor can be. ### Orienting and placing the sensor In my case, I was trying to determine if water had entered my basement, so I put the copper side down on the floor with a small weight on top of it. When water bridges between the two copper strips, it will close the circuit, and set off the alarm. The Code ======== The code requires you to have a gmail account to send the email. It will store your gmail password in plaintext, which is insecure. I suggest you make a dummy account for your sensor. Name it something cool; get creative. Feel free to modify the code however you'd like. Make the speaker send S.O.S. in morse code. Have the Raspberry Pi update a web server when it finds water. Go nuts.

Login to post a comment...

lucseawalker 10 months, 4 weeks ago

Is it possible to run about 12 sensors and know which particular sensor was triggered by water flooding?

blueturtles 4 years, 10 months ago

@enno - thank you for the modified project image. I will work on it this weekend. I will report back with my findings. I am excited to get this working!

enno 4 years, 10 months ago

it works with the following setup

blueturtles 4 years, 10 months ago

I have built this project but it is crashing the Pi. I think I know what the problem is, to me, it has to be the capacitor because it is in line with the Switch, purple and black wires. One of the capacitors wires needs to be wired to something else. Can anyone confirm this? And let me and the others know how to make the project work? Thanks!

enno 5 years, 3 months ago

how much V should the capacitor have?

enno 5 years, 3 months ago

hi, i have the same problem like unclefreddie70. If i flip the switch the Pi crashes and reboots. can you help me?

EricBuedts 5 years, 9 months ago

I have tried out this project and work very well. Now I want to customize the following as it can. I want it to be just the other way round is going to respond. Not when wet, but when it's dry. When it's dry, water must be refilled in the pond, when wet it must refill stop. And it should not send a mail, but every second every 1 or 2 minutes. Does anyone have an idea how I should adapt this best work out and where the code is sending a signal and mail. This text is translated. Dutch: Ik heb dit project uitgeprobeerd en het werk zeer goed. Nu wil ik het volgende aanpassen als het kan. Ik wil dat het net omgekeerd gaat reageren. Niet als het nat is, maar als het droog is. Als het droog is, moet er water bijgevuld worden in de vijver, als het nat is moet het bijvullen stoppen. En het moet niet elke seconde een mail versturen, maar om de 1 of 2 minuten. Heeft iemand een idee hoe ik dit best uitwerk en waar de code moet aanpassen betreft het versturen van een signaal en mail. Deze tekst is vertaalt

Uncle Freddie 5 years, 10 months ago

Hi, I can't get this circuit to work. I have wired it exactly as shown, but when I flip the switch, the Pi immediately panics and crashes and reboots. This happens whether or not the Python script is running. Has anyone else gotten this working? Thanks.