For two years, the people of Flint, Michigan were unwittingly drinking water contaminated by lead in poisonous concentrations. The residents had no idea that they were drinking water that could and would eventually lead to several serious medical conditions. They had no way of verifying that the dirty and off-smelling water was safe like the government told them.

Most current lead testing devices are kits that are single use and need to be sent to a lab, using time and money. Our goal is not only to create an affordable and accurate lead detection system, but to keep a real time graph of lead levels that can be easily accessed from the Internet. Not only is our system for long-term use, there is no hassle of sending it to labs because the readings come at a constant interval.

What it does

The carbon paste electrodes (CPE) from the study, “Determination of Pb2+ ions by a modified carbon paste electrode based on multi-walled carbon nanotubes (MWCNTs) and nanosilica,” detect Pb2+ ions in an aqueous solution. A voltage is created from this interaction. The NodeMCU circuit measures the amount of voltage from the lead (from a potentiometer in these tests) and prints out the voltage amount every 30 seconds. This data is sent to Adafruit IO but also our website, which can be accessed with Internet connection.

The voltage is based on the concentration of lead, so theoretically, the amount of voltage measured can be correlated to how much lead is in the water. The NodeMCU detects the voltage and sends it to the Arduino code sensor. This is sent to a live feed at Adafruit *(link below) and can be accessed from the website (in Github).

How we built it

We learned about the Arduino and NodeMCU. We connected the NodeMCU to a breadboard, and since the voltage is 3.3V and we need it to be on a scale of 0 to 1V, we added two resistors of 220 ohms and 470 ohms. We connected the 3.3V, the Grounded, and the A0 pins to the circuit. We used a potentiometer to replace the lead detecting electrode. This is to verify that the NodeMCU picks up voltage information, which it does.

Then, we created a model website to display this information to the public and to the user of the device. It shows the live feed of voltage. This would be useful when implemented in a pipe, so that the government can consistently check the lead levels. People can also make sure the water supply is clean for their children and safe for consumption.

Challenges we ran into

Our first step was figuring out how to detect lead in water. Through research, it seemed very difficult to find a chemical that reacted with lead safely and in a clear way. Fluorine reacts with lead (but “vigorously”). Chlorine reacts but it is endothermic. We thought about Sodium rhodizonate, which police use to determine bullet residue, and it causes a color change. However, that is not easily detectable by arduinos.

Also, we had to figure out how to process that information. Luckily, we took classes on Arduino and The Internet of Things, which gave us the idea to use the NodeMCU with the Arduino coding language.

Lastly, we had to figure out how to display it to the users. We created a website using HTML, which I (Sunny) learned for the first time today. Making the graphics and links work took some time, but we overcame the challenge.

There was difficulty publishing the code we wrote for the website, even though it works on my computer. So, we included the raw files that can be downloaded onto another computer.

Accomplishments that we're proud of

This is my (Sunny's) first Hackathon and Nithya's second. We are a two-girl team that is relatively inexperienced, and in less than 24 hours, we were able to: -brainstorm ideas -research properties of lead and methods for detection -take classes and get ideas (Arduino and Internet of Things) -learn HTML and website making -learn about Arduino structure and capabilities -use Arduino coding language -modify code in HTML and CSS -use Adafruit and Arduino for the first time -make a circuit with resistors, a potentiometer, and NodeMCU, connected by USB

What we learned

See above :)

What's next for Real Time Lead Detector for Water Supply

The goal location of this product would be for widespread municipal use. Attached to pipes that supply water, the lead water detectors would give a regular update on the lead levels in the water and warn citizens and government officials when the lead amount goes above the healthy amount (15 ppb). Currently, we will start with purchasable, single home detector. We want to expand it to municipal use.

Future improvements are making it cheaper and smaller (possibly a ring shape to fit around the faucet). It could also be tweaked to detect other types of contaminants in the water than just lead, and be accessed from phones and receive alerts if lead amount over healthy. We want to actually test with electrodes and lead solution.


NYC school water supply has not been tested in 10 years. There are problems being reported in Newark schools with drinking water. With this new innovation in water monitoring, there is regular testing (can set it to every hour, every day, etc.). There is transparency, because the information will be on the internet and be public domain; government and public will know everything. People can check for public health and safety.

The water crisis of Flint Michigan could have been prevented by consistent check of lead concentration in the water supply. Hopefully, this will revolutionize water infrastructure and ensure public health.

Built With

+ 2 more
Share this project: