Skip to content

Slider0007/AI-on-the-edge-device

 
 

Repository files navigation

AI-on-the-Edge Device [SLFork]

Artificial intelligence is everywhere, from speech to image recognition. While most AI systems rely on powerful processors or cloud computing, edge computing brings AI closer to the end user by utilizing the capabilities of modern processors.
This project demonstrates edge computing using a low-cost, AI-capable Espressif SOC device (e.g. ESP32), to digitize your analog meters — whether water, gas or electricity. With affordable hardware and simple instructions, you can turn any standard meter into a smart device.

Let's explore how to make AI on the Edge a reality!

Key features

  • Tensorflow Lite (TFLite) integration – including easy-to-use wrapper
  • Inline image processing (Image taking, Image alignment, ROI extraction, Post processing)
  • Usage of small and low-cost AI-capable devices (Supported Hardware)
  • Integrated camera and illumination (depending on hardware capabilities)
  • Web interface for visualization, control and administration
  • Over the air (OTA) firmware update via web interface

APIs / Publishing Services / Home Automation Integrations

Workflow

The device takes an image of your meter at a defined interval. It extracts the Regions of Interest (ROIs) from the image and runs them through artificial intelligence. As a result, you get the digitized value of your meter. There are several options for what to do with that value. Either send it to a MQTT broker, write it to InfluxDB or simply provide access to it via a REST API (JSON / HTML).

Impressions

Hardware

Web Interface

Supported Hardware

Board

Board Type SOC Firmware Release Remarks
ESP32-CAM ESP32 All ⚠️ Only boards with >4MB RAM are supported
⚠️ Beware of inferior quality Chinese clones
XIAO ESP32 Sense ESP32S3 $\ge$ v17.0.0 ⚠️ Running quite hot, a small heat sink is recommended
ℹ️ No onboard illumination: Separate illumination (PWM controlable LED / Intelligent LED) required

Camera

Camera Type Sensor Resolution Digital Zoom Firmware Release Remarks
OV2640 2MP 1.0x - 2.5x All ℹ️ Officially EOL since 2009, but still very popular
ℹ️ Pin and function compatible Chinese clones are supported
OV5640 5MP 1.0x - 4.0x $\ge$ v17.0.0 ℹ️ Officially EOL since 2019, but still very popular
ℹ️ Autofocus is not supported
ℹ️ Power consumption higher than OV2640
⚠️ Running quite hot, a small heat sink is recommended to get stable image quality
⚠️ ESP32-CAM: Camera functional. Deviation of core + I/O voltage supply (board: 1.2V / 3.3V, camera: 1.5V / 2.8V (abs. max. 4.5V)).
⚠️ XIAO ESP32S3 Sense: Camera functional. Small deviation of core voltage supply (board: 1.3V, camera: 1.5V).

Inform Yourself

There is growing documentation which provides you with a lot of information. Head there to get a start, how to set it up and configure it.
ℹ️ Not every description is 100% suitable for this fork. Therefore please check docs folder of this repository for any fork specific documentation.

Small selection of youtube videos which might give you an idea how to getting started:
Video 1, Video 2, Video 3, Video 4, Video 5, Video 6, Video 7

Firmware installation

There are multiple options to install the firmware and the SD card content.

Download Firmware Package

Officially released firmware packages can be downloaded from releases page.
A possibly already available development version (upcoming release version) can be previewed here.

⚠️ Please do not use the source files directly from the repository, not even for the preparation of the SD card! Use only files related to the download sources mentioned here (official precompiled release packages or test versions). Otherwise, full functionality cannot be guaranteed.


Over The Air (OTA) Update

After the device is initially installed using one of the following installation options, it is strongly recommended to perform any further firmware update using the web interface built-in OTA functionality.


Option 1: Web Installer (Only For Released Versions)

Follow the instructions listed at Web Installer page.
Further details can be found in Web Installer Provisioning Documentation.


Option 2: Manual Installation (MCU + SD Card)

Further details can be found in Manual Provisioning Documentation.

API Description

REST API

See REST API Documentation in github repository or via device web interface (System > Documentation > REST API).
ℹ️ Read API documenation carefully. REST API is not fully compatible with jomjol's original firmware.

MQTT API

See MQTT API Documentation in github repository or via device web interface (System > Documentation > MQTT API).
ℹ️ Read API documenation carefully. Webhook API is not fully compatible with jomjol's original firmware.

Prometheus Exporter

See Prometheus API Documentation in github repository or via device web interface (System > Documentation > Prometheus API).
ℹ️ Read API documenation carefully. Prometheus API is not fully compatible with jomjol's original firmware.

Webhook API

See Webhook API Documentation in github repository or via device web interface (System > Documentation > Webhook API).
ℹ️ Read API documenation carefully. Webhook API is not fully compatible with jomjol's original firmware.

Build Yourself

See Build / Debug Instructions

Support

ℹ️ This is a forked version of jomjol´s great software which is intented to use for my personal purposes only.

About

AI-on-the-Edge Device [SLFork]

Resources

Stars

Watchers

Forks

Languages

  • C++ 52.1%
  • C 23.2%
  • HTML 16.3%
  • CSS 5.7%
  • JavaScript 1.1%
  • Python 1.0%
  • Other 0.6%