Arduino Water Pollution Monitor





Introduction: Arduino Water Pollution Monitor

This project will allow you to create your own conductivity sensor and use an Arduino to gather data about the pollution levels of your community water sources! Understanding this data will help you understand how different events in and around your community effect the pollution level of your local water sources.

My hope is that this will be a fun and fairly inexpensive project middle or high school students can complete to become more involved in understanding and impacting community water sources such as creeks and rivers. These waterways can flood in heavy rains, leading to trash and other harmful pollutants finding their way into the water. Additionally, companies often dump waste into these rivers, which can negatively effect their quality and the ecosystems that rely on them.

While this project is meant to help students understand the levels of water pollution, and get them involved in the community surrounding that water, it also brings in several math, science, and computer science themes.

Step 1: Gather Your Materials

Here's what you'll need for this project:

  1. Computer with internet access
  2. USB cable
  3. Arduino Uno
  4. 9 volt battery
  5. 9 volt battery connector
  6. disposable pen
  7. electrical tape
  8. 2x 22 gauge single strand insulated copper wire
  9. 2x 10cm lengths of 32 gauge nichrome wire
  10. wire strippers (not pictured)
  11. soldering iron (not pictured)
  12. lead-free solder (not pictured)

Step 2: Make Sure You Have Arduino Installed

In order to program your creation, you'll have to have the Arduino programming environment available on your computer. Here's where the internet comes in! You'll find detailed instructions on how to install Arduino for your operating system here:




Step 3: Break Down Your Pen

You'll need to prepare your disposable pen for use. To do this, remove the top, then pull out the spring and ink cartridge. All that should remain is the plastic tube.

Step 4: Prepare Your Wires

In order to make your conductivity sensor, you'll have to solder(pronounced "saw-der") two wires together. In order to do this, you'll need to strip a small section of your wire. "Stripping" your wire is when you take some of the insulation material(the black and white stuff in the picture above) off of the copper wire that is inside of it. We're doing this today so that the copper wires can touch the other metal wires we will be soldering to them. Be careful to only do this to one end of each wire. We will need the plug the other end into something later.

Step 5: Twist Your Wires Together and Solder!

For this step, you'll need the two wires you just stripped, and the two pieces of nichrome wire.

Twist the top 3cm of the nichrome wire around the exposed copper wire. Repeat this for your other color wire(my photos only show the white one, but I repeated the same step for my black wire too).

Next, you'll need to solder these wires together. PLEASE BE VERY VERY CAREFUL!!!

This must be done with adult supervision. Soldering irons are extremely 600 degrees! You can badly burn yourself if you aren't careful, so please have an adult know knows how to solder watching you at all times. If you have never soldered before, it is best to have an adult do this part and teach you while they do.

Step 6: Attach Your Wires to Your Pen

Here is where we finish our conductivity sensor!

You will need to attach the wires you just soldered to your pen. You'll do this using the electrical tape from Step 1.

The important thing here is that you do not let the wires toucheach other on the pen. Make sure you tape them on opposite sides of the pen, as shown in the picture.

Then, take your wire strippers and cut the wire so that it does not stick out past the bottom of the pen.

Leave that electrical tape out! You'll need it for the next step!

Step 7: Finish Taping Your Wires Down

Wrap a small piece of electrical tape around the bottom of the pen, securing the bottom of the wires to the pen.

Then, wrap tape down your pen making sure the wires are not touching, until you are approximately 1 millimeter away from the top of the piece of tape you put on the bottom of the pen.

Allowing this small amount of nichrome wire to be exposed is what allows us to measure the conductivity of the water. The electrical tape is to protect us from the electricity and heat that comes from the wires, so make sure to only touch the tape once they're plugged in to a battery!

Step 8: Plug Your Sensor Into Your Arduino Board

Now we will wire our sensor into the Arduino board. Its safe to touch everything at this point, because there is no power running through the wires.

One wire will be plugged into the 5v port on the Arduino board. The other needs to be plugged into the A0 port on the Arduino board.

The wires I used in the example are short, yours will be longer if you go by the materials list.

Step 9: Plug in Your Battery Connection

It is still safe to touch wires, as we don't have a battery in this step.

Get your 9 volt battery connector, and plug the red wire into "vin" and the black wire into one of the two "GND" ports next to it.

Step 10: Time to Write Some Code!

In this step, you'll need to open your Arduino programming environment and write a program!

First you will need to open Arduino on your computer. You should see a window come up that looks something like the photo above. You'll need to type in the code exactly as you see it in the photo.

Once you have finished typing your program, you can plug the Arduino board into your computer's USB port using the USB cable. To do this, plug in the board and click the arrow in the top left hand corner to upload your program onto the board. If this process was successful, you should see "Done Uploading" written in the bottom left of the programming environment.

You're almost ready to test your creation!

Step 11: Test Your Water!

Now, with your Arduino still plugged into your computer, plug the 9 volt battery into the battery connector on the Arduino. Be careful not to touch the exposed nichrome wire on the conductivity sensor.

Open the Serial monitor on your computer by clicking the magnifying glass in the top right hand corner of your Arduino programming environment. This is where you can see the data your sensor is reading!

