Smarter Than You Think: DIY AI Bird Detector on ESP32 (No Internet!)
by invpe in Circuits > Arduino
52 Views, 0 Favorites, 0 Comments
Smarter Than You Think: DIY AI Bird Detector on ESP32 (No Internet!)

🐦 The ESP Birdie
A $5 Microchip That Learns Bird Songs – Totally Offline!
- Have you ever wondered what kind of birds are singing in your garden?
- At what time of day or season they appear?
But then you checked out the "smart" solutions online – only to find cloud-based overcomplicated services, subscriptions, and the need to share your data (and accept a cookie just to begin)?
Yeah… I’m not a fan either. That’s why I decided to build my own solution – from scratch, and completely offline.
No internet, no cloud, no subscription, no data harvesting.
I built a device that teaches itself.
- It listens, learns, and retrains overnight – getting better every day.
- In an age where everyone just copies and pastes cloud-based AI tools, there’s little challenge left.
This project (like my previous one gridshell) brings back the maker’s spirit.
It shows that you can build useful, clever tech by yourself – and make it truly yours.
🔌 It costs nothing to run.
🌐 It requires zero internet.
🧠 It uses real machine learning – on a chip the size of your thumb.
🕊️ It identifies birds, live, in real time.
ESP32 Birdie is a blend of creative coding and outside-the-box engineering. It demonstrates the power of a $5 microchip with just a microphone – turning it into an intelligent, independent sound classifier.
- Break the link to the cloud.
- Take back control.
- And let your device do the thinking.
It’s your model, your data, your rules – running right on your ESP32.
Supplies
https://shop.m5stack.com/products/atomu-esp32-development-kit-with-usb-a?srsltid=AfmBOoo2bfRW0_DOz5ruMq_Hv7euLeshWo0fwWaOm7aZxhnYHO9LWJyy&variant=42309147132161
Upload the Arduino Sketch to Your ESP32 M5U




📥Download the sketch
Head over to my Github page to download the latest sketch.
📤Open in arduino
After you download it, simply open it in Arduino
📻 Update Your WiFi
So that you can access the Birdie - no worries, no internet is needed as promised!
🍺Compile and Upload to Your M5AtomU
Simply hit CTRL+U or Sketch -> Upload
Access the Device

😏Access the Birdie with your browser
Simply open any browser you like and head to http://esp32birdie.local/
This webpage is going to be your place, especially during training. Later on you will just use it to see the birds identified by the device.
Learn to Use It



The top panel
Here you can :
- See the memory statistics
- Look at the current microphone level (refreshes every 0.5s)
- Remove all your samples
- Remove your current model
- Download your current model
- Check the overall model error
- See how many classes of labels your model knows
- Enable or Disable auto training at 03:00 AM
The center panel
- Here you will see a list of samples recorded by the device
- Samples that are identified will have labels already
- Samples requiring identification will have label empty
- You can play them back, download or remove selectively
The bottom panel
- This is where you manually train your model
- You can set the number of trainings to perform (epochs)
- Learning rate - which is a critical value of learning performance
- Upload files to the device (used mostly to manage models)
Label the Interesting Samples




🌳Leave your ESP32 outside - to record few samples
Now that your device is running, leave it outside so it can record the sounds of the birds singing.
Ensure to keep it covered from the weather conditions it would be bad to loose it due to the rain or snow.
You normally want to record samples from your environment, the way they are - so leave your ESP32 and come back after some time to review samples recorded.
The Birdie will turn green when recording a sample, grab a few of the samples (around 10) for each of the birds you want the ESP32 to learn.
Once you're done, go back to the web page and you will see samples recorded.
🐦Got samples?
If you have some already, it's time for the last manual step - we need to label them.
Since You want your ESP32 to learn, it needs to know what. It needs to know what is this sample, so we will just simply give them names.
Just playback the recordings, remove the unnecessary ones (like noise) and label the correct ones, hit Save.
👋 Handy tip
You can also use YouTube to record samples of birds singing, that's what i did - there are tons of youtube videos where people share singing birds, just type "sparrow singing" and play it next to your ESP32 Birdie.
Let the Machine Learn


🔮 Time for real machine learning!
Well since we have labeled samples, it is time for our ESP32 to learn to recognize them right?
There are two ways to do that.
🚀 Automatic training
You can leave Your ESP32 as is, with labeled samples and let it auto train every night at 03:00 AM.
🙋 Manual training
Or you can simply start the training now, and this is what we will do in this demonstration.
At the bottom of the page, there is a "Train" button, set 500 iterations and hit Train.
Trainings are a continuous process to get the device smarter and smarter.
They automatic happen overnight and you don't have to think about them.
Once there are samples labeled, there is always something to learn for the device.
Both automatic and manual trainings require time, the device will shine a RED led when in training.
⏳ It takes few minutes, depending on the number of iterations requested - since we picked up 500, give it 10 minutes.
Training Completed

🎓 When the training finishes, you will sse the score of your model called "Training Error Rate" - the lower the value the better your model is in classifying samples. Mine for example is at 0.37 after many days of training on two classes of birds: Sparrow and Titmouse.
The model even if poorly trained at the start, will become better and better every time you or it automatically trains.
Validation
📢 Play back time!
Now after the training has completed it would be good to check how does the model work.
A training depends on the samples, after one session it might still require additional training sessions - Machine Learning - BIG TIME!
So simply check if the training was enough to recognize samples you have labelled.
💡 The easiest way to do that is to play the same YouTube videos of birds singing :)
Do it now, and once done refresh the Birdie page, see if the model captured them well.
If not, label them properly, save and keep on training - you will notice, every time you train it (error rate goes down) it becomes smarter! 💪
Thats It!

👌 That is absolutely it.
Place your device outside, secured from weather conditions and let it record and identify samples.
From time to time you can open the web page to find new samples you might want to identify or identified sounds of birds your device has learned from the ones you labelled.
You can housekeep things, remove unnecessary samples, label new ones, keep few to allow the model to train on something when there are no new recordings that day.
🔥 More ?
Sure thing! There is lot to explore, you can teach it to identify other sounds - not birds only, i tested it on sounds of a breaking glass, dogs barking, guitar playing.
🔨 Be creative!
Now You can, as your machine learning model will learn whatever you want it to learn, and it costs You absolutely nothing, just fun and time!
💎Bonus💎
Ready to use models
On my GitHub page i have uploaded a ready to use model (error at 0.37) that recognizes two birds:
You can upload it to your Birdie, and play these two youtube videos to see how it recognizes them.
Going geek mode
With the cost of a simple ESP32 roughly at $5, you can go absolutely freaky and distribute trainings on your free ESP32's, making a powerful super computer / cluster, which will train the network automatically using any free node you have available!
Imagine, your Birdie always getting best models from your esp32 nodes at home, how cool is that?
Reach out for Tesselator, a simple distributed computing solution i've built for ESP32's.