Imagine a low-cost embedded device that sees and identifies Indian currency notes in real time β without relying on the cloud. In this project, we show how to combine the powerful ESP32 CAM Currency Recognition and the Edge Impulse TinyML platform that classifies denominations using machine learning directly on the device.
This guide walks you through the complete process β from collecting and labelling image data, training a custom model in Edge Impulse, to deploying and testing on the ESP32-CAM hardware. Along the way, youβll learn important edge-AI concepts and practical embedded system techniques that are widely applicable to TinyML projects.
Once built, your ESP32-CAM can:π₯ Capture an image of a currency noteπ§ Run a trained AI model locally β no cloud neededπ‘ Light up an LED representing the recognised denominationπ€ Print the detected denomination to the Serial Monitor
Running the model directly on the device reduces latency, improves privacy, and cuts dependency on network connectivity. These are the hallmarks of edge computing and TinyML.
Connect the ESP32-CAM to the USB-to-Serial adapter as follows:β FTDI TX β ESP32-CAM RXβ FTDI RX β ESP32-CAM TXβ 5 V and GND properly connected
Attach LEDs to selected GPIO pins through 100 Ξ© resistors, and tie all cathodes to common ground. Each LED corresponds to a currency denomination.
Without proper connections, the module wonβt upload or operate correctly, so refer to the circuit diagram before powering up.
The quality and variety of your training images directly affect model accuracy. While you can find datasets online, this project uses custom image capture:
- Program the ESP32-CAM with a data-collection sketch that starts a web server.
- Use any device on your Wi-Fi to connect to the camera interface.
- Place each denomination (e.g., βΉ10, βΉ20, βΉ50, βΉ500) in front of the camera.
- Capture multiple images per note under consistent lighting and background.
Aim for at least 50 images per class β more images improve model robustness.
A white or uniform background helps the model focus on the visual features of the notes.
π€ Training Your Model in Edge ImpulseThe Edge Impulse platform drastically simplifies the TinyML workflow:
- Create a new project and upload the labeled images.
- Draw bounding boxes around each note for object detection.
- Configure the Impulse with proper image processing (e.g., 96Γ96 size).
- Train your model and check performance metrics like F1 score.
- Deploy the model by generating an Arduino library tailored for the ESP32-CAM.
After training, Edge Impulse compiles an optimized model that runs efficiently on microcontrollers like the ESP32.
Once the model library is built:β‘ Copy it into the Arduino libraries folder.β‘ Update your sketch to include the AI model.β‘ Select the correct board profile and camera model (CAMERA_MODEL_AI_THINKER).β‘ Upload to the ESP32-CAM.
After deployment, the ESP32-CAM runs inference locally to classify new currency images.
Fix the ESP32-CAM at a steady angle with good lighting. Place a note within the cameraβs field of view, and watch:β¨ The appropriate LED lights upβ¨ The Serial Monitor displays the classificationThis confirms real-time recognition accuracy.
Maintaining consistent camera placement and lighting improves performance.
Your currency recognition system can be extended to:
β Assist visually impaired users with audio feedbackβ Verify denominations at point-of-sale systemsβ Automate currency countingβ Integrate with vending machines
These real-world uses show how embedded AI can enhance everyday devices.
π Future EnhancementsHere are some exciting upgrades you can explore:
πΉ Extend support to more denominations and coinsπΉ Add an OLED/LCD screen to display results visiblyπΉ Use a buzzer or speaker for audible outputπΉ Implement fake currency detection by training the model accordingly
These enhancements can make your system more powerful and user friendly.
π Troubleshooting TipsIf you run into issues:
load Failure: Ensure GPIO0 is grounded during flashing and the correct COM port and board are selected.
- No Serial Output: Double-check baud rate and wiring.
- Wi-Fi Connection Problems: Confirm SSID/password accuracy and 2.4 GHz network usage.
- Black Image or Camera Error: Define the correct camera model and secure the camera ribbon.
This project demonstrates how TinyML and edge AI can transform inexpensive embedded hardware like the ESP32-CAM into a practical, real-time currency recognition tool. By leveraging Edge Impulse, we offload the complexity of model training and focus on delivering a compelling, interactive application that anyone can build.
Start experimenting, extend functionality, and inspire others to explore embedded AI! If youβre looking for more inspiration and practical guides, check out these ESP32 projects.












Comments