LilyGO/T-Embed and RDA5807 setup
LilyGO/T-Embed is a panel that uses the ESP32S, an rotary encoder with push button, and a TFT ST7789 display, all together, for application development. The picture below shows LilyGO/T-Embed.
Preface
This document is about the LilyGo T-Embed device as a receiver based on the RDA5807 IC family. The main parts of the sketch used here was written by Volos. The Volos’ project is a receiver based on the TEA5767 device and his work has adapted to RDA5807 device by the author of this library.
All you have to know to use this project with your LilyGo T-Embed panel can be found here.
As you can see in the picture above, the LilyGO/T-Embed has some extra pins that you can use in your application. See Grove, GPIO PINOUT, and TFT Card Slot. Preferably, use the pins SDA (IO18), SCL (IO8), IO16, IO17, IO40, IO38 and IO41. The picture below shows the ESP32 pinout.
See this link for more details about LilyGo T-Embed
Donate
If you find this project useful, consider making a donation so that the author of this library can purchase components and modules for improvements and testing of this library. Click here to donate.
Arduino setup
- On Arduino IDE, go to Preferences, edit the field “Additional Boards Manager URLs:” and add the URL https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json .
- After, on Tools menu, select the option “Board:”, “Boards Manager…”. Look for esp32 and install it.
- Go to LilyGo T-Embed github repository and download it. Unzip the downloaded file, go to lib folder, copy and paste RotaryEncoder and TFT_eSPI folders to the your Arduino installation, libraries folder (in general Documents/Arduino/libraries/). See picture below.
- Install the Arduino library FastLED using Arduino IDE, tools menu, Manager libraries… option. See picture below.
- Install the library Battery 18650 Stats. See picture below.
LilyGo T-Embed and RDA5807 connection
The table and pictures below show the LilyGo T-Embed and RDA5807 devices connection.
LilyGo T-Embed device wire up
ESP32-S3 wire up and internal used pins.
Device name | Device Pin / Description | ESP32 |
---|---|---|
LilyGo Painel I2C | ||
SDA/SDIO | GPIO 18 | |
SCL/SCLK | GPIO 8 | |
Encoder LilyGo Painel | ||
A | GPIO 2 | |
B | GPIO 1 | |
PUSH BUTTON (encoder) | GPIO 0 | |
Battery Indicator | GPIO 4 | |
LCD LED | GPIO 15 | |
Power ON | GPIO 46 | |
SI453X MCU RESET PIN | ||
See table below | ESP32 PIN USED FOR RESETTING | GPIO 16 |
ESP32-S3 RDA5807 wire up
RDA5807 | DESC. | ESP32 (GPIO) |
---|---|---|
SDA | SDIO | 18 (SDA / GPIO18) |
SCLK | SCLK | 8 (SCL / GPIO8) |
### LilyGo T-Embed and ESP32 internal PINS (GPIO) and functions
GPIO | Description |
---|---|
0 | Encoder Push Button |
1 | Encoder B |
2 | Encoder A |
4 | Battery Indicator |
15 | Display LED (LCD_BL) |
46 | Power On (turn it high) |
ISSUES
In some cases you can get errors below during FastLED library compilation.
/Users/XXXXX/Documents/Arduino/libraries/FastLED/src/platforms/esp/32/clockless_rmt_esp32.cpp: In static member function ‘static void ESP32RMTController::init(gpio_num_t)’:
/Users/XXXXX/Documents/Arduino/libraries/FastLED/src/platforms/esp/32/clockless_rmt_esp32.cpp:111:15: error: variable ‘espErr’ set but not used [-Werror=unused-but-set-variable]
esp_err_t espErr = ESP_OK;
/Users/XXXXX/Documents/Arduino/libraries/FastLED/src/platforms/esp/32/clockless_rmt_esp32.cpp: In member function ‘void ESP32RMTController::startOnChannel(int)’:
/Users/XXXXX/Documents/Arduino/libraries/FastLED/src/platforms/esp/32/clockless_rmt_esp32.cpp:239:15: error: variable ‘espErr’ set but not used [-Werror=unused-but-set-variable]
esp_err_t espErr = ESP_OK;
cc1plus: some warnings being treated as errors
</B>
To solve that problem, choose one of the following three methods:
Methode one
On Arduino IDE, preferences, select Default option for Compiler warnings field. See picture below.
Methode two
Edit the file Documents/Arduino/libraries/FastLED/src/platforms/esp/32/clockless_rmt_esp32.h (See the right path of your Arduino installation) as shown below.
#ifndef FASTLED_RMT_SERIAL_DEBUG
#define FASTLED_RMT_SERIAL_DEBUG 0
#endif
Replace from FASTLED_RMT_SERIAL_DEBUG 0 to FASTLED_RMT_SERIAL_DEBUG 1 as shown below
#ifndef FASTLED_RMT_SERIAL_DEBUG
#define FASTLED_RMT_SERIAL_DEBUG 1
#endif
Methode three
Edit the file Documents/Arduino/libraries/FastLED/src/platforms/esp/32/clockless_rmt_esp32.h (See the right path of your Arduino installation) as shown below.
Replace
#if FASTLED_RMT_SERIAL_DEBUG == 1
#define FASTLED_DEBUG(format, errcode, ...) if (errcode != ESP_OK) { Serial.printf(PSTR("FASTLED: " format "\n"), errcode, ##__VA_ARGS__); }
#else
#define FASTLED_DEBUG(format, ...)
#endif
to
#if FASTLED_RMT_SERIAL_DEBUG == 1
#define FASTLED_DEBUG(format, errcode, ...) if (errcode != ESP_OK) { Serial.printf(PSTR("FASTLED: " format "\n"), errcode, ##__VA_ARGS__); }
#else
#define FASTLED_DEBUG(format, errcode, ...) if (errcode != ESP_OK) { }
#endif