🏆
International Research Press
Serving Researchers Since 2012

Smart Inline Water Purification System with UV-C Disinfection and Water Quality Monitoring using ESP32

DOI : 10.5281/zenodo.24858813
Download Full-Text PDF Cite this Publication

Text Only Version

Smart Inline Water Purification System with UV-C Disinfection and Water Quality Monitoring using ESP32

Nisha Rakesh Ganjave (PRN 2305109) Prof. Atul A. Kadam (Project Guide)

Department of Electronics and Telecommunication Engineering,

Rajarambapu Institute of Technology, Rajaramnagar, Maharashtra, India.

Abstract – This paper describes the design and prototype of a Smart Inline Water Purification System that treats water while it flows from the inlet to the outlet, so that no storage tank is needed. The treatment train consists of a steel mesh pre-filter, a reverse osmosis (RO) filter, an activated carbon filter and a UV- C disinfection unit. A TDS sensor and a turbidity sensor monitor the water, and an ESP32 microcontroller converts the sensor signals into ppm and NTU values, compares them with preset limits and shows them on an OLED display. The paper explains the working principle of each stage, the hardware, the monitoring circuit and the equations used to convert sensor voltage into TDS and turbidity values. In the prototype the OLED showed a TDS of 109 ppm and a turbidity of 0.9 NTU, which fall in the acceptable bands used in the project. These are single readings. Source-water comparison, flow rate, UV dose and microbiological tests have not yet been carried out, so the work demonstrates a working treatment and monitoring prototype and does not establish that the output water is safe to drink.

