ESP32-Cam on your water meter with "AI-on-the-edge" -- also for gas and power meters

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video i'm gonna show you how you can continuously monitor the count of your water meter gas meter or electricity meter for less than 10 euros with the help of an esp32 cam microcontroller with the free firmware ai on the edge from yomyol the current meter reading is detected with a i and the value is transmitted to node red via mqtt i have made case designs for your 3d printer for this purpose available on favors [Music] welcome to my youtube channel for this video i assume that you know how to use the arduino ide mqtt note red and graffana if that doesn't mean anything to you you might want to learn about these topics first or at least use this video as an inspiration to install the mentioned applications and services you need an esp32 microcontroller i already covered the basics and many project ideas in my last video you can watch it by clicking the link in the upper right corner the esp32 cam is currently available on ebay or aliexpress for only about 6 euros including shipping to be able to program it you need a usb to ttl converter like this one but before we start i will show you how i intend to attach the microcontroller to the meter later on for this purpose i designed a housing for my electricity meter in freecad if you have a 3d printer you can download the model from my thingiverse account there i also have designs for gas and water meters joomyol the developer of the firmware has also provided models for water meters on thingiverse as well as other thingiverse users if you don't have a 3d printer you'll have to make your own designs with wood or lego bricks my 3d printed case has a recess where you can insert the esp32 cam in my case design shown here i had mistakenly placed the camera and microcontroller in portrait orientation fortunately the case can also be used in this way but i have revised my models on thingiverse in the meantime you can use the basic example from my last video to focus the camera while the video stream is running the cam lens is quite tight at first but can be loosened and rotated with a small pair of pliers for me it required about 90 degrees of counterclockwise rotation after that we can start installing the actual firmware yamuol did an excellent job with his open source project ai on the edge the project is still getting a lot of love and has been continuously improved and developed over the past few months there are two ways to install ai on the edge for the way i will show you need to install python this can be done via the microsoft store for example then download the github repository of yomyol you can find the link to the project in the video description after unzipping you will find a folder named firmware on your hard disk which we will need in a minute there is also a folder called sd card we copy the contents of the folder to an sd card which should not have more than 16 gigabytes and must be formatted with fat32 in the root folder of the sd card there is a file called wlan.ini which means wifi you have to open this file with a text editor and enter the name of your wifi network and the wifi password we can then remove the sd card and put it aside for the moment now we can connect the usb to ttl converter to the esp32 cam i use black for crowned and red for 5 volts with the yellow and the green cable i connect the rxc and txt pins crosswise these are the pins for receive and transmit to make sure that the esp32 doesn't boot normally but starts in programming mode after being powered on it is necessary to connect the pin io zero to ground we can now connect the usb to ttl converter to a computer while usb and insert the prepared microsd card now we open the command line or powershell of windows there we have to install the required python library with pip install esp tool which allows us to change the firmware of our esp via python now we navigate to the firmware folder on a hard disk and get the installation instruction from the ai on the edge website we start with esp tool erase flash it may be necessary to rename the esp tool command to an esptool.py.exe then we execute the second command which flashes the bootloader firmware and partitions if the esp doesn't connect it is necessary to press the reset button or briefly disconnect the power cable now it should all go through but this takes quite a while then we can disconnect the jumper cable at pin io 0 and briefly interrupt the power supply the esp32 cam will now boot the new firmware if everything worked the led flashes after a few seconds if we now enter the ip address of the esp in the browser the setup of ai on the edge welcomes us but before we start however i would like to make a modification on the hardware it turned out that the built-in led of the esp often appears as an unwanted reflection on the class of the meter and makes the ai base read out difficult or impossible in order to better control the reflections i decided to break out the built-in led and replace it with two wired five millimeter leds for the connection you can of course use normal cables but i like to use animaled copper wire in such cases to remove the varnish at the ends it is mostly necessary to set the temperature of the soldering iron a bit higher 550 degrees celsius should be enough we cut four pieces of the wire off about the same length then we fix these i like to use blue tuck for this this has become a great help to me in all situations and is used whenever i can't get any further with a hot glue gun to remove the varnish we apply some solar to the tip of the wire and then move the tin from the tip to the center a few times until we see that there are varnish residues in the tin then we tin the three led pads on the board and solder one pair of the animal copper wire on each pad the side that is soldered to the negative pole can be marked black with a marker then it will be easier for the next step now we need two resistors for the leds i use two 220 ohms resistors here once these are cut and tint we can connect them to the animal copper wire and cover them with a heat shrink tube now we solder two white leds the long leg to the positive pole now we push the heat shrink tube over the connection with a resistor and heat it briefly with a lighter so it contracts at the end it looks like this by the way you can also do the setup with infrared leds which has the advantage that the illumination remains invisible to the human eye when the camera is taking the pictures later for this however it is necessary to remove the infrared filter of the lens so if you are brave you can try to peel off the front of the camera with a knife to take out the infrared filter now the only thing missing is our cable for the power supply since the pure esp cam needs no more than 200 milliamps an old quarkx audio cable will do the job for me but i'm not sure if corex cables are a no-go for real electronic engineers feel free to write your opinion in the comments after stripping i tin the ends again and solder them to the 5 volts and crown pin of the microcontroller now it can be put into the 3d printed housing for fixing i use blue tuck again and no i don't get any money from them now i add two-sided tape to the mounting tab and go down to the basement there i have already equipped my water meter and gas meter with esp32 cam including ai on the edge the additional external leds were also necessary for the gas meter in this case i use smd components with even thinner animal copper wire now to the power supply an old cell phone power supply with 5 volts and 1 000 milliamps is sufficient for my three esp's if you have problems with the stability and the esp gives a brown out detector message when booting via the serial output you can find tips in my basics video how to get these problems solved now let's install the new controller on the power meter prepare the adhesive tape stick it and align the leds then connect the power and the initial setup should open in the browser as soon as you have entered the local ip address of the esp again the welcome page shows you briefly which steps we are about to perform with a click on next we start straight away at create reference image we click on create new reference and now we align this image then click on update reference and then on next here we define marker points on the image so that the esp can later align the image and get oriented it may help to put small stickers as markers again we confirm for each reference with update reference and at the end with save all to config with next we continue again now we have to mark the single digits of the counter this can also be done directly on the screen roy 1 region of interests stands for the left digit roy2 for the one to the right and so on when we have done this for all digits we click again on save all to config.any with next we could do the same for analog digits but in my case this is not necessary last but not least we set some general settings for example that there are no analog digits to read but there are digital ones we can specify how many decimal digits the number have and we can make further restrictions so that incorrect readings are corrected by the software for example because there can be no negative value changes in our case it is worth to play a little bit with all these settings in case the reliability of the readings is not satisfactory at the beginning here we can also set the address and parameters for the mqtt client afterwards we can set the frequency of the readings and saves the settings at this point we scroll up and click next again even if it seems attractive to click on the reboot to activate below the update button it doesn't really make sense here we can only exit the setup on the next page and boot into normal mode the boot process takes a moment if we update too early the actual image is missing at first but it should be visible soon after now we can receive the mqtt messages in note red and pass them to influx db if you don't have node-red influx zb and krafana yet have a look here on youtube there are good tutorials about it that explain how to install these services on a raspberry pi in a straightforward way by the way if you like my video here please leave a thumbs up and subscribe to my channel after uploading we can use grafana to graphically display the transferred numbers either by displaying the absolute values or like here where i just display the difference of the current selected period so i can easily display the curve for the current week or the current month as you can see here i have already set this for my gas and water meter this brings me to the end of my video have fun with tinkering and see you next time [Music] [Music] you
Info
Channel: MakerMeik
Views: 155,645
Rating: undefined out of 5
Keywords: ESP32, ESP32-cam, ESP32cam, ESP8266, D1 mini, NodeMCU, Arduino, Electronics, Water Meter, AI, Machine Learning, ML, Node-RED, Grafana, MQTT
Id: iUgxwbfkIqU
Channel Id: undefined
Length: 14min 38sec (878 seconds)
Published: Sat May 01 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.