Now you can dip your sensor in water to get an idea of how polluted it might be!

This project was specifically designed to test the pollution of creek water, but can be used in many different types of water.

Step 12: What Do These Numbers Mean?!

Well, according to this definition of water quality parameters:

Most streams have conductivity ranging from .05 to 1.5 volts. (I did some math here to convert microsiemens per centimeter to volts)

Freshwater streams should have a conductivity between .15 and .5 volts. (again, math)

Now, when you test your local creek or river, you have some idea of what numbers your conductivity sensor should be reading! If you find your readings are higher than those ranges, it might be worth it to investigate where some of those pollutants may be coming from! Was there a big storm that sent lots of trash down river? Did somebody dump something in the river that caused the spike? Understanding these readings can begin to help you understand the impact people have on the the quality of community water systems!

I hope you had fun doing this project, I know I did! This is my first instructable and was for a class project, so please feel free to leave feedback...I'm always looking to improve!

Note: This project can absolutely be extended to include a much more complex representation of the data. You could include an LCD screen on your Arduino so that you don't need to be tethered to your computer to see the sensor readings. You could create a visualization program that maps the pollution data over time, and connect spikes or drops to events in and around your community. Have fun and make it your own!



    • Clocks Contest

      Clocks Contest
    • Oil Contest

      Oil Contest
    • Casting Contest

      Casting Contest

    We have a be nice policy.
    Please be positive and constructive.




    Excellent, wel written, but you are not really measuring pollution (but i presume you know), but conductivity.
    That's related to the amount of ions in the water but that is not indicative for pollution

    4 replies

    You're correct! My goal for this project was just to get young people involved in understanding things that impact the quality of community space. While conductivity doesn't directly measure "pollution" it does give an idea of the "purity" of the water which can be extended to a rudimentary idea of the quality of that water. The average ranges provided also serve to help put those numbers in context.

    Hi! I have typed the code in exactly as shown but Arduino is telling me invalid opernads of types 'const char [21] and 'float' to binary 'operator+'. Could you help me with this problem please? Thank you for your time.

    Did you figure this out? I am having that exact issue.

    You don't get young people interested by feeding them false information. Quite the opposite is true. After 50 years in the physical sciences I know this to be true.

    excellent piece!

    But why nichrome wire , can I use any other wire ?


    Im torn between the two- Should I used Pi or Arduino for outdoor pollution monitoring?
    I have roughly a budget of $120 USD per node. Can I use both of them together?

    - If pi. What do you do about battery conservation?
    Pushing data to a webpage recomendations?
    Uploading data?

    What sensors should I use? Ive seen someone trying to sell a single CO2 sensor for $50 USD?!?
    CO2, NO, CO, NO2 sensor suggestions?
    Ive been looking at grove
    Some will be battery powered. others by the mains. im going to try 3D print a case for weatherproofing.

    2 replies

    Check out my instructable at it should help solve your problem!

    you can go for the MQ series sensors...they are for all types of gases

    Can you give me the maths to convert microsiemens per centimeter to volts? Thanks you very much :D

    A couple of points:

    1) I agree with Bendaski - your sensor is essentially a variable resistor, with one end attached to the supply voltage. The other is connected to an analog input pin which is trying to read a voltage. To establish a voltage for the pin to read, the circuit should have an independent, resistive path to ground (the negative pole of your power source.) That way it can act as a voltage divider and the voltage read will be the voltage drop caused by your sensor.With your circuit the measurement pin has to provide the path to ground and all the current thru the sensor will have to pass thru the measurement pin - not what it is designed to do. It would be like using a voltmeter to read the potential of a floating wire in a circuit. I'm not clear on why he says it will drift - can someone explain that? Could it be that the nichrome wire is heating and cooling as the water flows around it? If it drifts, you will need to take measurements over time to get an average.

    2) thermal considerations? The nichrome wire heats up when current flows thru it. I wonder how the readings of this circuit will vary with the temperature of the water you are measuring. Have you checked for the effect of water temperature on the readings you get?

    3) would you share the conversion mathematics you used?

    4) The conductivity is indeed a measure of the water's purity. Distilled water (the "purest" water) should have the lowest conductivity - (minimal ions.) Any additional ionic materials (making the water less "pure") will raise the conductivity. This is not to say that this technique is an absolute measure of the water's purity, because the are many other, non-ionic forms of pollution (i.e.,organic chemicals.)

    Nice, but you NEED to add a resistor between analog in and GND. The analog input doesn't measure current but voltage. So you must make a voltage divider with the sensor and a resistor. Now your sensor does probably register something, but it will drift like hell.

    an excellent project, thank you.

    It would be helpful if you could provide a link to where one could purchase the nichrome wire and the non-lead solder in small quantities - it would be a waste to have to purchase more of these products than needed to make a few of these sensors.

    Thinking about making one with a real time clock and a decent flash memory so a stream could be sampled & data stored for days at a time.

    1 reply

    Sounds fantastic! I will certainly look into updating this with some links to those materials in the near future. Thanks for your feedback!

    I agree this would be a fantastic project for middle or high school aged kids. They could really learn a lot about the environment and how many pollutants there really are! Thanks for sharing this with the community!! I can't wait to see what you come up with next!