Sensor to Measure Hardness of Water

by Mitali in Workshop > Home Improvement

1339 Views, 2 Favorites, 0 Comments

Sensor to Measure Hardness of Water

Screenshot 2021-09-17 at 11.49.27.png

By Annika Schalk and Mitali Uke

Hardness of water is the amount of metallic ions, mostly calcium and magnesium in the water. Hardness affects the taste of water and also may cause dry skin or rough hair issues.

During our research, we mainly focused on drinking water. There are many conventional ways to measure the hardness of water like soap kits, colorimeters, ion detectors and test strips.


Introduction to our sensor for measuring the hardness of drinking water

The hardness of water is measured using test strips. This sensor detects the change in color of the test strip when immersed in water and determines the hardness based on the color chart. The unit of hardness using the color chart is parts per million (ppm).


Principle and model

The test strip is made of paper with a chemical present on it which changes its color everytime it comes in contact with different concentrations of ions. The strip has to be dipped in water for two seconds and dried for thirty seconds. After this, the color has to be compared with the standard color chart provided on the strip packet. We used a RGB sensor which would sense the changed color and provide results. As the sensor will detect the color, it will compare the various values possible with the help of the program we code. Once the color is known, we know the hardness, and it will be displayed using LEDs. We will display three possibilities - low hardness (when blue LED lights up), medium hardness (when orange LED lights up) and high hardness (when red LED lights up). A small motor has the test strip attached to it on the top which helps the strip to reach the RGB sensor. When the test strip comes in contact with the RGB sensor, a value for color temperature is recorded. Boundaries for the 3 types of hardness are applied and the LEDs display the required result.

Supplies

  • Arduino uno
  • Hardness test strips
  • Water samples (distilled, tap and a mix of the two)
  • Resistor 220 Ω x 3
  • Resister 10K Ω
  • RGB sensor
  • Button
  • Conducting wires
  • Breadboard
  • Paper cup x 3
  • LEDs (red, blue and orange)
  • Kitronik linear actuator kit
  • Wooden block
  • Cardboard box
  • Stirrer
  • 1.5 V battery x 6
  • Battery holder
  • Duct tape
  • Normal tape
  • Scissors
  • Rubber band
  • Hot glue gun

Connecting the Motor to the Circuit

Screenshot 2021-09-13 at 09.13.19.png

Firstly, the motor has to be added to the circuit. The arrangement of the apparatus is shown in the figure. The code for this motor can be found by clicking on File>> Examples >> Servo >> Sweep. The code can be verified and uploaded to the arduino. Make sure that the Arduino is connected to the laptop and the correct port and board has been selected in the Tools tab.

Make the Motor Work According to Requirement of This Experiment

Screenshot 2021-09-13 at 10.48.03.png

After uploading the code, the motor will start working. Now we have to make sure the motor works only when we press the button. Therefore, the circuit in the picture above is arranged. The motor is required to place the strip near the sensor for a few seconds and to get the strip out. According to this requirement, a delay of 7 seconds is added before the motor moves out the box. While taking a measurement, the strip has to be first manually immersed for 2 seconds and dried for 30 seconds.

Connecting RGB Sensor to Arduino

Screenshot 2021-09-17 at 12.23.45.png

Next step is to add the RGB sensor to the circuit. It is recommended to first test the sensor on a different Arduino to understand how it works. And later it can be added to the main circuit. The connection to add the RGB sensor can be seen in the provided figure.

Adding RGB Sensor to the Circuit

Screenshot 2021-09-13 at 10.50.59.png

Now the RGB sensor is added to the circuit and the sensor is able to first make the motor move down, wait for 2 seconds and the RGB sensor will sense the color and note the values. The values are now visible in the serial monitor of the laptop. The circuit of the sensor now looks like the figure below.

Placing the LEDs in the Circuit

It is not possible to always have the arduino connected to a laptop and hence it is important to add LEDs to indicate the results. Soft, medium and high hardness water is considered for this study and hence strips have to be tested for each sample to note the color ranges. The RGB sensor presents the results based on the color temperature, so with each sample the boundaries have to be determined.

Arranging the Components

Furthermore, the apparatus has to be arranged in a way such that the test strip can easily be in contact with the RGB sensor. Combining all of the components of this sensor, a slit is made on one side of the sensor as an input for the test strip. The exact location where the colored part at the end of the strip ends up, another slit is made on the top of the cardboard box to place the RGB sensor.

Final Arrangements and Testing

WhatsApp Image 2021-09-17 at 12.28.25.jpeg

The cardboard box is carefully secured on the wooden block using duct tape. The motor has to be glued to the wooden board near the slit. Place the breadboard on the cardboard and the arduino next to it.Make sure that the RGB sensor is not disturbed during this placement. Finally, add the batteries to the holder and placed them near the arduino. The arduino code for the sensor is provided below.

The sensor is ready to be tested!