User Tools

Site Tools


amc:ss2024:smart_water_metering:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
amc:ss2024:smart_water_metering:start [2024/07/29 14:52] demid.dabizhaamc:ss2024:smart_water_metering:start [2024/07/30 21:50] (current) – [6. Conclusion] demid.dabizha
Line 13: Line 13:
  
 === 1.2 Objective === === 1.2 Objective ===
-The objective of this project is to design and implement a smart water metering system using the ESP32-CAM module. The system will capture images of a water meter, process these images to extract numerical readings, and transmit the data for remote monitoring. This involves the development of a robust image processing algorithm, integration with IoT networks for data transmission, and the creation of a custom casing for the hardware. The ultimate goal is to provide a cost-effective, accurate, and scalable solution for modern water management systems.+The objective of this project is to design and implement a smart water metering system using the ESP32-CAM module. The system will capture images of a water meter, process these images to extract numerical readings, and transmit the data for remote monitoring. The ultimate goal is to provide a cost-effective, accurate, and scalable solution for modern water management systems.
  
 ==== 2. Materials and Methods ==== ==== 2. Materials and Methods ====
Line 54: Line 54:
  
 === Hardware Preparation and ESP Firmware Installation === === Hardware Preparation and ESP Firmware Installation ===
-  - **Connecting the Hardware**: Mount the ESP32-CAM onto the ESP32-CAM-MB. Ensure all pins are connected correctly. There is no need for additional wires when using the ESP32-CAM-MB.{{ :amc:ss2024:smart_water_metering:photo_2024-07-28_18-56-23.jpg?nolink&200 |}}+  - **Connecting the Hardware**: Mounting the ESP32-CAM onto the ESP32-CAM-MB. Ensure all pins are connected correctly. There is no need for additional wires when using the ESP32-CAM-MB.{{ :amc:ss2024:smart_water_metering:photo_2024-07-28_18-56-23.jpg?nolink&200 |}}
   - **Power Supply**: The ESP32-CAM requires a 5V power supply, typically provided via a USB power source.    - **Power Supply**: The ESP32-CAM requires a 5V power supply, typically provided via a USB power source. 
   - **Entering Flashing Mode**: This is very important step. To enter flashing mode, its needed to connect a wire between GND and GPIO0 on the ESP32-CAM-MB (I used male jumper cable to connect GND and GPIO0). This is necessary for the initial firmware flashing.   - **Entering Flashing Mode**: This is very important step. To enter flashing mode, its needed to connect a wire between GND and GPIO0 on the ESP32-CAM-MB (I used male jumper cable to connect GND and GPIO0). This is necessary for the initial firmware flashing.
   - **Flashing the Firmware**:   - **Flashing the Firmware**:
       *  Download the required firmware files from the [[https://github.com/jomjol/AI-on-the-edge-device/releases|GitHub repository]] in a zip file.       *  Download the required firmware files from the [[https://github.com/jomjol/AI-on-the-edge-device/releases|GitHub repository]] in a zip file.
-      *  Connect the ESP32-CAM-MB to the computer via a USB cable.+      *  Connecting the ESP32-CAM-MB to the computer via a USB cable.
       *  With use of Arduino IDE upload the firmware onto the ESP32-CAM.       *  With use of Arduino IDE upload the firmware onto the ESP32-CAM.
  
 === SD Card Preparation === === SD Card Preparation ===
 +
 +**Note:** it is recomeneded to use 16GB SD Card. But 32GB worked fine for me.
 + 
   - **Downloading Configuration Files**: Obtaining the `sd-card.zip` file from the [[https://github.com/jomjol/AI-on-the-edge-device/releases|GitHub repository]] and extracting its contents.   - **Downloading Configuration Files**: Obtaining the `sd-card.zip` file from the [[https://github.com/jomjol/AI-on-the-edge-device/releases|GitHub repository]] and extracting its contents.
   - **Editing WiFi Configuration**:   - **Editing WiFi Configuration**:
Line 72: Line 75:
  
 === System Startup === === System Startup ===
-  - **Powering On**: Insert the SD card into the ESP32-CAM and power on the device.+  - **Powering On**: Inserting the SD card into the ESP32-CAM and power on the device.
   - **Verification**: After powering on, the onboard red LED will blink to indicate the connection status:   - **Verification**: After powering on, the onboard red LED will blink to indicate the connection status:
   * **5 fast blinks**: Connection pending   * **5 fast blinks**: Connection pending
   * **3 slow blinks**: WLAN connection established   * **3 slow blinks**: WLAN connection established
-  - **Checking Connection**: Ensure the ESP32-CAM is connected to WiFi network by verifying the IP address.+  - **Checking Connection**: Making sure that the ESP32-CAM is connected to WiFi network by verifying the IP address.
  
 ==== 2.3. Software Configuration ==== ==== 2.3. Software Configuration ====
Line 88: Line 91:
 === Capturing a Reference Image === === Capturing a Reference Image ===
   - **Adjusting Camera Position**:    - **Adjusting Camera Position**: 
-      *  **Distance**: Position the ESP32-CAM at a distance where the entire water meter display is visible. +      *  **Distance**: Positioning the ESP32-CAM at a distance where the entire water meter display is visible. 
-      *  **Focus Adjustment**: Remove the glue on the camera lens and adjust the focal length until the image is clear.+      *  **Focus Adjustment**: Removing the glue on the camera lens and adjusting the focal length until the image is clear.
   - **Image Quality Settings**:    - **Image Quality Settings**: 
-      *  **Brightness, Contrast, and Saturation**: Adjust these settings to ensure a high-quality image. +      *  **Brightness, Contrast, and Saturation**: Adjusting these settings to ensure a high-quality image. 
-      *  **Horizontal Alignment**: Ensure the numbers on the water meter are horizontally aligned.{{ :amc:ss2024:smart_water_metering:image_2024-07-10_15-39-13.png?nolink&600 |}}+      *  **Horizontal Alignment**: Ensuring the numbers on the water meter are horizontally aligned.{{ :amc:ss2024:smart_water_metering:image_2024-07-10_15-39-13.png?nolink&600 |}}
   - **Dealing with Reflections**:    - **Dealing with Reflections**: 
-      *  **Camera Rotation**: Rotate the ESP32-CAM to minimize reflections on the meter. +      *  **Camera Rotation**: Rotating the ESP32-CAM to minimize reflections on the meter. 
-      *  **Diffuser Attachment**: Attach a diffuser, such as a piece of felt or parchment paper, to the LED to reduce reflections. +      *  **Diffuser Attachment**: Attaching a diffuser, such as a piece of felt or parchment paper, to the LED to reduce reflections. 
-      *  **LED Intensity**: Lower the LED intensity to further minimize glare.+      *  **LED Intensity**: Lowering the LED intensity to further minimize glare.
  
 === Setting Up Alignment References === === Setting Up Alignment References ===
-Alignment references ensure that each captured image is correctly aligned with the reference image, improving the accuracy of readings.+Alignment references ensures that each captured image is correctly aligned with the reference image, improving the accuracy of readings.
   - **Define Alignment Structures**: Select two distinct structures on the water meter to act as alignment references.   - **Define Alignment Structures**: Select two distinct structures on the water meter to act as alignment references.
   - **Image Adjustment**: The software will use these references to shift and rotate each captured image to match the reference coordinates.{{:amc:ss2024:smart_water_metering:image_2024-07-10_15-39-39.png?nolink&400|}}{{ :amc:ss2024:smart_water_metering:image_2024-07-10_15-39-55.png?nolink&400|}}   - **Image Adjustment**: The software will use these references to shift and rotate each captured image to match the reference coordinates.{{:amc:ss2024:smart_water_metering:image_2024-07-10_15-39-39.png?nolink&400|}}{{ :amc:ss2024:smart_water_metering:image_2024-07-10_15-39-55.png?nolink&400|}}
 +
  
 === Defining Regions of Interest (ROIs) === === Defining Regions of Interest (ROIs) ===
 ROIs are specific areas of the image where the digits of the water meter are located.{{ :amc:ss2024:smart_water_metering:image_2024-07-10_15-38-43.png?nolink&600 |}} ROIs are specific areas of the image where the digits of the water meter are located.{{ :amc:ss2024:smart_water_metering:image_2024-07-10_15-38-43.png?nolink&600 |}}
-  - **Define ROIs for Each Digit**:  + **Define ROIs for Each Digit**:  
-      *  **Digit Location**: Carefully define a separate ROI for each digit on the water meter display. +      *  **Digit Location**: Accurate identification of separate ROI for each digit on the water meter display. 
-      *  **Precision**: Ensure the ROIs are accurately placed to capture each digit clearly.+      *  **Precision**: Ensuring the ROIs are accurately placed to capture each digit clearly.
  
 ==== 3. Casing Design ==== ==== 3. Casing Design ====
Line 142: Line 146:
 === Accuracy and Reliability === === Accuracy and Reliability ===
  
-The implementation of the Computer vision on the ESP32-CAM demonstrated high accuracy in reading the numerical values from the water meter. The system's ability to correctly detect and interpret the digits is critical for reliable water usage monitoring. However, occasional inaccuracies were observed due to variations in lighting conditions and reflections from the water meter cover. But this can be fixed by the methods mentioned earlier in "Dealing with Reflections".+The implementation of the Computer vision on the ESP32-CAM demonstrated high accuracy in reading the numerical values from the water meter. The system's ability to correctly detect and interpret the digits is critical for reliable water usage monitoring. However, occasional inaccuracies were observed in the last digit due to variations in lighting conditions and reflections from the water meter cover. But this can be fixed by the methods mentioned earlier in "Dealing with Reflections".
  
 === Integration with Home Assistant === === Integration with Home Assistant ===
Line 166: Line 170:
 Every time the ESP32-CAM was powered up, the settings were reset, causing the Regions of Interest (ROIs) to shift and making it difficult to accurately capture the numbers.  Every time the ESP32-CAM was powered up, the settings were reset, causing the Regions of Interest (ROIs) to shift and making it difficult to accurately capture the numbers. 
 To address this, the Alignment References were turned off.  To address this, the Alignment References were turned off. 
-The custom casing ensured that the ESP32-CAM and water meter maintained a consistent position, eliminating the need for re-alignment with each restart.+The custom casing ensured that the ESP32-CAM  maintained a consistent position, eliminating the need for re-alignment with each restart.
  
 ==== 6. Conclusion ==== ==== 6. Conclusion ====
  
-The implementation of the ESP32-CAM for smart water metering has demonstrated significant potential in automating the process of water usage monitoring. The system achieved a high accuracy in reading the numerical values from the water meter, despite occasional challenges with lighting and reflections. Integration with Home Assistant has further enhanced the usability and accessibility of the systemproviding real-time data for efficient water management.+I managed to make a working module for a water meter that is ready for use in household. The ESP32-CAM for smart water metering has shown great potential in automating water usage monitoring. The system accurately reads water meter numberseven though the protective plastic cover causes "inconvenient" reflections from the LED light. 
 + 
 +A major advantage of this project is its low cost. The ESP32-CAM and other components are affordable, making it accessible to many people. Also, the setup processwhile requiring some technical skills, is not that complicated. Open-source firmware make it easier to implement. 
 + 
 +==== Links ====
  
-One of the notable strengths of this project is its cost-effectivenessThe ESP32-CAM module and associated components are relatively inexpensive, making this solution accessible for widespread adoptionAdditionally, the setup process, while requiring some technical know-how, is not overly complex. Detailed instructions and the availability of open-source firmware significantly reduce the barriers to implementation.+https://jomjol.github.io/AI-on-the-edge-device-docs/
amc/ss2024/smart_water_metering/start.1722257524.txt.gz · Last modified: 2024/07/29 14:52 by demid.dabizha