Skip to content

nopnop2002/esp-idf-fm-radio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

esp-idf-fm-radio

FM radio using esp-idf.

fm-radio

I used this component.
This component can communicate directly with the browser.
There is an example of using the component here. It's a great job.

I used this for segment display.

Software requiment

ESP-IDF V4.4/V5.x.
ESP-IDF V5.0 is required when using ESP32-C2.
ESP-IDF V5.1 is required when using ESP32-C6.

Hardware requirements

TEA5767 FM Stereo Radio Module.
I bought this on AliExpress about $4.

tea5767-1 tea5767-2

The module has a standard antenna, but if you want to use it in a room, you need a long antenna.
With a long antenna, you can get more signals.
I used an AC power cable.

tea5767-3

Installation

git clone https://github.com/nopnop2002/esp-idf-fm-radio
cd esp-idf-fm-radio
git clone https://github.com/Molorius/esp32-websocket components/websocket
idf.py set-target {esp32/esp32s2/esp32s3/esp32c2/esp32c3/esp32c6}
idf.py menuconfig
idf.py flash

Configuration

config-top config-app

WiFi Setting

config-wifi-1

You can use Static IP.
config-wifi-2

You can use the MDNS hostname instead of the IP address.
config-wifi-3

  • esp-idf V4.3 or earlier
    You will need to manually change the mDNS strict mode according to this instruction.
  • esp-idf V4.4 or later
    If you set CONFIG_MDNS_STRICT_MODE = y in sdkconfig.default, the firmware will be built with MDNS_STRICT_MODE = 1.

TEA5767 Setting

config-tea5767

  • CONFIG_SCL_GPIO
    GPIO number(IOxx) to SCL.
  • CONFIG_SDA_GPIO
    GPIO number(IOxx) to SDA.
  • CONFIG_FM_BAND
    In US/EU it ranges from 87.5 MHz to 108 MHz.
    In Japan it ranges from 76 MHz to 91 MHz.
    Used when wrapping in a search.

Wireing

TEA5767 ESP32 ESP32-S2/S3 ESP32-C2/C3/C6
SCL -- GPIO22 GPIO12 GPIO5 (*1)
SDA -- GPIO21 GPIO11 GPIO4 (*1)
GND -- GND GND GND
VCC -- 3.3V 3.3V 3.3V (*2)

(*1)
You can change it to any pin using menuconfig.
But it may not work with other GPIOs.

(*2)
The PCB marking is +5V, but it works at 3.3V.

How to use

  • Open browser

  • Enter the esp32 address in your browser's address bar

  • Search Up
    Search for radio stations upwards.

  • Search Down
    Search for radio stations downwards.

  • Add Preset
    Record the current radio station in NVS.

  • Segment Color
    Change segment color.

  • Goto
    Goto preset station.

  • As system default
    At boot time, set to this Radio station.

Clear preset

idf.py erase-flash

Reference

https://github.com/nopnop2002/esp-idf-tea5767

Releases

No releases published

Packages

No packages published