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/30 21:25] – [Setting Up Alignment References] demid.dabizhaamc:ss2024:smart_water_metering:start [2024/07/30 21:50] (current) – [6. Conclusion] demid.dabizha
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.
  
Line 75: 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 91: 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|}}
Line 109: Line 109:
 === 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 146: 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 170: 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 ====
  
-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 numbers, though there were some challenges with lighting and reflections. Integrating it with Home Assistant made the system easier to use and provided real-time data for better 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 numbers, even 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 process, while requiring some basic technical skills, is not too complicated. Clear instructions and open-source firmware make it easier to implement.+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 process, while requiring some technical skills, is not that complicated. Open-source firmware make it easier to implement.
  
 ==== Links ==== ==== Links ====
  
 https://jomjol.github.io/AI-on-the-edge-device-docs/ https://jomjol.github.io/AI-on-the-edge-device-docs/
amc/ss2024/smart_water_metering/start.1722367558.txt.gz · Last modified: 2024/07/30 21:25 by demid.dabizha