Hello friends, I hope you all are doing great. Today, I am going to share the new Nextion HMI Display Library for Proteus Simulation. A Nextion is not just a screen: it is a touch display with its own processor, which keeps your whole user interface - pages, buttons, numbers, bars, graphs - inside itself, so that your Arduino only has to send short text instructions over a serial port and listen for touch events. That is why Nextion displays are everywhere in machines, home controllers and student projects. With this library you can run a full Proteus simulation of a 3.2-inch Nextion: its UART, its instruction set, its return codes and its touch events, so that your serial protocol works before you open the Nextion Editor.

Figure: The Nextion simulation running: ON, OFF, the graph page and back.
Updates

Nextion HMI Display Library for Proteus

Latest version: V1.0 (November 2026, this tutorial)

Other displays: GC9A01 Round TFT · TFT ST7735 · OLED SSD1306 · LCD 16x2

Helping Tools

The screen comes alive on the sheet at run time and you can touch it with the mouse. The demo is a heater controller: an Arduino waits for the display to be ready, asks which page it shows, reads a text back, and then runs a pretend heater - ON and OFF by touch, the temperature in a number and a bar, and a graph page with the history.

NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the LCD board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the Nextion HMI Display Library for Proteus Simulation:

Figure: The Nextion HMI Display Library for Proteus Simulation.

What Is a Nextion HMI Display?

HMI means human-machine interface. On an ordinary TFT your microcontroller draws every pixel, every button and every letter itself, which costs code, memory and time. A Nextion turns that around. You design the pages on a PC in the free Nextion Editor - drag a button here, a number there, a progress bar below - compile the project and load it into the display's own flash. From then on the display draws and redraws its pages by itself. Your board sends it instructions such as n0.val=27 or page 1, and the display sends back a few bytes when someone touches a button.

The Nextion 3.2" at a glance
Nextion 3.2" (NX4024T032, Basic series)
Screen3.2" TFT, 400 x 240 pixels, 65K colours, resistive touch
Insideits own processor, 4 MB of flash for the project, 3,584 bytes of RAM
Interfacea TTL UART, 9600 baud 8N1 by default
Power5 V, about 85 mA
Connector+5V, TX, RX, GND
Boardabout 95 x 47.6 mm

The Instruction Set

Every instruction is plain ASCII text followed by three bytes 0xFF 0xFF 0xFF - that is how the display knows the instruction has ended. Assignments set a component's attribute: t0.txt="Hello" for a text, n0.val=25 for a number, j0.val=60 for a progress bar, b0.bco=63488 for a red background. Commands do the rest: page 1 changes the page, cls, fill, line, cir and xstr draw on the screen, add puts a point on a waveform, get asks for a value and sendme for the current page.

The Return Codes

The display answers in short frames, also ended by FF FF FF. A touch arrives as 65h, page, component, event - 01h when the finger goes down, 00h when it lifts - but only for components whose "send component ID" box was ticked in the editor. get answers 70h with a text or 71h with a number in four bytes, little endian; sendme answers 66h and the page. Errors come back as codes too: 00h for an invalid instruction, 1Ah for an invalid variable or component, 1Eh for wrong parameters. The system variable bkcmd decides how chatty it is: 2 (the default) reports only failures, 3 also confirms every good instruction with 01h. At power-on the display sends 00 00 00 FF FF FF and then 88h, ready.

The Built-In Project

A real Nextion runs the project you load; a simulation model cannot open your .tft file. Our model therefore carries one built-in project with two pages. Page 0, "main", holds a title (t0), a status line (t1), a number (n0), a progress bar (j0) and three buttons: b0 ON, b1 OFF and b2 GRAPH. Page 1, "graph", holds a title, a waveform s0 (component id 2) and a BACK button. The b2 and BACK buttons change the page by themselves, as buttons with page in their release event do in a real project, and every button sends its touch events.

Features of the Nextion HMI Display Library for Proteus Simulation

  • A real-looking display: the board, the glass and its 400 x 240 active area, the 4-pin connector and the mounting holes - drawn compact so that it is not bigger than the Arduino.
  • The real protocol: a TTL UART at 9600 baud (baud and bauds change it), instructions ended by FF FF FF.
  • The instruction set: txt, val, pco, bco; page, ref, vis, cls, fill, line, draw, cir, cirs, xstr, get, sendme, rest, add; dim, bkcmd and sleep.
  • The return codes: 65h touch events, 66h, 70h and 71h answers, the error codes and 01h as bkcmd asks, the start-up codes, 86h and 87h.
  • Touch: click the glass at run time, use the pop-up's chips, or let the scene press the buttons.
  • A pop-up: the screen, the UART log of every instruction and answer, eight tiles, graphs, an event log and a check page.
  • LEDs: a PWR and a COM LED for the UART traffic (our additions).
  • A complete package: about 1.6 MB with the library, our 5 mm LED and resistor libraries, our Arduino UNO V4.0 and the demo, without the source code of the model.

The Nextion in Proteus

