Close

Same board, different screen: adding ST7789 support with auto-detection

A project log for SensorStation3

Open-source ESP32 CYD environmental station: T/H/pressure/CO2eq on a touchscreen, MQTT (HA autodiscovery, ThingsBoard, Domoticz), OTA

viacheslavViacheslav 07/28/2026 at 13:350 Comments

This one started as a purely logistical task. The station works, friends asked for one, so I ordered a batch of CYD boards from AliExpress — same ESP32-2432S028 listing I'd used before — to assemble a few more units.

They arrived. I flashed the firmware. And I saw rotated and overlayed image

The board was almost the same in every visible respect: same silkscreen, same layout, same product page, only one visible difference was additional USB-C connector. The display controller was not. Instead of the ILI9341 the firmware expected, these units shipped with an ST7789 (luckily it was labeled on the box, so I didn't spend time to identify it).

This is a known hazard with the CYD family. "ESP32-2432S028" is less a specific board than a loose family of boards that share a form factor, and manufacturers quietly swap components between production runs. Buy two at different times and you may well get two different pieces of hardware under one part number.

The fix had to be automatic. I could have added a menuconfig option — pick your display, rebuild. But that breaks the thing I care most about in this project: you flash a prebuilt binary and it works, no toolchain, no decisions to make. A firmware that asks the user which chip is inside their board is a firmware that friends can't install themselves.

The good news is that both panel families use identical pinout on the CYD, so the wiring didn't change at all — only the driver. At boot the firmware now reads the panel's display ID register (RDDID) over the existing SPI bus and picks the matching driver. Same binary, either panel, nothing to configure. There's also a manual override (CONFIG_SS3_LCD_PANELin idf.py menuconfig) for anyone who hits a module where auto-detection guesses wrong.

Also in this release. Two smaller things worth mentioning. The station used to reboot in a loop if it booted with no sensor attached — the history buffer was never initialised in that path while the UI kept querying it every 500 ms. It now shows a "Connect sensor and reboot the device" message on the affected panels instead. And the trend arrows became much more responsive: they compare the current reading against its own rolling 30-second mean and update every 500 ms, rather than comparing two consecutive 30-second means and sitting frozen in between.

A caveat, and a request. All of this is tested on the units I have in hand, and on those it works correctly. But given how varied CYD boards are in the wild, I'd very much like to hear from anyone who flashes it onto a different batch — especially if the screen comes up blank, mirrored, or with wrong colours. Which variant do you have, and did detection get it right? Reports are welcome in the comments or as an issue on GitHub.

Available in v1.5.10. There you can find two bin files: SensorStation3-v1.5.10.bin to update your device (offset 0x20000) and SensorStation3-v1.5.10-merged.bin for initial flash (offset 0x0)

Discussions