Free shipping €150+
Blog/tutorials

10 Amazing Nextion + ESP32 Projects You Can Build Today in 2025

Discover 10 creative Nextion display and ESP32 projects with complete guides. From weather stations to IoT dashboards, control panels, and monitoring systems with step-by-step instructions.

Robotics3D TeamJanuary 15, 202515 min read
Nextion HMI display
Nextion HMI displays bring professional touch interfaces to ESP32 projects. Image: CC-BY-SA

Why Nextion + ESP32?

Combining Nextion HMI displays with ESP32 creates powerful IoT interfaces. Nextion handles the graphics while ESP32 provides WiFi, Bluetooth, and processing power.

Perfect Combination

  • Nextion: Professional HMI graphics, touch input
  • ESP32: WiFi, Bluetooth, GPIO, sensors
  • Simple: Just TX/RX serial connection
  • Fast: Offloaded display processing

Wiring ESP32 to Nextion

ESP32 development board
ESP32-WROOM-32 dev board with plenty of GPIOs. Image: Wikimedia Commons (CC-BY-SA)
Nextion ESP32 Color
TXRX2 (GPIO16)Yellow
RXTX2 (GPIO17)Blue
5V5V (VIN)Red
GNDGNDBlack

Power Note

Nextion displays can draw 500mA+. Use external 5V supply for larger displays, not just USB power.

Basic Communication Code

Electronics wiring
Clean wiring ensures reliable serial communication. Image: CC-BY-SA
#include <HardwareSerial.h>

HardwareSerial nexSerial(2); // UART2

void setup() {
 Serial.begin(115200);
 nexSerial.begin(9600, SERIAL_8N1, 16, 17);
 
 // Send command to Nextion
 sendCommand("page 0");
}

void sendCommand(const char* cmd) {
 nexSerial.print(cmd);
 nexSerial.write(0xFF);
 nexSerial.write(0xFF);
 nexSerial.write(0xFF);
}

void updateText(const char* obj, const char* text) {
 char cmd[64];
 sprintf(cmd, "%s.txt=\"%s\"", obj, text);
 sendCommand(cmd);
}

void updateNumber(const char* obj, int value) {
 char cmd[32];
 sprintf(cmd, "%s.val=%d", obj, value);
 sendCommand(cmd);
}

Project Ideas

Smart home dashboard
Create professional smart home interfaces. Image: CC-BY-SA

Smart Thermostat

Temperature control with scheduling, WiFi for remote access

Home Dashboard

Control lights, view sensors, weather display

Audio Controller

Spotify/media controls with album art display

Plant Monitor

Soil moisture, light levels, watering alerts

Energy Monitor

Real-time power consumption display

Car Dashboard

OBD-II data display with gauges

Using EasyNextionLibrary

For easier development, use the EasyNextionLibrary:

#include "EasyNextionLibrary.h"

EasyNex myNex(Serial2);

void setup() {
 myNex.begin(9600);
}

void loop() {
 myNex.NextionListen(); // Listen for touch events
 
 // Update display elements
 myNex.writeStr("t0.txt", "Hello!");
 myNex.writeNum("n0.val", 42);
 myNex.writeNum("j0.val", 75); // Progress bar
}

Get Started

Browse our Nextion HMI displays and ESP32 boards.

New to Nextion? Start with our Nextion Editor Tutorial.

Frequently Asked Questions

Can I use these projects with ESP8266 instead of ESP32?

Yes, most projects work with ESP8266, but you'll need to use software serial for Nextion communication since ESP8266 has only one hardware serial port. Projects requiring dual-core processing or Bluetooth should stick with ESP32. For simple sensor displays and WiFi-only projects, ESP8266 is perfectly adequate and more affordable.

How do I send data from ESP32 to Nextion display?

Use simple serial commands. For example, to update a text component named txtTemp with temperature value: Serial2.print('txtTemp.txt="25.5°C"'); followed by three 0xFF bytes as terminators. The Nextion immediately updates the display. All commands follow this pattern: component.attribute=value plus terminators.

Can Nextion displays work without an external microcontroller?

Nextion displays can run standalone interfaces with timers, buttons, and page navigation, but they cannot connect to WiFi or read external sensors directly. For IoT projects, internet connectivity, or sensor integration, you need an external microcontroller like ESP32 to act as the communication bridge.

What is the maximum distance between ESP32 and Nextion display?

Serial UART communication typically works reliably up to 10-15 meters with standard wires at 9600 baud. For longer distances, use shielded cable, lower baud rates, or consider RS485 converters. For most projects where the display and microcontroller are in the same enclosure, standard jumper wires work perfectly.

How do I handle Nextion button presses in ESP32 code?

Configure the Nextion button component to send a unique string in its Touch Release Event (for example, 'BTN1'). In ESP32 code, continuously read Serial2, parse incoming strings, and execute corresponding actions when specific button codes are received. Use if/else or switch statements to route different button events to different functions.

Related Products

Ready to Build?

Get all the components you need for your next project.

Shop Products
Contact1