I trained an AI to decode Morse code messages on an ESP32!
Playful Technology Playful Technology
46.5K subscribers
7,230 views
0

 Published On Dec 15, 2022

There's a massive buzz about A.I.-generated content at the moment - both the incredibly convincing quality of the content itself (and associated ethical questions about deep-fakes etc.), and also the sheer technical complexity of models like ChatGPT, Midjourney, Dall-E, which have made advanced machine-learning models available to anyone, requiring only a simple phrase or word in your browser as a prompt.

But there's many more uses for artificial intelligence than just churning out blog content and superimposing celebrities' faces on dodgy videos... and, in this tutorial, I'm going to demonstrate just one practical example: a classifier function that I'm going to train to decode Morse code. And, rather than require distributed server clusters with petaflops of processing power, I'll be running the whole thing on a humble ESP32 processor.... simpler models could even be run on an Arduino Nano!

I'll be using the SciKit-Learn Python library (https://scikit-learn.org) and a set of training data of button presses gathered from the Arduino IDE serial monitor. I'll then use MicroMLGen (https://pypi.org/project/micromlgen/) to convert that into a C header file that can be imported back into an Arduino sketch, and, in just a few lines of code, can be used to classify any new input of dots and dashes into a letter - without ever having been explicitly told the Morse code alphabet!

The use-case I demonstrate is for a Morse code puzzle in an escape room, but this obviously has many more potential applications - let me know if you have any suggestions in the comments ;)

00:00:00 - 00:01:06 Introduction
00:01:07 - 00:03:11 The problem:- decoding Morse code
00:03:12 - 00:04:24 Gathering training data
00:04:25 - 00:07:47 Creating the model
00:07:48 - 00:09:06 Using the classifier in an Arduino sketch
00:09:07 - 00:10:43 Demonstration
00:10:44 - 00:12:29 Wrapup

You can download all the code used in this tutorial from my GitHub repository at https://github.com/playfultechnology/...

If you enjoyed this video or found it helpful, please like and subscribe to this channel. And, if you'd like to download the resources used in all the escape room projects shown on this channel (and support me to continue making more tutorials in the future!), please check out my Patreon at   / playfultech  

show more

Share/Embed