Automated detection system for Vespa velutina (Asian - Yellow Legged Hornet) using computer vision. Combines Grove Vision AI V2 for real-time object detection with ESP32-S3 for processing.
This project implements an automated detection system for Vespa velutina (Asian hornet) using computer vision. The system uses a Grove Vision AI V2 module for real-time object detection and an ESP32-S3 microcontroller to process detection results and control indicator LEDs.
The detection model can identify four classes:
- Class 0: Apis mellifera (Honeybee)
- Class 1: Vespa crabro (European hornet)
- Class 2: Vespula sp. (Yellowjacket)
- Class 3: Vespa velutina (Asian hornet) - Target class
The system consists of two main components:
- Grove Vision AI V2: Performs object detection using a YOLO11n model and sends detection results via UART1 to the ESP32-S3
- XIAO ESP32-S3: Receives detection data, processes it, and controls LEDs to indicate detected species
Key Features:
- Real-time object detection with YOLO model
- UART1 communication between Grove Vision AI V2 and ESP32-S3
- Visual feedback via colored LEDs (Red for Vespa velutina, Yellow for other hornets, Green for honeybees)
- Custom firmware with UART1 support for Grove Vision AI V2
Test setup (optional): For a simple setup via the SenseCraft web platform to test the Grove Vision AI V2, see the SwiftYOLO Guide (192x192px model with UART1 support).
Follow these steps to set up the detection system:
- Set up Grove Vision AI V2: Clone repositories, install dependencies, flash custom firmware and model
- Set up ESP32-S3: Install PlatformIO and upload detection code to ESP32-S3
- Connect hardware: Connect Grove Vision AI V2, ESP32-S3, and indicator LEDs
The Grove Vision AI V2 module needs custom software (firmware) installed so it can send detection results to the ESP32-S3 microcontroller via UART1. This guide shows you how to install the HimaxWiseEyePlus/Seeed_Grove_Vision_AI_Module_V2 repository, and then flash the custom firmware image and the detection model (YOLO11n) that recognizes Asian hornets and look-alikes.
Before starting, you need:
- Python 3 installed on your computer
- Grove Vision AI V2 module connected to your computer via USB
- This repository
-
Open a terminal (Command Prompt on Windows, Terminal on Mac/Linux)
-
Clone this repository (
gv2-esp32) to your computer:git clone https://github.com/vespCV/gv2-esp32.git
-
Navigate into the cloned repository:
cd gv2-esp32 -
Clone the Himax repository:
git clone --recursive https://github.com/HimaxWiseEyePlus/Seeed_Grove_Vision_AI_Module_V2.git tools/Seeed_Grove_Vision_AI_Module_V2
-
Follow the How to build the firmware?
This repository includes a pre-built firmware image (output.img) with UART1 support. Copy it from the images folder to the Himax repository's output directory.
Commands to copy the firmware image
From the project root, copy the firmware with this command:
On Mac/Linux:
cp images/output.img tools/Seeed_Grove_Vision_AI_Module_V2/we2_image_gen_local/output_case1_sec_wlcsp/output.imgOn Windows:
copy images\output.img tools\Seeed_Grove_Vision_AI_Module_V2\we2_image_gen_local\output_case1_sec_wlcsp\output.imgNote: This firmware image includes custom modifications to enable UART1 communication. See the Change Log for details on the modifications.
Copy the model file from the models folder and the makefile from the makefile folder to the Himax repository.
Commands (from the project root):
On Mac/Linux:
cp models/yolo11n_2025-09-01_224_e300_full_integer_quant_vela.tflite tools/Seeed_Grove_Vision_AI_Module_V2/model_zoo/tflm_yolo11_od/yolo11n_2025-09-01_224_e300_full_integer_quant_vela.tflite
cp makefile/makefile tools/Seeed_Grove_Vision_AI_Module_V2/EPII_CM55M_APP_S/makefileOn Windows:
copy models\yolo11n_2025-09-01_224_e300_full_integer_quant_vela.tflite tools\Seeed_Grove_Vision_AI_Module_V2\model_zoo\tflm_yolo11_od\yolo11n_2025-09-01_224_e300_full_integer_quant_vela.tflite
copy makefile\makefile tools\Seeed_Grove_Vision_AI_Module_V2\EPII_CM55M_APP_S\makefileBefore flashing, you need to find the name of the USB port where your Grove Vision AI V2 is connected.
On Mac:
- Open Terminal
- Run:
ls /dev/cu.usbmodem* - You should see something like
/dev/cu.usbmodem58FA1047631- copy this exact name
On Linux:
- Open Terminal
- Run:
ls /dev/ttyACM*orls /dev/ttyUSB* - You should see something like
/dev/ttyACM0- copy this exact name
On Windows:
- Open Device Manager (search for "Device Manager" in the Start menu)
- Look under "Ports (COM & LPT)"
- Find "USB Serial Port" or similar - it will show something like "COM3" or "COM4"
-
Make sure your Grove Vision AI V2 is connected to your computer via USB
-
Close any serial monitor or terminal programs that might be using the USB port
-
Open a terminal and navigate to the repository folder (from the project root):
cd tools/Seeed_Grove_Vision_AI_Module_V2 -
Run the flashing command. Replace the port name with your actual USB port name:
On Mac/Linux:
python3 xmodem/xmodem_send.py \ --port=/dev/cu.usbmodem###### \ --baudrate=921600 \ --protocol=xmodem \ --file=we2_image_gen_local/output_case1_sec_wlcsp/output.img \ --model="model_zoo/tflm_yolo11_od/yolo11n_2025-09-01_224_e300_full_integer_quant_vela.tflite 0xB7B000 0x00000"
On Windows:
python xmodem\xmodem_send.py ` --port COM5 ` --baudrate 921600 ` --protocol xmodem ` --file "we2_image_gen_local\output_case1_sec_wlcsp\output.img" ` --model "model_zoo\tflm_yolo11_od\yolo11n_2025-09-01_224_e300_full_integer_quant_vela.tflite 0xB7B000 0x00000"
-
The script will start uploading.
-
When you see the message "Send data using the xmodem protocol from your terminal":
- Press the RESET button on your Grove Vision AI V2 module (black button)
- Often it will start automatically
-
Wait for the upload to complete. Expected output:
Or with the updated repository:
-
After the upload completes, you may be prompted "Do you want to end file transmission and reboot system? (y)". Pressing 'y' will NOT reset the Grove Vision AI V2. Instead, press the RESET button (black button) on the Grove Vision AI V2 module. The Grove Vision AI V2 will restart and start detecting. Expected output:
Note: Check if you see: === CUSTOM FIRMWARE WITH UART1 SUPPORT - BUILD DATE: Nov 21 2025 16:58:18 ===. If flashing fails, check the xmodem_send.py version. Some recent commits may have issues: https://github.com/HimaxWiseEyePlus/Seeed_Grove_Vision_AI_Module_V2/commits/main/xmodem/xmodem_send.py
Troubleshooting
-
To get the Grove Vision AI V2 into boot mode, sometimes you need to:
- Unplug the board from USB-C
- Press and hold the boot button (white)
- Plug in the USB-C cable
- Press and release the reset button (black)
- Release the boot button
-
If you do not see
=== CUSTOM FIRMWARE WITH UART1 SUPPORT - BUILD DATE: Nov 21 2025 16:58:18 ===after flashing, you can try to replacexmodem_send.pywith the version from this repository. From the project root, run:On Mac/Linux:
cp xmodem/xmodem_send.py tools/Seeed_Grove_Vision_AI_Module_V2/xmodem/xmodem_send.py
On Windows:
copy xmodem\xmodem_send.py tools\Seeed_Grove_Vision_AI_Module_V2\xmodem\xmodem_send.py
Then try flashing again.
After flashing is complete:
- The Grove Vision AI V2 will restart after you press the reset button (pressing 'y' does not work - you must physically press the reset button)
- You can verify the firmware is working by:
-
Download the Himax AI web toolkit
-
Unzip
Himax_AI_web_toolkit.zip -
Open the Himax_AI_web_toolkit folder and click
index.html -
(Optional) Copy the custom JavaScript file to display the correct class names (Apis mellifera, Vespa crabro, Vespula sp., Vespa velutina) instead of the default COCO80 dataset classes (person, car, bicycle, motorcycle, etc.) from the project root:
On Mac/Linux:
cp tools/Seeed_Grove_Vision_AI_Module_V2/index-legacy.51f14f00.js tools/Seeed_Grove_Vision_AI_Module_V2/Himax_AI_web_toolkit/assets/index-legacy.51f14f00.js
On Windows:
copy tools\Seeed_Grove_Vision_AI_Module_V2\index-legacy.51f14f00.js tools\Seeed_Grove_Vision_AI_Module_V2\Himax_AI_web_toolkit\assets\index-legacy.51f14f00.js
-
Select "Grove Vision AI(V2)", click "connect", choose your USB port

-
The ESP32-S3 microcontroller needs the detection code uploaded so it can receive detection results from the Grove Vision AI V2 and control the indicator LEDs. This guide shows you how to upload the code using PlatformIO.
Before starting, you need:
- PlatformIO IDE installed on your computer
- XIAO ESP32-S3 board connected to your computer via USB-C (for hardware connections, see Connection Diagram)
- This repository cloned and set up (see 1.1: Install this github repository)
Option A: PlatformIO IDE (Recommended for beginners)
- Install Visual Studio Code
- Open VS Code and go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "PlatformIO IDE" and click Install
- Wait for the installation to complete
Option B: PlatformIO CLI
On Mac/Linux:
pip3 install platformioOn Windows:
pip install platformio- Open PlatformIO IDE (VS Code with PlatformIO extension)
- Click "Open Project" or use File → Open Folder
- Navigate to and select the
gv2-esp32folder (the root of this repository) - PlatformIO will automatically detect the
platformio.iniconfiguration file
- Make sure your XIAO ESP32-S3 is connected to your computer via USB-C
- In PlatformIO IDE, click the Upload button (→ arrow icon) in the bottom toolbar, or:
- Use the keyboard shortcut:
Ctrl+Alt+U(Windows/Linux) orCmd+Option+U(Mac) - Or use the menu: PlatformIO → Upload
- Use the keyboard shortcut:
- PlatformIO will:
- Build the project (compile the code)
- Upload the firmware to your ESP32-S3
- Show progress in the terminal
Alternative: Using PlatformIO CLI
If you prefer using the command line:
- Open a terminal in the project root (
gv2-esp32) - Run:
pio run --target upload
After uploading is complete:
-
The ESP32-S3 will restart automatically. If it doesn't restart, unplug the USB-C cable and reconnect it.
-
On startup, all three LEDs (Green, Yellow, Red) should blink once for 500ms to indicate the system is running.
-
Open the Serial Monitor to see debug output: - Click the Serial Monitor button (plug icon) in PlatformIO IDE - Or use the keyboard shortcut:
Ctrl+Alt+S(Windows/Linux) orCmd+Option+S(Mac) - Or use the menu: PlatformIO → Se -
Expected output:
For connection diagrams and prototype images, see the Connection Diagram documentation.
