I built an AI-based squirrel detection system using an ESP32-S3 CAM V1.2, Edge Impulse, and an Arduino Mega 2560. The goal was to use a camera and machine learning to identify whether a squirrel is in front of the camera and show the result using LEDs.
The system uses a red LED to indicate when a squirrel is detected and a green LED when a squirrel is not detected. This project helped me explore how artificial intelligence, computer vision, and hardware can work together in a real-world application.
Why did I decide to make it?I wanted to try building something that combines AI with physical hardware instead of just running a machine learning model on a computer. I was interested in learning how a small camera board could use a trained model to recognize an animal and then communicate that result to another microcontroller.
I also wanted to understand the challenges involved in building a complete system, including collecting images, training a model, connecting the boards, and testing the results.
How does it work?The ESP32-S3 camera captures images, and a machine learning model trained with Edge Impulse classifies what it sees as either squirrel or non squirrel.
When the model detects a squirrel with a confidence score that meets the configured threshold, the ESP32-S3 sends a HIGH signal through a logic-level converter to the Arduino Mega. The Mega turns on the red LED and turns off the green LED.
When a squirrel is not detected, the ESP32-S3 sends a LOW signal. The Mega then turns on the green LED and turns off the red LED.
I used a logic-level converter to connect the ESP32-S3's 3.3V signal safely to the Arduino Mega's 5V logic input.
What I learnedBuilding this project taught me that getting an AI model to run is only one part of creating a working system. I also had to work through wiring, power, camera capture, signal communication, and software compilation issues.
I learned how to train and test an image-classification model, connect two microcontroller boards, and use the model's output to control physical LEDs. I would like to improve the model with more varied images and test it under different lighting conditions and distances.
Images and demonstrationI have included photos of my hardware setup and wiring to show how the components are connected. I also plan to include a demonstration showing the red LED when a squirrel is detected and the green LED when one is not detected.





















_3u05Tpwasz.png?auto=compress%2Cformat&w=40&h=40&fit=fillmax&bg=fff&dpr=2)
Comments