Home

Awesome

<span style="color: red;">This code is depreciated and will not be maintained any more!</span>

water-meter-house-automation

Software for a water meter measurement to provide an JPG-Image of a watermeter with an OV2640 camera with internal flash LED

Changelog

2.4.0 Wifi-Handling
2.3.1 WifiReconnect
2.3.0 ESP32-CAM only

Full Change History

ESP32-CAM - Hardware

The ESP32-CAM camera requires a simple modification to it's default focus setting to make it suitable for use close to the meter face.

ESP32-CAM - Software

Functionality

This is an HTTP-Webserver, sending an image of the OV2640 camera on request and additionally switching on illumination. The code is implemented in the Arduino IDE and is directly related to an selfmade water meter for house automation. For the housing etc. see https://www.thingiverse.com/thing:3860911

An overview about the complete system can be seen here: https://github.com/jomjol/water-meter-measurement-system

Commands

Usefull for ESP32-CAM with onboard flash LED only:

The picture properties and the illumination can be adjusted by adding the following parameters. The parameters can be used indivdually or combinded:

Meaning of parametes:

ParameterMeaningRange/ValueExample
qualityQuality setting for jpeg0 - 63 (0 = highest quality; 63 = lowest quality, default = 10quality=10
sizeJPEG resolution of out putQVGA (320x240), VGA (640x480), SVGA (800x600), XGA (1024x768), SXGA (1280x1024), UXGA (1600x1200), default = SVGAsize=SVGA
delayWaiting time between light on and take a pictureTime in msdelay=5000

Info to Watchdog

In some cases my ESP32-CAM get stuck without any reaction. The reason for this is unknown. To restore it a reboot is necessary. I implemented a watchdog, that triggers after 30 minutes. It is reseted allways after taking a picture. As my system takes pictures every 10 minutes, it should only fire in case it gets stuck.

Compling Code

The Arduino Code is in the subdirectory "ESP32-CAM_Server-GitHub". In order to compile, the ESP32 developement environment for ESP32-CAM and the Neopixel Library needs to be installed through the Arduino Library Controll. The WLAN-SSID and PASSWORD needs to be updated in the code, in order to access the local network. After turning on the power, it flashed 3 time the onboard LED, after a successfull connection to the WLAN.

Code structure - brief overview

The code is implemented in C++, using different classes.

JomjolGitServerClass

JomjolGitESP32CamComm

JomjolGitArduCAM-Server-Class

ESP32-CAM_Server-GitHub.ino

Physical Setup / Wiring / Components

ESP32-CAM

Components

Wiring including LED-Strip

<img src="./images/ESP32-CAM_Wiring_neu.png" width="800">

Wiring for usage internal ESP32-CAM flash LED only

<img src="./images/ESP32-CAM_Wiring_Flash_only.png" width="300">