Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Getting started with Nextion HMI

By Usman ali Butt May 3, 2021

This tutorial will teach how to use and program HMI (Human Machine Interface) display.HMI displays have been in the market for quite a long time, but their price dropped for the last two years, and now DIY makers are using them in projects.

Note that HMI display is different from touch display. Touch display only displays the text or image which the user sends for display. However, HMI is not only a touch display. It can also process data by itself and take future measures based on the programmer’s programmed software.

Nextion HMI displays are the most popular among DIY hobbyists, and we will learn how to program, interface and work with them. Download and install the nextion GUI builder editor. Once installed, open editor and started creating a new project. Go to File>New in the window gives the project a valid name, and the project will be saved with. HMI extension. After creating the project, a new window will pop up where you will be asked to select your HMI. Nextion offers multiple HMI’s in Basic, Enhanced, and Intelligent categories. Find your HMI category, name and select it.

NX8048T070_011 is 7 inch 800×480. Once you are done, hit OK. Next, the orientation of the display is required to be selected. Select the orientation of the display. You can also select the character encoding. I prefer to work with default iso-8891-1. Hit Ok, and you are done with the display settings.

Main editor window

The main editor window comprises many small windows, each used to set different parameters/functions and configurations, overlooking the main window and its sub-windows.

Let’s create two pages and jump from one to another. On the main page header, I want to display the EngineersGarage logo. So first, I need to import the logo into the editor. Click the add button navigate to the image, and press enter. The logo is imported and displayed in the window. Logo parameters size, height width, and format appear beneath it. The logo is assigned an ID-0. Every object in the editor is assigned an ID.

To place this picture in the display pane double, click the picture object. A rectangular box will appear in the display pane. p0(picture0) is the object name.

To display the EngineersGarage logo in the picture box, click the box and navigate to the attribute window. P0 attributes are listed in the window. Id is 1, scope is local (if global, then this object can be seen in other pages). The pic attribute is where we have to put the id of picture we want to display in the picture box. In our case, the logo id is 0, so put 0 and hit enter (You can also use the browse feature to select the pictures available in the picture window manually). The logo will appear in the picture box.

Make sure your picture is not out of the display pane. Adjust it in a pane using a mouse.

Display text

To display text first, we have to generate a font. Font generator application is part of the editor. Navigate to Tools>FontGenerator.

Generate font which you want to display on HMI. Give a valid name to each font, select height, and encoding, etc. If more than one font is part of the project, generate each one by one.

I specified two fonts. You can view the fonts in the font window. Each font is assigned an ID and name.

To assign a text box, a particular font enters the font ID next to the font attribute. Attribute txt is where you input the text, which later appears in the text box. Pco attribute changes the color of the text. Each object and its attributes can be studied by using the help option from the editor.

I created two pages few pictures and text boxes are present on each page. One button is placed on the main page. Pressing the button will take you to the next page.

To switch between pages using a button, we must create an event. The event can be on button press or release. I specified on release. Put page page1 in the button release event. Commands can be studied using help from the editor menu.

Now all you need to do is compile code and then start debugging.

 

 

Note: You don’t need any external hardware for this project—just a power supply for powering HMI.

Uploading the sketch to HMI

After successful debugging of the GUI application, it’s time to upload the sketch to HMI. The best solution is to upload it using a USB to TTL converter. Connect the serial converter to the USB port and its UART lines with HMI. From the text editor in the tools bar, select the COM port, set the baud rate to 9600, and hit upload. The sketch will start uploading, and it will take 3 to 6 minutes, depending on the application size.

Another method is to copy the .TFT file generated by the nextion editor in an SD card. Insert the card in the HMI sd-card slot and power up the HMI. GUI program will automatically be uploaded in the HMI. You can remove the sd-card when the upload is finished.

Let’s DIY it: Where to purchase parts?

Mouser: Nextion HMI display

Mouser: USB to UART

Mouser: Power supply

You may also like:


  • What is a low power design?

  • What is a Schottky diode?

  • What are Arduino force-sensitive resistors?
  • HMI systems
    Human Machine Interface systems: Harmonising man and machine

  • Touchscreens or Human Machine Interface (HMI)

  • Understanding computer vision and its application in electronics

Filed Under: Electronic Projects
Tagged With: Electronic project, touch screen human machine interface
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Voltage mode pushpull is a nonsense SMPS?
  • Input impedance matching network
  • High Side current sensing
  • The comparison of different Tcl script checkers
  • Reducing "shoot-through" in offline Full Bridge SMPS?

RSS Electro-Tech-Online.com Discussions

  • Back to the old BASIC days
  • Parts required for a personal project
  • PIC KIT 3 not able to program dsPIC
  • Failure of polypropylene motor-run capacitors
  • Siemens large industrial PLC parts

Featured – RPi Python Programming (27 Part)

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
  • RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi

Recent Articles

  • What is AWS IoT Core and when should you use it?
  • AC-DC power supply extends voltage range to 800 V DC
  • Infineon’s inductive sensor integrates coil system driver, signal conditioning circuits and DSP
  • Arm Cortex-M23 MCU delivers 87.5 µA/MHz active mode
  • STMicroelectronics releases automotive amplifiers with in-play open-load detection

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe