Home Store Project Ideas Project Guide Ask An Expert Blog Careers Teachers Parents Students
Share to Classroom

Green Technology: Build an Electronic Rain Detector to Conserve Water

Time Required Average (6-10 days)
Prerequisites Some experience with electronics would be helpful. If you are new to electronics, plan to spend some time learning about the subject prior to making the circuit. The workbook included with the kit has introductory information.
Material Availability The procedure calls for an electronics kit that can be purchased online. See the Materials and Equipment list for details.
Cost Average ($50 - $100)
Safety No issues


"Waste not, want not" is a common saying. These four words sum up an important principle: if you "waste" an important resource, you might find you don't have enough of it when you "want" it. One of the most important resources we have is clean water. In many parts of the world, including the western part of the United States, water shortages pose serious problems. In this science project, you will build an electronic circuit that can 1) detect when it is raining and 2) shut off power, such as to a sprinkler system (don't worry, you don't need a sprinkler system to do this science project!).


Build a circuit that detects rain and can shut power off to a sprinkler system when it is raining. Important Note: This is an environmental engineering project. Most, but not all, science fairs accept engineering projects completed using the engineering design process. If in doubt, you should check with your fair before you follow the engineering design process within this science project, instead of the scientific method.


David B. Whyte, PhD, Science Buddies

Cite This Page

MLA Style

Science Buddies Staff. "Green Technology: Build an Electronic Rain Detector to Conserve Water" Science Buddies. Science Buddies, 14 July 2016. Web. 23 July 2016 <http://www.sciencebuddies.org/science-fair-projects/project_ideas/Elec_p066.shtml>

APA Style

Science Buddies Staff. (2016, July 14). Green Technology: Build an Electronic Rain Detector to Conserve Water. Retrieved July 23, 2016 from http://www.sciencebuddies.org/science-fair-projects/project_ideas/Elec_p066.shtml

Share your story with Science Buddies!

I did this project I Did This Project! Please log in and let us know how things went.

Last edit date: 2016-07-14


You might already know that conserving water is a good idea, but what exactly are the benefits of water conservation? One benefit is energy conservation. Water-pumping, delivery, and wastewater-treatment facilities consume a significant amount of energy. In some regions of the world (like California) over 15 percent of total electricity consumption is devoted to water management. Saving water conserves this energy for other uses. Another benefit is habitat conservation. Overuse of fresh water can lower the levels of lakes and rivers, causing significant environmental problems. Minimizing human water use helps preserve freshwater habitats for local wildlife and migrating waterfowl, as well as reduces the need to build new dams and other water-diversion infrastructures.

There are few things as wasteful as a water sprinkler system running during a rain storm. The goal of this environmental engineering science project is to build an electronic circuit that can detect when it is raining and that can shut off the power to an automatic sprinkler system.

The circuit will be modified from an example in an electronics kit, making it relatively easy to build. The circuit contains an electronic part called a 4011 integrated circuit (IC). The 4011 IC has four nand gates (the word nand is derived from "not and," reflecting the fact that the "nand" output is the reverse of the "and" output). You will just be using one of them for this science project. A nand gate is able to turn things on or off, depending on the kind of input it receives. The nand gate has two inputs, labeled 1 and 2 in Figure 1, below. The input is "on" when it is at 9 volts (V) and "off" when it is connected to ground. You can read more about basic electricity concepts in the Science Buddies Electricity, Magnetism, & Electromagnetism Tutorial.

Electronics and Electricity science  project <B>Figure 1.</B> A rain detector circuit.
Figure 1. A rain detector circuit. When the sponge is wet, no current flows from input 3 to ground, so the circuit shuts off power. When the sponge is dry, the circuit allows current to flow through the LED to ground (the LED is a substitute for the sprinkler; when it is on or off, the sprinkler would be on or off). The circuit "senses" rain because there is an electrical connection between the wires when the sponge is wet. When this electrical connection is made (when the sponge is wet) the voltages at inputs 1 and 2 become high (9 V, "on") and output goes to 0 ("off"). To turn off a sprinkler system, the power that controls the sprinklers would be connected through the circuit.

Here is how the output is controlled by the two inputs. When inputs 1 and 2 are both at 9 V (that is, 1 and 2 are both "on"), the output from input 3 is "off." For all other combinations of the states of inputs 1 and 2 (off/off, on/off, off/on) the output from input 3 is "on" (9 V). You can put this relationship in a truth table, as shown below.

1 23LED lights up Rain
On On Off No Yes
On Off On Yes No
Off On On Yes No
Off Off On Yes No
Table 1. Truth table for the nand gate. The output (3) is "off" (0 V) only when both inputs (1 and 2) are "on" (9 V). This is the opposite of an "and" gate truth table, where the output is "on" only when both 1 and 2 are "on." The table could also use "high" vs. "low", or "1" vs. "0," rather than "on" vs. "off."

This science project involves making the circuit shown in Figure 1 and demonstrating that it shuts off power to the light-emitting diode (LED) when the sponge is wet. The LED represents the sprinkler system. If you choose, you can add the circuit to a real sprinkler system (see the Variations). In an automatic sprinkler system, the water is turned on and off by a solenoid. When the solenoid is powered by a voltage, a part (called a diaphragm) moves so that the water can flow. When the power is turned off, the part falls back to its original location and the water flow is blocked.

The circuit will be modified from a circuit that turns off the power when a touch sensor is touched. For this engineering science project, the touch sensor will be replaced with a "water sensor" in the form of a sponge. If the circuit were used outside, the wet sponge would keep the power off until it was allowed to dry out. It is important to note that the circuit allows electricity to flow only when two conditions are met: the power switch is "on" (as it would be when the sprinkler system is turned on) and the water detector does not sense water. In the circuit, turning the power on just means moving the power switch to the "on" position. For a sprinkler system, the power would most likely be turned on by a timer. When the water sensor is wet in a sprinkler system, the electricity is not allowed to flow, even when the power is turned on.

Terms and Concepts

  • 4011 integrated circuit
  • Nand gate
  • Ground, in circuitry
  • Truth table
  • Light-emitting diode (LED)
  • Solenoid


  • How much water does the average household use per day?
  • What are some reasons to conserve water?
  • How many nand gates are in the 4011 IC?
  • What does the truth table for an "or" gate look like?
  • How can you combine nand gates to make an "or" gate?


News Feed on This Topic

, ,
Note: A computerized matching algorithm suggests the above articles. It's not as smart as you are, and it may occasionally give humorous, ridiculous, or even annoying results! Learn more about the News Feed

Materials and Equipment

Note: this project was originally based on the Radio Shack Electronic Sensors Lab kit, which is no longer available. If you have experience working with circuits, you should be able to assemble the circuit based on Figure 1 in the introduction. We have provided links to purchase the individual circuit parts below.

Disclaimer: Science Buddies occasionally provides information (such as part numbers, supplier names, and supplier weblinks) to assist our users in locating specialty items for individual projects. The information is provided solely as a convenience to our users. We do our best to make sure that part numbers and descriptions are accurate when first listed. However, since part numbers do change as items are obsoleted or improved, please send us an email if you run across any parts that are no longer available. We also do our best to make sure that any listed supplier provides prompt, courteous service. Science Buddies does participate in affiliate programs with Amazon.comsciencebuddies, Carolina Biological, Jameco Electronics, and AquaPhoenix Education. Proceeds from the affiliate programs help support Science Buddies, a 501(c)(3) public charity. If you have any comments (positive or negative) related to purchases you've made for science fair projects from recommendations on our site, please let us know. Write to us at scibuddy@sciencebuddies.org.

Share your story with Science Buddies!

I did this project I Did This Project! Please log in and let us know how things went.

Experimental Procedure

Note: This engineering project is best described by the engineering design process, as opposed to the scientific method. You might want to ask your teacher whether it's acceptable to follow the engineering design process for your project before you begin. You can learn more about the engineering design process in the Science Buddies Engineering Design Process Guide.
  1. Assemble your circuit based on the breadboard diagram in Figure 2.
    1. If you do not know how to use a breadboard, see the Science Buddies reference How to Use a Breadboard.
    2. If you know how to read a circuit diagram, you can assemble your circuit based on Figure 1 in the introduction instead. See the How to Read a Schematic tutorial from SparkFun Electronics to learn about reading circuit diagrams.
    3. Connect the red and black wires from the battery holder to the breadboard's positive (+) and ground (-) buses respectively.
    4. Insert the 4011 chip into rows 1–7, so it straddles the gap in the middle of the breadboard.
      1. Note: the chip's pins are numbered from 1–14, starting in the upper left and going counterclockwise.
    5. Use a jumper wire to connect pins 1 and 14 to the breadboard's positive bus (although red is traditionally used to represent positive in electronics, you do not have to use a red wire if your kit does not have a red wire of the right size).
    6. Use a jumper wire to connect pin 7 to the ground bus (although black is traditionally used to represent ground in electronics, you do not have to use a black wire if your kit does not have a black wire of the right size).
    7. Use the 10 MΩ resistor (brown, black, blue, and gold stripes) to connect pin 2 to the ground bus.
    8. Use the 470 Ω resistor to connect pin 3 to row 10 on the breadboard.
    9. Use the LED to connect row 10 on the breadboard to the ground bus. The LED's long leg should go in row 10, and the short leg should go in the ground bus.
    10. Connect one lead of a 100 kΩ resistor to pin 1, and leave the other end free.
    11. Connect one lead of a 100 kΩ resistor to pin 2, and leave the other end free.
    12. Your completed circuit should look like the one in Figure 3.