Keywords – water purification; inline filtration; UV-C disinfection; TDS sensor; turbidity sensor; ESP32

  1. ‌Introduction

    Clean drinking water is a basic need, but water that looks clear is not always safe. It can carry dissolved salts, fine suspended particles and microorganisms that cannot be seen, and one treatment step rarely removes all of them [1], [2]. Household treatment therefore usually combines more than one barrier, for example filtration followed by disinfection [2].

    Most domestic purifiers store the treated water in a tank. The tank takes up space and makes the unit harder to carry or to fit into a small area. An inline purifier avoids the tank because the water is treated as it moves from the inlet to the outlet. This suits portable, outdoor and emergency use, where a small and low-cost unit is more practical than a large one.

    This paper presents the design and prototype of a Smart Inline Water Purification System developed as a capstone project in our department. The water passes through a steel mesh pre-filter, an RO filter, an activated carbon filter and a UV-C unit. Alongside the treatment stages, a TDS sensor and a turbidity sensor measure the water and an ESP32 microcontroller shows both values on an OLED display. The objectives were to combine several treatment stages in one flow-through unit, to add UV-C treatment for microbial

    Pushkar Vaibhav Awati (PRN 2305077) Purva Nitin Kabade (PRN 2305098) Niharika Shrinivas Gokave (PRN 2305102) Department of Electronics and Telecommunication Engineering,

    Rajarambapu Institute of Technology, Rajaramnagar, Maharashtra, India.

    control, and to give the user a basic indication of water quality through sensors.

    Section II reviews the techniques behind each stage, Sections III to V describe the proposed system, its architecture and its hardware, and Section VI explains the working methodology and the calculations. Section VII reports what the prototype showed and what it does not yet show. Sections VIII to XI cover advantages, limitations, future work and conclusions.

  2. ‌Literature Review

    1. ‌Household water treatment

      The World Health Organization (WHO) publication on household water treatment evaluates treatment options against health-based targets and microbiological performance specifications [2]. It supports the idea of using several stages, and it also makes clear that results depend on the quality of the source water and that treatment units need regular maintenance. Systematic reviews of chemical and UV disinfection, such as [3], collect reported disinfection performance and help in choosing a disinfection stage.

    2. ‌Physical filtration and activated carbon

      A mesh or other physical filter holds back sand, rust and visible dirt, but it does not remove dissolved salts or microorganisms. Activated carbon works by adsorption, in which impurities stick to the porous carbon surface. Reviews of granular activated carbon and of activated carbon materials describe this mechanism and discuss performance and regeneration [4], [5]. Carbon capacity is finite, so the cartridge has to be cleaned or replaced from time to time.

    3. ‌Reverse osmosis

      In reverse osmosis, water is pushed under pressure through a semipermeable membrane that retains most dissolved salts. A separate reject stream carries the retained material away. Reviews of RO technology describe its principle, its uses and its practical difficulties [6], [7]. For a small inline unit, the points that matter are the pressure requirement, the water lost in the reject stream and the need to protect the membrane with a pre-filter.

    4. ‌UV-C disinfection

      UV-C radiation damages the DNA or RNA of susceptible microorganisms and stops them from multiplying. The US

      EPA guidance manual notes that the effect depends on UV intensity, exposure time, water clarity and the design of the reactor [8]. Cloudy water therefore reduces the benefit of UV, which is one reason to monitor turbidity. UV light emitting diodes have been studied for point-of-use disinfection of drinking water [9]. UV treatment does not remove dissolved salts or most chemical impurities.

    5. ‌TDS and turbidity monitoring

      TDS is a measure of the dissolved material in water and is commonly estimated from electrical conductivity, since dissolved salts raise conductivity [10], [11]. Turbidity describes how cloudy the water is because of suspended particles and is reported in nephelometric turbidity units (NTU). Both are covered in the WHO drinking-water guidelines [1]. They are useful indicators, but neither tells us which substances are present and neither detects microorganisms. The readings also depend on calibration.

    6. ‌Gap addressed by this work

    The studies above deal with one technology at a time. The system described here brings mesh filtration, RO, activated carbon, UV-C treatment and low-cost sensing into one portable inline unit controlled by a single microcontroller.

  3. ‌Proposed System

    The proposed unit connects to a tap or a pipe and treats the water as it flows, so no storage tank is required. The water passes through four treatment stages in sequence: a steel mesh pre-filter, an RO filter, an activated carbon filter and a UV-C chamber. The order is chosen so that each stage protects the next. The mesh stops coarse particles that could clog the RO membrane and the carbon bed, the RO membrane reduces dissolved salts, the carbon filter takes out some organic compounds together with the taste and odour they cause, and the UV-C stage acts on microorganisms that are still present [8].

    TABLE I. Design Targets of the Prototype (Not Measured Values)

    Item

    Design target

    Installation

    Tap or pipe attachment

    Operation

    Water treated while flowing; no storage tank

    Treatment stages

    Steel mesh, RO, activated carbon, UV-C LED

    Monitored parameters

    TDS (ppm) and turbidity (NTU)

    Controller, display

    ESP32, OLED

    Flow rate

    About 1 L/min for initial testing

    UV chamber volume

    50 mL (illustrative)

    Nominal residence time

    About 3 s at 1 L/min (calculated)

    Power

    Battery with voltage regulator; voltage to be chosen for the sensors and UV-C driver

    Housing

    Water-compatible plastic or similar material

    Safety

    Sealed UV-C chamber, isolated electronics

  4. ‌System Architecture

    Fig. 1 shows the water path. Water enters through the inlet connector, passes the steel mesh, the RO filter and the activated carbon filter, flows through the sensing section where the TDS and turbidity sensors sit, and then goes through the UV-C chamber to the outlet. This order follows the implementation flow figure of the project report. The written description in the same report places the UV-C stage before the monitoring, so the exact position of the sensors still has to be fixed and tested (Section IX). The report also describes the steel mesh as the first stage in its text but does not draw it in the flow figure, so the mesh is drawn with a dashed outline here.

    A TDS sensor and a turbidity sensor are placed in the water path. An ESP32 reads them, converts the readings to ppm and NTU, checks them against preset limits and shows them on a small OLED screen. In the prototype described in the report, the OLED output is the main product of the monitoring. Switching parts of the system from sensor data is listed only as a possible extension (Section X).

    Table I lists the design targets. They are planned specifications and have not been verified by measurement in the work reported here. The nominal residence time in the table follows directly from the assumed chamber volume and flow rate (50 mL divided by 1 L/min gives about 3 s). It is not a measured value and it does not by itself give a UV dose.

    Fig. 1. Water path of the proposed inline purifier. The dashed box marks the mesh stage, which is described in the report text but not drawn in its flow figure.

    The electronic path is shown in Fig. 2. Each sensor gives an analog voltage. After signal conditioning, the voltage goes to an ADC input of the ESP32. The firmware calculates the TDS and turbidity values, compares them with the threshold bands and sends the values to the OLED display. A battery with a voltage regulator powers the ESP32, the sensor modules and the UV-C driver.

    Fig. 2. Monitoring path from the sensors to the OLED display.

  5. ‌Hardware and Components

    Fig. 3 shows the main components used in the prototype and Table II summarizes the role of each part.

    Fig. 3. Prototype components: (a) RO filter, (b) activated carbon filter, (c) UV-C unit, (d) TDS sensor, (e) turbidity sensor and (f) ESP32 board.

    TABLE II. Components and Their Roles

    Component

    Role

    Steel mesh pre-filter

    Holds back sand, rust and visible dirt

    RO filter

    Reduces dissolved salts and minerals through a semipermeable membrane

    Activated carbon filter

    Adsorbs some organic compounds; reduces taste and odour

    UV-C LED unit

    Inactivates susceptible microorganisms when the UV dose is adequate

    TDS sensor

    Estimates dissolved solids in ppm

    Turbidity sensor

    Measures cloudiness in NTU

    ESP32

    Reads the sensors, calculates values, compares thresholds, drives the display

    OLED display

    Shows the TDS and turbidity values

    Battery, regulator

    Power for the electronics and the UV-C driver

    Housing, connectors, drain, seals

    Compact body, tap connection, sediment removal during maintenance, leak protection

    1. ‌Steel mesh pre-filter

      This is the first stage. It holds back sand, rust and visible dirt before they reach the membrane and the carbon bed. It cannot remove dissolved salts or microorganisms, but it is cheap and easy to clean.

    2. ‌RO filter

      The RO filter (Fig. 3(a)) contains a semipermeable membrane with very small pores. Water is forced through it

      under pressure, and many dissolved salts and minerals stay behind and leave through a separate reject outlet [6], [7]. The filter needs enough inlet pressure, wastes some water in the reject stream, can be blocked by scale or dirt, and may also remove useful minerals. The pre-filter reduces the risk of damage to the membrane.

    3. ‌Activated carbon filter

      The carbon filter (Fig. 3(b)) has many small pores with a large surface area. Chlorine-related taste and odour, and some organic compounds, are adsorbed on this surface [4], [5]. The filter does not remove dissolved minerals, all heavy metals or microorganisms, and its performance falls once the surface is used up, so timely replacement matters.

    4. ‌UV-C unit

      Water flows through a closed chamber lit by a UV-C LED (Fig. 3(c)). The radiation damages the genetic material of susceptible microorganisms [8]. For this to work the intensity and the exposure time must be sufficient, and very cloudy water reduces the effect. The LED cannot be driven directly from an ESP32 pin and needs a driver or relay circuit, and the source must be enclosed so that people are not exposed to the radiation.

    5. ‌TDS sensor

      The analog TDS module (Fig. 3(d)) measures the conductivity of the water. Dissolved salts and minerals raise the conductivity, and the module output is converted into an estimate of TDS in ppm [11]. It does not show which substances are dissolved, it cannot detect microorganisms, and its reading is affected by temperature and by the condition of the probe.

    6. ‌Turbidity sensor

      The turbidity module (Fig. 3(e)) contains a light source and a light detector. Particles in the water scatter the light, and the output voltage changes with the turbidity. The reading can be disturbed by the sensor position, dirt on the sensor surface and air bubbles.

    7. ‌ESP32 and OLED display

      The ESP32 board (Fig. 3(f)) is the main controller. Its ADC has 12-bit resolution, which gives readings from 0 to 4095, and its analog inputs work with voltages up to 3.3 V [12]. The 4.2 V output of the turbidity module is therefore brought into range with a resistor divider (Section VI). The board also has built-in Wi-Fi and Bluetooth, which makes later IoT extensions possible. An OLED display shows the TDS and turbidity values.

    8. ‌Power supply and housing

    A battery and a voltage regulator supply the ESP32, the sensor modules and the UV-C driver. The filters and the UV-C chamber sit in a plastic housing with inlet and outlet connectors, a dirt drain for removing sediment during maintenance, and waterproof seals that keep the electronics away from water.

  6. ‌Working Methodology

    1. ‌Treatment sequence

      Water flows continuously through the stages in Fig. 1. Nothing is stored. Apart from the outlet, the only water that leaves the unit is the reject stream of the RO stage.

    2. ‌Converting ADC readings to voltage

      The ESP32 reads each sensor voltage with its 12-bit ADC and converts the count to volts using

      V = (ADC Ă— 3.3) / 4095 (1)

    3. ‌TDS calculation

      The TDS module gives a voltage that rises with conductivity. The firmware converts it with the polynomial given for the analog TDS module at 25 °C [11]:

      TDS = (133.42V3 255.86V2 + 857.39V) Ă— 0.5 (2)

      where V is the temperature-compensated sensor voltage in volts and TDS is in ppm. As a design example, an assumed ADC reading of 1500 gives V = 1.209 V from (1) and TDS of about 449 ppm from (2). This is a calculation with an assumed input and not a measurement.

    4. ‌Turbidity calculation

      In the worked example of the report, the turbidity module output is 4.2 V. A divider with the ratio 22/(10 + 22) brings it into the ADC range:

      VADC = 4.2 Ă— 22 / (10 + 22) = 2.8875 V (3)

      The report converts the sensor output voltage to turbidity with a quadratic relation for the DFRobot SEN0189 module:

      NTU = 1120.4V2 + 5742.3V 4352.9 (4)

      Here V is the sensor output voltage before the divider, 4.2 V in the example, which gives about 0.904 NTU. The report does not cite a source for these coefficients. A fitted relation of this kind holds only inside the voltage range over which the module was calibrated, so the coefficients should be checked against the module documentation and calibrated before the values are relied on.

    5. ‌Threshold comparison and display

    The firmware compares the calculated TDS and turbidity with fixed bands: acceptable, exceeds the acceptable limit, and high-contamination warning (Table III). The values are then shown on the OLED display.

  7. ‌Results and Discussion

    1. ‌Prototype and display output

      Fig. 4(a) shows the assembled housing of the prototype, and Fig. 4(b) shows the OLED, mounted in a separate dark enclosure, with its TDS and turbidity lines. The display reads 109 ppm for TDS and 0.9 NTU for turbidity.

      Fig. 4. Prototype: (a) assembled housing, (b) OLED showing the TDS and turbidity readings.

    2. ‌Monitored values

      Table III compares the displayed values with the bands used in the project. Both values fall in the acceptable band: 109 ppm is well below the 500 ppm limit for TDS, and 0.9 NTU is below the turbidity limit, which the report gives as a range of

      1.2 to 1.5 NTU.

      TABLE III. Monitoring Bands Used in the Project and the Displayed Values

      Parameter

      Acceptable

      Exceeds limit

      High warning

      Displayed value

      TDS

      500 ppm

      5012000

      ppm

      > 2000 ppm

      109 ppm

      Turbidity

      1.21.5

      NTUa

      > 1.55

      NTU

      > 5 NTU

      0.9 NTU

      a Written as a range in the report, so the exact boundary is not fixed. The report does not cite a source for the bands.

      These numbers show that the sensing chain works from the sensors through the ESP32 to the display, and that the water measured at that moment lay inside the project bands. They support less than they may seem to. The report gives one reading per parameter and does not state the TDS or turbidity of the source water, so no removal efficiency can be claimed. A TDS of 109 ppm is consistent with RO treatment, but it cannot be credited to the RO stage, because tap water may itself be low in dissolved solids. A turbidity reading also says nothing about microorganisms, and no microbiological test was done.

    3. ‌Calculated examples and displayed values

      The methodology chapter of the report contains an example OLED output of 449 ppm and 2.790 NTU. The 449 ppm follows from the assumed ADC reading of 1500 in Section VI, and the 2.790 NTU is not reproduced by the turbidity calculation, which gives 0.904 NTU. These two numbers therefore look like illustrative layout examples and not measurements, and they are kept apart from the displayed readings of 109 ppm and 0.9 NTU. The displayed 0.9 NTU agrees with the 0.904 NTU of the worked example, but the report does not record the sensor voltage during the measurement.

    4. ‌Points still open in the project record

      Besides the sensor position and the missing mesh in the flow figure (Section IV), the report describes the threshold check once in terms of reference voltages and once as firmware

      working on calculated values. We have followed the firmware description. The report also lists flow rate, energy use and ESP32 response time as quantities that can be observed, but it gives no values for them. The UV chamber volume and residence time are design figures, and no UV intensity or dose is reported.

    5. ‌Testing still required

      To turn the prototype into a validated purifier, the following tests are needed:

      • inlet and outlet TDS and turbidity for several source waters, with repeated readings, so that removal can be calculated;

      • calibration of both sensors against standard solutions or a reference meter, including the effect of temperature;

      • measurement of flow rate, inlet pressure, RO reject fraction and power consumption;

      • UV-C intensity and dose verification for the actual chamber and flow rate;

      • microbiological testing of treated water, preferably in an accredited laboratory;

      • long-term tests of filter life and of sensor drift.

  8. ‌Advantages and Applications

      • No storage tank, so the unit is compact and easy to install and carry.

      • Several treatment stages are combined in one flow path.

      • UV-C treatment needs no added chemicals.

      • TDS and turbidity are displayed on the unit, so changes in the water can be noticed quickly.

      • The filters are meant to be easy to reach for cleaning or replacement.

      • The ESP32 leaves room for later additions such as wireless reporting.

        If the testing listed above is completed, the unit may be suitable for household taps, outdoor use and emergency situations where a small, low-cost purifier is needed.

  9. ‌Limitations

      • The evidence is limited to one displayed reading per parameter. There is no comparison with source water and no flow, energy, UV-dose or microbiological data.

      • TDS and turbidity are indicators only. They cannot show that water is free of microorganisms or harmful chemicals, so the unit cannot be called a guarantee of safe drinking water.

      • The RO stage needs adequate pressure and produces a reject stream. The carbon filter and the membrane lose performance with use. UV-C works well only if the water is clear and the dose is sufficient.

      • The sensor position relative to the UV-C stage, the presence of the mesh in the flow figure, the source of

        the threshold bands and of the turbidity coefficients, and whether the ESP32 switches the UV-C unit in the prototype are not settled in the report.

      • The accuracy of the readings depends on sensor calibration, temperature and cleanliness of the probes.

  10. ‌Future Scope

    The built-in Wi-Fi of he ESP32 can be used to upload readings to an online platform and to a mobile application for remote monitoring. A flow sensor would give the flow rate and the volume treated, and a UV intensity sensor would show whether the UV-C unit is working as expected. Filter-change reminders, pH and temperature sensors (the latter also for temperature compensation of the TDS reading) and sensor- based automation of the treatment can be added. On the hardware side, battery backup with better power management and a single printed circuit board would reduce wiring and size. Most important is the testing listed in Section VII, so that filtration efficiency, flow rate and UV-C exposure can be improved on the basis of measured data.

  11. ‌Conclusion