The device is NEXTION32TEP in TEPNEXTION.LIB, under Optoelectronics > TFT, with the prefix U and the model TEPNEXTION.DLL. Search NEXTION or HMI in Pick Devices. Four pins on the right: +5V, TX, RX and GND. Its properties: PROFILE (DEMO - the scripted touches - or STEADY) and BAUD (9600).

Figure: The Nextion 3.2" display.

Download Nextion HMI Display Library for Proteus Simulation

Click the button below to download Nextion-HMI-Display-Library-for-Proteus-v1.0.zip (about 1.6 MB, without the source code of the models):

Nextion HMI Display Library for Proteus V1.0
  • README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
  • Proteus Library Files: TEPNEXTION.LIB, TEPLED5MM.LIB, TEPRESISTOR.LIB and ArduinoV4TEP.LIB.
  • Proteus Model Files: TEPNEXTION.DLL, TEPLED5MM.DLL, TEPRESISTOR.DLL and TEPARDUINO.DLL.
  • Arduino Code: the demo sketch (it uses AltSoftSerial; no Nextion library).
  • Proteus Simulation: the demo project, its HEX file and copies of the DLLs.

No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.

How to Install Nextion HMI Display Library for Proteus Simulation

  1. Close Proteus and extract the whole zip file, for example to your Desktop.
  2. Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
  3. Copy the files from Proteus Model Files into the MODELS folder.
  4. Delete TEPNEXTION.IDX from the LIBRARY folder if it is there.
  5. Start Proteus, press P and search for NEXTION.

Proteus Simulation of a Heater Controller

Our demo controls a pretend heater. U1 is the Nextion with PROFILE DEMO: b0 ON is touched at 4 seconds, b1 OFF at 8, b2 GRAPH at 11 and BACK at 15. Its TX goes to D8 and its RX to D9 of our Arduino UNO Library for Proteus V4.0 - the pins of AltSoftSerial, so that the board's own Serial stays free for the monitor - and +5V and GND to the supply. D1, a red LED from our 5mm LED Library for Proteus on D5 through 220 ohm, shows the heater. The Arduino's built-in monitor is the same window as our TEP Serial Monitor Advance for Proteus. Open Nextion-Heater-ArduinoUnoV4.pdsprj.

Figure: The whole simulation on an A4 sheet.

The Sketch

The sketch needs no Nextion library. Every instruction is the text and three 0xFF bytes:

void send(const char* s) { nex.print(s); nex.write(0xFF); nex.write(0xFF); nex.write(0xFF); }   // one instruction

Setting a number is then one formatted string:

void sendVal(const char* obj, long v) { char b[24]; snprintf(b, sizeof b, "%s.val=%ld", obj, v); send(b); }

At start the sketch waits for 88h, then asks the display which page it shows and reads a text back:

  rxN = 0; send("sendme");                                  // which page? -> 66h page
  rxN = 0; send("get t0.txt");                              // read a text back -> 70h + the text

In the loop it collects the display's bytes into frames - three 0xFF end a frame - and hands every touch event to its handler:

      if (++ffCount == 3) { ffCount = 0; if (rxN == 4 && rx[0] == 0x65) onTouch(rx[1], rx[2], rx[3]); rxN = 0; }

A press on b0 (page 0, component 5) switches the heater on:

  if (pg == 0 && id == 5 && ev) { heater = true; digitalWrite(LED_HEAT, HIGH); sendTxt("t1", "Heater ON"); Serial.println(F("The heater is ON")); }

A waveform moves one pixel for every add, so a sample of a slow temperature would be a very short curve. The sketch therefore sends each sample as four add instructions, stepping smoothly from the last value to the new one:

  for (byte k = 1; k <= 4; k++) { char b[20]; snprintf(b, sizeof b, "add 2,0,%d", from + ((int)to - from) * k / 4); send(b); }

When b2 is released, the display shows the graph page by itself and the sketch sends the stored history to the waveform, sample after sample:

    for (byte i = 0; i < histN; i++) addPoint(i ? hist[i - 1] : hist[0], hist[i]);

Every half second the temperature rises by a degree with the heater on or falls by half a degree, and goes to n0 and j0 - or to the graph, on page 1.

Nextion Simulation Results

Open the project and press Run. The demo runs 17.0 simulated seconds and took about two and a half minutes on our PC with the pop-up open and the pictures being taken. Click the frame of the display for its pop-up (a click on the glass is a touch). Every number below comes from one simulation run, the demo exactly as it ships.

Start-Up

The display powers up at 2 ms and needs a moment to start its project: at 252 ms it sends 00 00 00 FF FF FF and the ready code 88h, and page 0 appears. The sketch has been waiting for exactly that - the monitor prints "Nextion ready (88h)". Then it asks sendme and gets 66h with page 0, and reads the title back with get t0.txt: 70h followed by "TEP Nextion demo". From now on it fills page 0 every half second - the status line, the temperature in n0 and the bar in j0.

Figure: The start-up.

The Heater On