breadboard diagram for rain detector circuit
Figure 2. A breadboard diagram for the rain detector circuit.

prototype of a rain detector circuit
Figure 3. A completed rain detector circuit.
  1. When you have completed assembling the circuit, the LED should light up. If it does not light up, check your wiring carefully.
  2. Cut the sponge into two parts (square shapes).
  3. Soak one piece of sponge in tap water. Keep the other piece dry.
  4. Touch the wet sponge to the two free leads from resistors R1 and R2. What happens?
  5. Touch the dry sponge to the two free leads from resistors R1 and R2. What happens?
  6. For your science fair display board, note that turning on the power to your circuit is equivalent to the sprinkler system's timer starting the sprinkler. The LED shows whether or not electricity is flowing. When the LED is on, the sprinkler would be on.

Share your story with Science Buddies!

I did this project I Did This Project! Please log in and let us know how things went.


  • Use a multimeter (available at Amazon.com) to measure voltages at various points on the circuit when the sponge is wet or dry. This will allow you to show that if when the sponge is wet, there is a 9-V drop from both positions 1 and 2 on the chip, compared to ground.
  • Use your circuit to control a solenoid valve (a type of valve that can be controlled electronically) to make a model of a sprinkler system. You will need to do some more research on how to control a solenoid valve. Unlike an LED, which only draws a very small amount of current, a solenoid valve can draw a larger amount of current and require a transistor to power it, in addition to the 4011 chip.
  • The 4011 chip has 4 NAND gates. Can you use the chip to create a "multi zone" sprinkler system that detects moisture in four different areas? The data sheet for the chip can help you figure out what the other pins do.
  • How would you modify the circuit to turn something on when it rains, such as a buzzer?
  • What is the maximum distance the two probe wires can be separated? Does this distance vary with distilled water vs. rain water?

Share your story with Science Buddies!

I did this project I Did This Project! Please log in and let us know how things went.

Ask an Expert

The Ask an Expert Forum is intended to be a place where students can go to find answers to science questions that they have been unable to find using other resources. If you have specific questions about your science fair project or science fair, our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.

Ask an Expert

Related Links

If you like this project, you might enjoy exploring these related careers:

female environmental engineer measuring streamflow

Environmental Engineer

Environmental engineers plan projects around their city or state—like municipal water systems, landfills, recycling centers, or sanitation facilities—that are essential to the health of the people who live there. Environmental engineers also work to minimize the impact of human developments, like new roads or dams, on environments and habitats, and they strive to improve the quality of our air, land, and water. Read more
electrical engineer aligning laser

Electrical & Electronics Engineer

Just as a potter forms clay, or a steel worker molds molten steel, electrical and electronics engineers gather and shape electricity and use it to make products that transmit power or transmit information. Electrical and electronics engineers may specialize in one of the millions of products that make or use electricity, like cell phones, electric motors, microwaves, medical instruments, airline navigation system, or handheld games. Read more
Energy efficiency engineer testing pumps

Energy Engineer

How much energy do you think all the houses and buildings in the United States consume? It turns out they eat up 40% of all the energy that the U.S. uses in a year. The figure is high because all those houses and buildings need to be heated, cooled, lit, ventilated, and supplied with heated water and electricity to run all sorts of electrical devices, appliances, and computers. Energy efficiency engineers help reduce the energy that houses and buildings use. This saves families and businesses money, and lowers the emissions of greenhouse gases that contribute to global warming. Read more
woman examining graphs

Sustainability Specialist

Are you passionate about the environment? Do you like developing and implementing new ideas? Do you enjoy talking with people about how humans impact nature? If these things are true about you, then you may be the ideal candidate for a job as a sustainability specialist. Sustainability specialists work in large and small corporations and universities to design and execute energy and resource conservation programs that reduce their employers' impact on the environment. This is a great career for people who enjoy working on teams, are socially responsible, and like to get things done! Read more

News Feed on This Topic

, ,
Note: A computerized matching algorithm suggests the above articles. It's not as smart as you are, and it may occasionally give humorous, ridiculous, or even annoying results! Learn more about the News Feed

Looking for more science fun?

Try one of our science activities for quick, anytime science explorations. The perfect thing to liven up a rainy day, school vacation, or moment of boredom.

Find an Activity