The Wildlife Crossings Guide project proposes a system that directs animals toward designated overpasses and underpasses to ensure safe road crossings, aiming to save the millions of animals that die on Australian roads each year, including koalas, kangaroos, wallabies, and wombats.
The principal of directing animals to the safe road crossings is the sound of their natural enemies.
System diagram
When animals (e.g., koalas) are detected to the left of the crossings, the far-left speaker emits the sound of their natural predators (e.g., dingoes). This encourages the animals (e.g., koalas) to move rightward toward the crossings.
This project features two core devices. The first is an Edge AI unit that detects the location of animals. The second is a speaker system that plays sounds of natural predators. The AI device and speaker communicate via LoRa.
Coral Edge AI device
The following components are required for the Coral Edge AI device:
- Coral Micro Board
- ESP32S3 development boards
- Semtech LLCC68 Lora module
- User LED: on when detected animal
- Status LED: on when I2cResponse::LoraOk, off otherwise
The Edge AI device runs three threads (ThreadReporter, ThreadInference, and QueueMainM7) on the Coral Micro board using FreeRTOS.
ThreadReporterThe I2C communication code is implemented in the file "./src/app/thread/ThreadReporter.cpp". "ThreadReporter" is responsible for the following tasks:
- Pool ESP32S3 on I2C bus regularly, to check Lora status on ESP32S3
- listens event from "ThreadInference", sends commands to ESP32S3 via I2C
"ThreadInference" (./src/app/thread/ThreadInference.cpp) is responsible for the following tasks:
- initialize tesnsorflow machine learning code
- perform objects detection regularly
- computes animal location and sends event to "ThreadReporter" and "QueueMainM7"
"QueueMainM7" (./src/app/thread/QueueMainM7.cpp) is responsible for the following tasks:
- Turn "User LED" on when detected animal
- Turn "Status LED" on when I2cResponse::LoraOk is received
Please refer to source code (https://github.com/teamprof/github-coral-crossings) for details
Build and flash the firmware on Coral Dev Board MicroLaunch a Ubuntu/Linux terminal and type the following commands to download, build and flash the firmware on the Coral Dev Board Micro
- git clone https://github.com/teamprof/github-coral-crossings
- cd github-coral-crossings
- git clone --recurse-submodules -j8 https://github.com/google-coral/coralmicro
- git submodule update --init --recursive
- bash coralmicro/setup.sh
- cmake -B out -S.
- make -C out -j4
- python3 coralmicro/scripts/flashtool.py --build_dir out --elf_path out/coralmicro-app
- Launch a Serial terminal, set baud rate to 115200 and connect it to the USB port of the Coral Dev Board Micro
- Power on both the Coral Dev Board Micro and ESP32S3. If everything goes smooth, you should see the followings on the serial terminal:
Install Python plugins and run the Python script to see the image and detection results from the Coral Dev Board Micro
- python3 -m pip install -r py/requirements.txt
- python3 py/coral_crossings.py
- Place an animal in front of the camera. If the animal is detected, you should see a box around the animal on the GUI app. The "User LED" on the Coral Dev Board Micro should also be turned on.
- Move the animal to left, you should see a red-colored rectangle in the GUI app around the left region. The left speaker should output dingoes' sound.
- Move the animal to middle, you should see a green-colored rectangle in the GUI app around the middle region. All the left speakers should be silent.
- Move the animal to right, you should see a red-colored rectangle in the GUI app around the right region. The right speaker should output dingoes' sound.
Photo of GUI app and serial terminal on Ubuntu
Photo of animal
ESP32S3 Lora Speaker
The following components are required for the ESP32S3 Lora Speaker:
- ESP32S3 development boards
- Semtech LLCC68 Lora module
- MAX98357A I2S class-D amplifier
- Speaker
- LED
Once bootup, the Lora module is in receiver mode.When a play audio command is received via Lora, a dingoes sound is output and a red LED is on.When a stop audio command is received, audio and red LED are turned off.
Activity diagram:- clone this github code by "git clone https://github.com/teamprof/github-esp32s3-lora-speaker"
- cd github-esp32s3-lora-speaker
- edit src/AppContext.cpp, make sure device is configured as receiver
static DeviceConfig deviceConfig = {
.device{
.type = Receiver, // set as receiver
.id = 2001 // device ID
},
...
}
- On Arduino IDE, click menu "Sketch" -> "Verify/Compile"If everything goes smoothly, you should see the following screen.
- Connect ESP32S3 to PC, upload firmware by clicking menu "Sketch" -> "Upload"If everything goes smoothly, you should see the following screen.
- Launch "Serial Monitor" on Arduino IDE, you should see the following screen.
Please refer to source code (https://github.com/teamprof/github-esp32s3-lora-speaker) for details
Video demo is available on
00:00 animal starts at safe crossing => speaker off, no dingoes' sound00:03 animal moves to left => speaker-left turns LED on and outputs dingoes' sound00:08 animal moves to safe crossing => speaker off, no dingoes' sound00:13 animal moves to right => speaker-right turns LED on (note: no speaker is connected)00:16 animal moves to safe crossing => speaker off, no dingoes' sound00:21 animal moves to left => speaker-left turns LED on and outputs dingoes' sound00:33 animal moves to safe crossing => speaker off, no dingoes' sound
Comments