A Smart Inline Water Purification System has been designed and built as a prototype. It combines a steel mesh pre- filter, an RO filter, an activated carbon filter and a UV-C unit in one flow-through path, and it monitors TDS and turbidity with an ESP32 that shows the values on an OLED display. The prototype displayed 109 ppm and 0.9 NTU, both within the acceptable bands used in the project. These readings show that the monitoring chain works. They do not yet show how much the treatment stages improve the water, and they do not show microbiological safety. Testing with different source waters, calibrated sensors, measured flow and UV dose, and laboratory microbiological analysis is the next step.

‌Acknowledgment

The authors thank Dr. Mahadev S. Patil, Head of the Department of Electronics and Telecommunication Engineering, and Dr. P. V. Kadole, Director, Rajarambapu Institute of Technology, Rajaramnagar, for the facilities and support, and the staff of the department for their help.

‌References

  1. World Health Organization, Guidelines for Drinking-water Quality: Fourth Edition Incorporating the First and Second Addenda. Geneva, Switzerland: WHO, Mar. 2022.

  2. World Health Organization, Evaluating Household Water Treatment Options: Health-Based Targets and Microbiological Performance Specifications. Geneva, Switzerland: WHO, 2011.

  3. E. Wells, T. Bullick, G. Rao, P. Smeets, A. Hockin, J. Brown, J. DeFrance, and K. Linden, Systematic review of microorganism disinfection performance by chemical and ultraviolet light water treatment methods, Water Res., vol. 304, Art. no. 126294, Oct. 2026, doi: 10.1016/j.watres.2026.126294.

  4. J. Yuan, E. Passeport, and R. Hofmann, Understanding adsorption and biodegradation in granular activated carbon for drinking water treatment: A critical review, Water Res., vol. 210, Art. no. 118026, Feb. 2022, doi: 10.1016/j.watres.2021.118026.

  5. A. Srivastava, B. Gupta, A. Majumder, A. K. Gupta, and S. K. Nimbhorkar, A comprehensive review on the synthesis, performance, modifications, and regeneration of activated carbon for the adsorptive removal of various water pollutants, J. Environ. Chem. Eng., vol. 9, no. 5, Art. no. 106177, 2021, doi: 10.1016/j.jece.2021.106177.

  6. M. Qasim, M. Badrelzaman, N. N. Darwish, N. A. Darwish, and N. Hilal, Reverse osmosis desalination: A state-of-the-art review, Desalination, 2019, doi: 10.1016/j.desal.2019.02.008.

  7. L. F. Greenlee, D. F. Lawler, B. D. Freeman, B. Marrot, and P. Moulin, Reverse osmosis desalination: Water sources, technology, and todays challenges, Water Res., vol. 43, no. 9, pp. 23172348, 2009, doi: 10.1016/j.watres.2009.03.010.

  8. U.S. Environmental Protection Agency, Ultraviolet Disinfection Guidance Manual for the Final Long Term 2 Enhanced Surface Water Treatment Rule, EPA 815-R-06-007, Nov. 2006.

  9. G. Y. Lui, D. Roser, R. Corkish, N. Ashbolt, P. Jagals, and R. Stuetz, Photovoltaic powered ultraviolet and visible light-emitting diodes for sustainable point-of-use disinfection of drinking waters, Sci. Total Environ., vol. 493, pp. 185196, 2014, doi: 10.1016/j.scitotenv.2014.05.104.

  10. G. E. Adjovu, H. Stephen, D. James, and S. Ahmad, Measurement of total dissolved solids and total suspended solids in water systems: A review of the issues, conventional, and remote sensing techniques, Remote Sens., vol. 15, no. 14, Art. no. 3534, 2023, doi: 10.3390/rs15143534.

  11. DFRobot, Gravity: Analog TDS sensor (SEN0244) technical specifications, wiring diagram and calibration guide, DFRobot Wiki. [Online]. Available: https://wiki.dfrobot.com/sen0244/

  12. Espressif Systems, ESP32 series datasheet. [Online]. Available: https://documentation.espressif.com/esp32_datasheet_en.html