This project demonstrates real-time object detection using the ESP32-CAM module and Edge Impulse. The system is trained to detect objects like onion, potato, and tomato, and displays detection results via Serial Monitor and OLED display.
- Object detection using ESP32-CAM (AI Thinker)
- Custom dataset collected using ESP32-CAM
- Edge Impulse YOLO-based object detection
- Optimized for low memory devices
- OLED display support for live results
- ESP32-CAM (AI Thinker)
- USB-to-TTL (FTDI) Programmer
- Breadboard & jumper wires
- Micro-USB cable
- Computer with Arduino IDE
- Wi-Fi connection
| ESP32-CAM | FTDI |
|---|---|
| 5V | 5V |
| GND | GND |
| U0R | TX |
| U0T | RX |
| GPIO0 | GND (Only during upload) |
Important
- GPIO0 must be connected to GND while uploading
- Remove GPIO0-GND after upload for normal operation
- Arduino IDE
- ESP32 Board Package
- Edge Impulse Account (Free)
- Eloquent ESP32 CAM Library
-
Install Arduino IDE
-
Add ESP32 Board Manager
-
Install ESP32 by Espressif Systems
-
Select:
- Board: AI Thinker ESP32-CAM
- Programmer: ESP32 Arduino
- Baud Rate: 115200
Install Eloquent ESP32 CAM library from Arduino Library Manager.
File → Examples → eloquentesp32cam → esp32cam_tp3
- Add your Wi-Fi SSID & Password
- Set camera type to AI Thinker
#define CAMERA_MODEL_AI_THINKER
- Connect GPIO0 → GND
- Power reset ESP32-CAM
- Upload sketch
- Remove GPIO0 → GND
- Power reset again
- Open Serial Monitor
- Copy the IP address
- Open it in a browser (same Wi-Fi network)
- Fix ESP32-CAM position
- Place object inside camera frame
- Rotate object slowly
- Capture ~50 images per object
- Download images as ZIP
- Repeat for all classes:
- Log in to Edge Impulse
- Create new project (e.g.,
obj-detect)
-
Go to Data Acquisition
-
Upload ZIP files
-
Enable:
- Automatically split
- Manually label
- Go to Labeling Queue
- Draw bounding boxes
- Assign correct labels
-
Image size: 96 × 96
-
Fit shortest axis
-
Blocks:
- Image Processing
- Object Detection
- Color depth: Grayscale
- Generate features
- Ensure clear feature separation
- Training cycles: 60
- Learning rate: 0.01
- Processor: CPU
- Start training
- Aim for 90–100% accuracy
- Go to Deployment
- Select Arduino Library
- Target device: ESP32-EYE
- Download ZIP
Sketch → Include Library → Add .ZIP Library
File → Examples → (Your_Model_Name) → esp32_camera
- Disable ESP-EYE
- Enable ESP32-CAM
- GPIO0 → GND
- Power reset
- Upload
- Remove GPIO0
- Power reset again
-
Open Serial Monitor
-
Place object in front of camera
-
Observe:
- Detected label
- Confidence score
- Use consistent lighting
- Avoid cluttered backgrounds
- Collect images from multiple angles
- Keep object centered during training
- Add speaker module for voice output
- Store MP3 files on SD card
- Autonomous robot integration
- Multi-object detection
- ESP32-CAM Community
- Edge Impulse Team
- Eloquent Arduino Library