User Tools

Site Tools


amc:ss2023:group-t: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:ss2023:group-t:start [2023/07/25 17:02] shreyaamc:ss2023:group-t:start [2023/07/25 20:36] (current) somaya.ahmadian
Line 28: Line 28:
  
  
-https://randomnerdtutorials.com/getting-started-with-esp32/+Source: https://randomnerdtutorials.com/getting-started-with-esp32/
  
 **ESP32CAM** **ESP32CAM**
-The ESP32-CAM is the microcontroller that we used in this project that comes with a detachable camera aid. It costs approximately $10. Besides the OV2640 camera, and several GPIOs to connect peripherals, it also features a microSD card slot that can be useful to store images taken with the camera or to store files to serve to clients. For the purpose of our project we have used an ESP32Cam by AIThinker. +The ESP32-CAM is the microcontroller that we used in this project that comes with a detachable camera aid. It costs approximately $10. Besides the OV2640 camera, and several GPIOs to connect peripherals, it also features a microSD card slot that can be useful to store images taken with the camera or to store files to serve to clients. For the purpose of our project we have used an ESP32Cam by AIThinker. 
- +
-{{:amc:ss2023:group-t:esp32cam-berrybase.de.png?200|}}                  {{:amc:ss2023:group-t:esp32cam_pinout.jpeg?400|}}+
  
 Source: https://randomnerdtutorials.com/esp32-cam Source: https://randomnerdtutorials.com/esp32-cam
 +
 +{{:amc:ss2023:group-t:esp32cam-berrybase.de.png?200|}}
 +
 +Figure 1: ESP32CAM https://www.makershop.de/plattformen/nodemcu/esp32-cam-board/
 +
 +
 +{{:amc:ss2023:group-t:esp32cam_pinout.jpeg?400|}}
 +
 +Figure 2: ESP32CAM pinout https://randomnerdtutorials.com/esp32-cam-video-streaming-face-recognition-arduino-ide/
 + 
  
 ==== 2.2. UartSBee ==== ==== 2.2. UartSBee ====
  
 UART stands for universal asynchronous receiver/transmitter and is a simple, two-wire protocol for exchanging serial data. UART stands for universal asynchronous receiver/transmitter and is a simple, two-wire protocol for exchanging serial data.
-{{:amc:ss2023:group-t:uartsbee-seeedstudio.jpeg?200|}}                    {{:amc:ss2023:group-t:uart_txrx.png?200|}}+{{:amc:ss2023:group-t:uartsbee-seeedstudio.jpeg?200|}}   
 + 
 +Figure 3: UartSBee https://evelta.com/uartsbee-v5-seeed-studio/                   
 + 
 +{{:amc:ss2023:group-t:uart_txrx.png?200|}} 
 + 
 +Figure 4: Uart uses two wires between transmitter and receiver to transmit and receive in both directions. https://www.rohde-schwarz.com/us/products/test-and-measurement/essentials-test-equipment/digital-oscilloscopes/understanding-uart_254524.html#gallery-8
  
  
Line 46: Line 60:
  
 {{:amc:ss2023:group-t:05_understanding-uart_02_w480_hx.png?400|}}  {{:amc:ss2023:group-t:05_understanding-uart_02_w480_hx.png?400|}} 
 +
 +Figure 5:  Uart frame contains start and stop bits, data bits, and an optional parity bit. https://www.rohde-schwarz.com/us/products/test-and-measurement/essentials-test-equipment/digital-oscilloscopes/understanding-uart_254524.html#gallery-8
 +
  
  
 UART is still a widely used serial data protocol but has been replaced in some applications by technologies such as SPI, I2C, USB, and Ethernet in recent years. UART is still a widely used serial data protocol but has been replaced in some applications by technologies such as SPI, I2C, USB, and Ethernet in recent years.
  
-Source: https://www.rohde-schwarz.com/us/products/test-and-measurement/essentials-test-equipment/digital-oscilloscopes/understanding-uart_254524.html#gallery-8 
  
 ==== 2.3. 16 GB MicroSD card ==== ==== 2.3. 16 GB MicroSD card ====
Line 79: Line 95:
  
 {{:amc:ss2023:group-t:lipo_akku_ekstein-shop.de.png?200|}} {{:amc:ss2023:group-t:lipo_akku_ekstein-shop.de.png?200|}}
 +
 +Fifure 6: LiPo Battery https://www.akkuman.de/shop/Akku-kompatibel-Fatboy-Edison-the-petit-PN704050-37V-1600mAh?curr=EUR&gad=1&gclid=Cj0KCQjw5f2lBhCkARIsAHeTvljkZAMPWR_616Zd6VWrigpjHYuo1BEREuBQiuNyIN_1z3dzxAbeGUkaAlhoEALw_wcB
  
 ==== 2.9. LiPo charger/adapter ==== ==== 2.9. LiPo charger/adapter ====
