ESP32 FM Transmitter Using One GPIO Pin
by Insidehackers in Circuits > Microcontrollers
61 Views, 1 Favorites, 0 Comments
ESP32 FM Transmitter Using One GPIO Pin

ESP32FMRadio turn one GPIO into a pocket-sized FM station. This project shows how an off-the-shelf ESP32 module becomes a fully-digital FM transmitter, no DAC, no RF IC just GPIO 0 and 30 cm of wire. The ESP32’s Audio-PLL (APLL) is forced to lock at 100 MHz, we route that clock out through the I²S master-clock (MCLK) line, giving a stable RF carrier straight from the pin. An 8-bit PCM audio clip (Rick Astley, of course) is stored in flash every 125 µs an ISR nudges the APLL’s 16-bit fractional divider up or down, swinging the carrier ±75 kHz in perfect sync with the music.
Downloads
Supplies
All you need is the first version of the ESP32 like ESP32-WROOM-32, because it has the internal hardware needed for this trick, the APLL!
Setup the Environment

First step is to install VS Code with PlatformIO extension.
Download and install VSCode from this link: VSCode Download
Now open VSCode and go to the left bar and click "Extensions" in the search bar type "PlatformIO" and install it.
Clone the Code and Build

Go to the repository:
Downlaod the source code and import the project on PlatformIO by clicking "Open Project" and select the folder with the code downloaded from github (remember to extract the folder first from the zip file), now PlatformIO should download all the component needed to build the project, after he finished you can build and upload the code on your ESP32.
Add Antenna

Solder a 30 cm wire to the GPIO 0 pin on your ESP32. That's it!
Disclaimer
Remember that transmit FM signal it's illegal in most country, this device should not be used because the output it's not filtered and it emits a lot of harmonics that can interfere with other electronic devices!!!