Real-Time Currency Detection Using ESP32-CAM and YOLO (AI + Computer Vision Project)

by priyanshu9569999 in Circuits > Cameras

21 Views, 1 Favorites, 0 Comments

Real-Time Currency Detection Using ESP32-CAM and YOLO (AI + Computer Vision Project)

note.jpg
ProjectImage.png

This project demonstrates a real-time currency detection system using an ESP32-CAM and a YOLO-based Python server. The ESP32-CAM captures images of currency notes and sends them over Wi-Fi to a Python server, where a trained YOLO model processes the image and identifies the denomination.

The detected currency value is then displayed on an OLED screen connected to the ESP32. This system combines embedded systems and artificial intelligence to create a fast, efficient, and practical solution for currency recognition.

The architecture splits tasks efficiently — the ESP32 handles image capture and communication, while the server performs heavy AI processing — resulting in fast detection within 1–2 seconds.

Supplies

Screenshot 2026-05-02 at 12.53.23 PM.png

Understanding the Project

mermaid-diagram.jpg

In this project:

  1. ESP32-CAM captures an image
  2. Image is sent to a Python server
  3. YOLO model detects the currency
  4. Result is sent back
  5. OLED displays the value

This setup allows real-time AI processing using low-cost hardware.

Understanding YOLO

YOLO (You Only Look Once) is an object detection algorithm that can identify objects in images.

In this project, it:

  1. Detects currency notes
  2. Identifies denomination (₹10, ₹20, ₹50, ₹100, ₹500, etc.)
  3. Works in real time with good accuracy

Training the YOLO Model

  1. Use Google Colab
  2. Train using a custom dataset of currency notes
  3. Export the trained model (best.pt)

Why training is important:

  1. YOLO does not recognize objects by default
  2. It learns patterns like numbers, colors, and note designs

Source Code - https://drive.google.com/file/d/1gjP65UpY9R44sf0-AnlSSFVIQjYIc2Xb/view

Circuit Connections

New Project.jpg

OLED → ESP32-CAM

  1. SDA → GPIO 13
  2. SCL → GPIO 14
  3. VCC → 3.3V / 5V
  4. GND → GND

Flash LED

  1. Controlled using onboard GPIO

Upload Code to ESP32-CAM

  1. Add your Wi-Fi credentials (ssid, password)
  2. Set your server endpoint:
http://<server-ip>:5000/detect

What the code does:

  1. Connects to Wi-Fi
  2. Captures image
  3. Sends it to server
  4. Displays detected value on OLED
  5. Handles reconnection automatically

Source Code - https://drive.google.com/file/d/1gjP65UpY9R44sf0-AnlSSFVIQjYIc2Xb/view

Setup Python Server

Install dependencies:


pip install ultralytics flask opencv-python numpy torch

Run the server:


python server.py

Check server:

http://localhost:5000/stats


How the Server Works

mermaid-diagram.jpg
  1. Receives image from ESP32
  2. Decodes using OpenCV
  3. Runs YOLO detection
  4. Selects highest-confidence result
  5. Sends label back

It also:

  1. Tracks FPS
  2. Optimizes CPU usage
  3. Preloads model for faster response


Performance Optimization

Uses small image size (QQVGA)

Optimized JPEG compression

Fast Wi-Fi transfer

Detection time: ~1–2 seconds

Testing the System

Screenshot 2026-05-02 at 1.16.09 PM.png
Screenshot 2026-05-02 at 1.16.57 PM.png

The system successfully captures, processes, and identifies currency notes in real time. The combination of ESP32-CAM and YOLO provides a fast, reliable, and cost-effective AI-based solution

Applications

Currency identification system

Assistive tool for visually impaired

Smart vending machines

Retail automation

AI learning projects

Reference Video

AI Currency Detection using ESP32-CAM(Real Time Project)