Line 85: Line 103:
  
 {{:amc:ss2023:group-t:lipo_charger_ekstein-shop.de.png?200|}} {{:amc:ss2023:group-t:lipo_charger_ekstein-shop.de.png?200|}}
 +
 +Figure 7: LiPo charger/adapter https://eckstein-shop.de/AdafruitUniversalUSB2FDC2FSolarLithiumIon2FPolymercharger?gclid=Cj0KCQjw5f2lBhCkARIsAHeTvlhVRSFS-UhLw4jDF7190yPZA1hKYx_U5e4FTyNKABkcUAkUa7Tg8cYaAkOcEALw_wcB
  
 ==== 2.10. Step-up/Step-down Voltage Regulator ==== ==== 2.10. Step-up/Step-down Voltage Regulator ====
Line 90: Line 110:
  
 {{:amc:ss2023:group-t:pololu_stepup_down_voltage_regulator.png?200|}} {{:amc:ss2023:group-t:pololu_stepup_down_voltage_regulator.png?200|}}
 +
 +Figure 8: Voltage Regulator https://www.pololu.com/product/4085
  
 ===== 3. Method ===== ===== 3. Method =====
Line 97: Line 119:
 The initial step involved connecting the ESP32CAM and UART module, using jumper cables. This ensured the proper flow of data between the devices. The initial step involved connecting the ESP32CAM and UART module, using jumper cables. This ensured the proper flow of data between the devices.
  
-{{:amc:ss2023:group-t:wiring.jpeg?400|}}                    {{:amc:ss2023:group-t:pin_connection.jpeg?200|}}+{{:amc:ss2023:group-t:wiring.jpeg?400|}}   
 + 
 +Figure 9Connection setup of ESP32CAM with UartSBee                   
  
 +Table 1: Pin connection of ESP32CAM and UartSBee
 + 
 +{{:amc:ss2023:group-t:pin_connection.jpeg?200|}}
  
  
Line 110: Line 138:
  
 Next, we navigated to the firmware folder on the hard disk and followed the installation instructions from the AI_on_the_edge documentation[4]. We initiated the process with the command "esptool erase flash." In our case, we had to rename the esptool command to esptool.py on Mac. We then executed the second command to flash the bootloader firmware and partitions. Next, we navigated to the firmware folder on the hard disk and followed the installation instructions from the AI_on_the_edge documentation[4]. We initiated the process with the command "esptool erase flash." In our case, we had to rename the esptool command to esptool.py on Mac. We then executed the second command to flash the bootloader firmware and partitions.
 +
 +{{:amc:ss2023:group-t:commands.jpeg?600|}}
  
 The next step, was to initialize the Ai-on-the-edge through Arduino's serial monitor. It showed us that the connection was established over Wi-fi for the camera module and it provided us with the IP address to set up the AI interface. The next step, was to initialize the Ai-on-the-edge through Arduino's serial monitor. It showed us that the connection was established over Wi-fi for the camera module and it provided us with the IP address to set up the AI interface.
Line 128: Line 158:
  
 {{:amc:ss2023:group-t:camerafocus.jpeg?200|}} {{:amc:ss2023:group-t:camerafocus.jpeg?200|}}
 +
 +Figure 10: Focus adjustment of the camera https://jomjol.github.io/AI-on-the-edge-device-docs/Installation/
  
 ==== 3.6. Casing ==== ==== 3.6. Casing ====
Line 134: Line 166:
  
 {{:amc:ss2023:group-t:img_0229.jpg?200|}} {{:amc:ss2023:group-t:img_0229.jpg?200|}}
 +
 +Figure 11: ESP32CAM and watermeter casing
 +
 ==== 3.7 Power Supply ==== ==== 3.7 Power Supply ====
  
Line 139: Line 174:
  
 {{:amc:ss2023:group-t:img_0729.jpg?400|}} {{:amc:ss2023:group-t:img_0729.jpg?400|}}
 +
 +Figure 12: Power supply setup 
  
  
Line 147: Line 184:
  
 {{:amc:ss2023:group-t:screenshot_2023-07-25_at_13.55.551.png?400|}} {{:amc:ss2023:group-t:screenshot_2023-07-25_at_13.55.551.png?400|}}
 +
 +Figure 13: AI-on-the-edge setup webpage
  
 However, we encountered an issue with the ESP32's built-in LED, as its flashing caused unwanted reflections on the glass of the water meter, making the AI-based readout challenging. To address this, we decided to cover the LED with a piece of tape, which provided better control over reflections and improved the accuracy of the readings.  However, we encountered an issue with the ESP32's built-in LED, as its flashing caused unwanted reflections on the glass of the water meter, making the AI-based readout challenging. To address this, we decided to cover the LED with a piece of tape, which provided better control over reflections and improved the accuracy of the readings. 
