Result. My Nextion 2.4" display (NX3224T024_011) is lit and cycling red → green → blue in step with the three LEDs, driven by the ESP32. The Bench canvas mirrors the LEDs and the screen at the same time.
Setup (LED Blink Sequence project):
| Nextion pin | Goes to |
|---|---|
| 5V | power module + rail (bottom), adapter on at 7 V, rails at 5.00 V |
| GND | − rail, shared with the ESP32's GND |
| RX | j52 → ESP32 GPIO 26 (the ESP32 transmits here) |
| TX | j53 → ESP32 GPIO 27 (the ESP32 receives here) |
The sketch fills the screen with each LED's color (cls) and writes its name (xstr), using built-in Nextion commands, so I didn't have to design a screen in the Nextion Editor first. Commands are text ending in three 0xFF bytes, sent at 9600 baud.
What I learned
1. Serial ports can move. The ESP32 is so wide on my breadboard that the side with TX2/RX2 (GPIO 17/16) has no free holes at all. Every hole in those columns is under the board. Instead of rearranging everything, the sketch moved Serial2 to GPIO 26/27, two pins on the open side right next to my LED jumpers:
Serial2.begin(9600, SERIAL_8N1, 27 /* receive */, 26 /* transmit */);
Avoid the input-only pins (34, 35, 36, 39) for transmitting, and the startup-sensitive ones.
2. TX always goes to RX. The display's TX (what it says) goes to the pin the ESP32 listens on, and the ESP32's transmit pin goes to the display's RX.
3. The power module finally earned its spot. The LEDs ran from the ESP32's own pins, but the display needs about 90 mA at 5 V (more than a GPIO can give), so it gets its power from the module's rail. Both supplies share the − rail, so they have a common ground, which is required for the serial signals to make sense to each other.
4. 6 V in wasn't enough. With the adapter at 6 V, the module's 5 V regulator is in dropout and the rails sit at about 4.5 V. That's fine for LEDs but below the display's ~4.75 V minimum (the canvas flagged it). At 7 V the rails hold a solid 5.00 V.
Still to check
- Whether the color name shows on the real screen, or only the fill. If it's only the fill, the display has no font loaded yet, and a quick screen design in the Nextion Editor (which can add touch buttons too) would fix it.
Comments (0)