At 4.0 s the demo touches b0, the ON button. The display sends 65 00 05 01 FF FF FF - page 0, component 5, a press - and the release a moment later. The sketch switches the heater LED on D5 on and writes "Heater ON" to t1. The temperature now rises by a degree every half second: 27 in n0 and 35 in j0 at 5 s, 32 and 60 at 9 s. On the sheet the button flashes as it is touched, the COM LED blinks with each instruction and the red LED shines.

Figure: The heater on.
Figure: The simulation in the workspace.
Figure: The touch on b0.

The Heater Off

At 8.0 s the demo touches b1, the OFF button: component 6. The heater LED goes out, t1 says "Heater OFF", the monitor prints 32.5 C, and the temperature falls by half a degree every half second.

The Graph Page

At 11.0 s the demo touches b2, GRAPH. Here the display itself acts: the release runs the project's own code, "page 1", and the graph page appears at 11.15 s. The sketch sees the release event, prints "Graph page: 22 points sent" and sends the history - 22 samples, four add instructions each - followed by a new sample every half second. The waveform s0 shows the whole story: flat at 25 C, up while the heater was on, down since.

Figure: The graph page.

Back to Page 0

At 15.0 s the demo touches BACK on page 1 (component 3): its release runs "page 0", the main page returns at 15.15 s and the sketch fills it again - 25.0 C, the heater off.

The Graphs, the Event Log and the Check Page

The Graphs page plots the bytes from and to the board, the page shown and the touches. The Event log keeps the start-up, each touch and each page change. The Check page sums up the run: +5V at 5.00 V with about 85 mA, the start-up codes sent, the UART at 9600 baud 8N1 with 2,299 bytes in, 91 out and no framing errors, 174 instructions and none failed, 4 touches with 8 touch events (65h), and one get answered with t0.txt = "TEP Nextion demo". Every line is green.

Figure: The Graphs page.
Figure: The Event log.
Figure: The Check page.

The monitor shows the sketch's side: the start-up, the page, the text it read back, each touch and the temperature.

Figure: The monitor.

A Nextion or a Plain TFT?

Our TFT ST7735 Library for Proteus and GC9A01 Round TFT Library for Proteus are plain TFTs: your board draws every pixel over SPI, which gives you total freedom and costs code and time. A Nextion is the opposite trade: the interface is designed on a PC and lives in the display, the board sends a few bytes of text, and even a small Arduino can drive a rich touch interface. The price is a little less freedom, the editor step and a slightly more expensive display.

Try It Yourself

  • Click b0 on the glass while the simulation runs: the heater turns on, exactly as with the scripted touch.
  • Send bkcmd=3 at start: every good instruction is now answered with 01h - watch the UART log fill up.
  • Misspell a component - n9.val=5 - and the display answers 1Ah, invalid variable.
  • Send dim=20: the backlight drops to a fifth; sleep=1 darkens the screen and sends 86h.
  • Change the baud rate with baud=115200 and switch AltSoftSerial to match.

Ideas to Extend the Demo

  • A real thermostat: a temperature sensor, a set point on the display and a relay.
  • A menu of pages for a small machine: start, stop, settings, alarms.
  • A logger that shows a day of readings on the waveform.

Your Own Sketches

The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.

Things to Know Before Using a Real Nextion

  • The project: design the pages in the Nextion Editor, tick "send component ID" where the board must hear touches, and load the .tft from an SD card or over the UART.
  • Power: 5 V with enough current - the backlight alone draws tens of milliamps; a weak supply resets the display.
  • Wiring: the display's TX to the board's RX and its RX to the board's TX; a software serial port keeps the board's Serial free.
  • Local components: they get their design values back when the page changes - send the values again after a page change.
  • The end bytes: every instruction ends with 0xFF 0xFF 0xFF, and every answer too.

Troubleshooting

  • Nothing happens: TX and RX swapped, different baud rates, or the three 0xFF bytes missing.
  • 1Ah answers: the component's name is wrong or it is on a page that is not shown.
  • No touch events: "send component ID" not ticked for that component.
  • Values lost after a page change: local components - send them again.
  • The part is not simulated: TEPNEXTION.DLL is missing from MODELS and from the project folder.

Limitations of the Simulation

  • The UART, the instruction set, the screen drawing commands, the return codes, bkcmd, sleep and dim, the start-up codes and the touch events follow the maker's instruction set; the board is our own drawing.
  • Our own choices: the built-in two-page project in place of your .tft file, our own font for the fonts 0 - 3, the instruction time (only the UART's), the compact drawing and the LEDs.
  • Not modelled: loading your own project, pictures, a project's timers and variables, the Enhanced and Intelligent series' extras.
  • Nextion is a name of its maker; this library is not made or endorsed by Arduino, Labcenter or the maker of Nextion displays.
  • Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.

So, that was all about the Nextion HMI Display Library for Proteus Simulation. I hope it helps you get your instructions, your FF FF FF endings and your touch events right before the display is on your desk - and shows how much a small Arduino can do when the screen thinks for itself. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!