Line 159: Line 198:
  
 {{:amc:ss2023:group-t:screenshot_2023-07-25_at_14.00.27.png?400|}} {{:amc:ss2023:group-t:screenshot_2023-07-25_at_14.00.27.png?400|}}
 +
 +Figure 14: Selecting some reference points
  
  
Line 164: Line 205:
  
 {{:amc:ss2023:group-t:screenshot_2023-07-25_at_14.04.43.png?400|}} {{:amc:ss2023:group-t:screenshot_2023-07-25_at_14.04.43.png?400|}}
 +
 +Figure 15: Selecting Region Of Interest (ROI)
  
 To adjust the positions of the ROIs within the reading, we used the options "Move Next" or "Move Previous." Finally, we saved all our changes with "Save all to Config.ini."Since our water meter lacked analog information, we unchecked the next step. To adjust the positions of the ROIs within the reading, we used the options "Move Next" or "Move Previous." Finally, we saved all our changes with "Save all to Config.ini."Since our water meter lacked analog information, we unchecked the next step.
Line 170: Line 213:
  
 ==== 4.3. MQTT in Home Assistant ==== ==== 4.3. MQTT in Home Assistant ====
 +
 +Further in the process, using the Oracle VirtualBox, a virtual machine was setup to run Home Assistant in a Linux based environment. Following the documentation on the Home Assistant website, the configuration was complete [8]. Once the setup was finished, Mosquitto Broker was installed as an Add-on into the Home Assistant. We had used the digitizer in the AI-on-the-edge initialisation to set up the MQTT credentials to be used for this process.
  
 {{:amc:ss2023:group-t:screenshot_2023-07-25_at_15.55.47.png?400|}} {{:amc:ss2023:group-t:screenshot_2023-07-25_at_15.55.47.png?400|}}
  
-Further in the process, using the Oracle VirtualBox, a virtual machine was setup to run Home Assistant in a Linux based environment. Following the documentation on the Home Assistant website, the configuration was complete [8]. Once the setup was finished, Mosquitto Broker was installed as an Add-on into the Home Assistant. We had used the digitizer in the AI-on-the-edge initialisation to set up the MQTT credentials to be used for this process.+Figure 16: Oracle VirtualBox setup to run Home Assistant in a Linux based environment
  
  
 ===== 5. Discussion ===== ===== 5. Discussion =====
  
-While the SWM system is an inexpensive way to monitor household water consumption and the setup is relatively straightforward, the whole process is filled with tiny technological hurdles that present themselves at different stages. In the bounds of this particular course, the information provided in the classroom was not entirely conducive or helpful in understanding the workings of the AI system and other software technologies that could have been involved in this project+While the SWM system is an inexpensive way to monitor household water consumption and the setup is relatively straightforward, the whole process is filled with tiny technological hurdles that present themselves at different stages. There were several instances where the camera module just stopped functioning, even after establishing all sorts of protocols and measures to relieve the process of any hiccups, the module stopped functioning in the end. Another module had to be used to replace the old one
  
-There were several instances where the camera module just stopped functioning, even after establishing all sorts of protocols and measures to relieve the process of any hiccups, the module stopped functioning in the end. Additionally, the Virtual Machine installation and operation in Docker (which is an entirely another story if the operating system used is not Linux based), establishing MQTT broker and using Home Assistant in a Docker container were the most perplexing steps to familiarise oneself with, without having any prior introduction to such concepts. For exampleDocker wouldn't let HA run on "host" networkwhich later turned out to be an issue as it is not supported on MacOS. This complicated the further development of the project right before the camera module stopped connecting to the WiFi for unknown reason. All combative measures were exhausted to solve the issue using research, but to no avail.+Additionally, the Virtual Machine installation and operation in Docker (which is not entirely possible due to operating system limitations), establishing MQTT broker and using Home Assistant in a Docker container were the most perplexing steps to familiarise oneself with, without having any prior introduction to such concepts. Furthermoreprior to the installation of MQTT add-on in Home Assistantthe virtual machine needed to be run through VirtualBox which did succeed fully when using the localhost port. This halted the installation of the Mosquitto Broker in the HAOS created and limiting any further steps to proceed in the project.
  
-Although, the initial learning material helped us form the basis of establishing the connections, physical setup and conceptual understanding of the system and its components.Further training and information material would immensely help in understanding and dealing with the software components after the instructions on hardware. +Although, the initial learning material helped us form the basis of establishing the connections, physical setup and conceptual understanding of the system and its components.Further training and information material would immensely help in understanding and dealing with the software components after the instructions on the hardware. 
  
  
amc/ss2023/group-t/start.1690297333.txt.gz · Last modified: 2023/07/25 17:02 by shreya