Almost all multi-storied buildings in Bangladesh contain a water tank in the roof and a water reservoir in the ground. An electric pump is used to pump the water from the reservoir to the water tank on the rooftop. In most of the building, the system is manual and a person manually turns off the pump when the water tank becomes full. This manual process always creates waste of valuable water and indirectly creates waste of electricity as well. An automatic system can solve the problem and save a large amount of water and electricity by automatically turning off the pump when the water tank becomes full and turning it on again when the tank needs to reload. Besides monitoring the water quality of the tank can give some important information about the water e.g. when to clean the tank.
IntroductionA few months back I was working with an automatic water monitoring and pump controller project. The main challenge I faced in that project was sending the sensor signal from the rooftop tank to the groundwater reservoir. I used a waterproof ultrasonic sensor to measure the water level of the tank and a pH sensor to measure the pH. Measuring those parameters was very easy but sending those values from the rooftop tank to the bottom pump of a multi-storied building was a real challenge. First, I tried with a low-cost radio transmitter and receiver but did not get a good response. Then I tried with nRF24L01 with an external antenna but still faced some issues because several concrete floors were present in between. Then I decided to use LoRa but Suddenly I came to know about Sparkfun single-pair ethernet module and MicroMod board for single-pair ethernet. I know this may be the perfect solution for this purpose because as it is a wired communication concrete floors and other barriers inside the building will not be a problem for the communication. As single-pair ethernet can work more than 1 km this can be used for all types of high-rise buildings. The SparkFun MicroMod Single Pair Ethernet Kit contains an Esp32 processor module that can be used to upload the data to the cloud so that water level, pump status, and water quality can be remotely monitored.
Recently, I received a SparkFun MicroMod Single Pair Ethernet Kit and in this project, I am going to use that kit for finishing my previous project. Instead of the ultrasonic sensor, I will use the SparkFun Distance Sensor for water level measurement because I found some power-related issues with the ultrasonic sensor. I hope the ToF range finder will be more power convenient than the ultrasonic range finder. For water quality monitoring I will use pH and ORP sensors. I will use the Arduino IDE for interfacing the sensors and controlling the pump. For remote monitoring, I will use the Blynk cloud platform.
Connection DiagramThe connection among the components from the tank side is as follows. Here I added a PH sensor and ORP sensor for measuring the water quality with the level of water which is measured by the TOF distance sensor.
The PH and ORP sensors provide analog output. There is no analog pinout from the SparkFun Micromod Board and we can only connect I2C devices with the board through the QWIIC connector. So, I used an ADS1115 module which is a 16-bit analog-to-digital converter module. The module is I2C compatible.
Hardware SetupAs there is no QWIIC port on the ADS1115 module for connecting this module with the SparkFun board I cut a QWIIC cable and soldered a 4-pin male header on one side.
Now I can easily connect the ADS1115 module with the QWIIC cable through a breadboard.
The following image shows the connection of ADS1115 module with the SparkFun MicroMod main board through QWIIC cable.
ADS1115 module has 4 analog inputs. We can connect up to 4 analog devices with this module. I connected a ph sensor and an orp sensor with A0 and A1 input of the module. See the image below.
The connection of the PH and ORP sensors with the MicroMod board is shown below. MicroMod Artemis Processor board and Single Pair Ethernet board are also installed in the main board.
For measuring the water level I used SparkFun TOF distance sensor. The sensor has two QWIIC ports on two sides of the board. One side is connected to the ADS module and another side is connected to the MicroMod main board.
Finally, I connected another MicroMod board through a single-pair ethernet cable. The MicroMod board which is connected to the sensor has an Artemis processor installed. The processor reads the pH and ORP level of the water and as well as measure the distance. These three parameters are then sent to another MicroMod board through the Single Pair Ethernet cable. The Receiver Board is connected with the Pump on the ground.
The receiver board has an ESP32 processor. A SparkFun QWIIC relay board is connected to the receiver side which is used to drive the water pump based on the water level sent by the transmitter board. The ESP32 processor has built-in wifi that is utilized to upload the data to the cloud for remote monitoring and control of the pump.
Connection for Pump SideThe water pump is controlled by a qwiic relay connected with the MicroMod main board. This board has ESP32 processor installed. ESP32 receives the information about the current water level through Single Pair Ethernet and controls the relay accordingly.
Comments