The Nextion 2.8 is a smart display module manufactured by Nextion, featuring a 2.8-inch resistive touchscreen interface. It is designed to simplify the development of Human-Machine Interfaces (HMI) by integrating a built-in microcontroller and a user-friendly design environment. The module communicates via UART (serial communication), making it compatible with a wide range of microcontrollers, including Arduino, Raspberry Pi, and other embedded systems.
Explore Projects Built with nextion 2.8
Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
This circuit features an Arduino Nano microcontroller interfaced with a Nextion Touch LCD for user input/output, multiple SSR-10A solid-state relays for controlling high-power devices, and a single-channel relay for additional switching capabilities. It includes an Adafruit MCP9600 for temperature measurements, an MQ-5 gas sensor for detecting gas concentrations, a Hall effect sensor for magnetic field detection, and a CAN BUS module for vehicle communication. The circuit is powered by an LM2596 step-down module and includes various resistors for voltage/current adjustments and protection.
This circuit is centered around an Arduino Mega 2560, which controls a Nextion Touch LCD for user interface and a series of relays for switching various loads. The Arduino is powered by a 9V SMPS, and it drives an 8-channel 5V relay module to control devices like pumps, a loudspeaker, actuators, a heating plate, and a plucker. The relays are interfaced with solid-state relays (SSRs) and a thermistor for temperature sensing, enabling controlled power distribution to the connected devices based on programmed logic and user input.
This circuit features an Arduino Nano connected to an OLED display and a DS3231 real-time clock (RTC) module for displaying the current time. The Arduino Nano is powered through a toggle switch connected to its VIN pin, with power supplied by a TP4056 charging module that charges and manages two 3.7V LiPo batteries connected in parallel. The OLED and RTC module communicate with the Arduino via I2C, with shared SDA and SCL lines connected to the A4 and A5 pins of the Arduino, respectively.
This circuit features an ESP8266 NodeMCU microcontroller connected to a 1.3-inch OLED display via I2C communication. The microcontroller initializes the display and renders basic graphics and text, demonstrating a simple interface for visual output.
Below are the key technical details of the Nextion 2.8 smart display module:
Specification
Details
Display Type
2.8-inch TFT resistive touchscreen
Resolution
320 x 240 pixels (QVGA)
Color Depth
65K (16-bit RGB)
Communication Interface
UART (TTL, 9600 bps default)
Input Voltage
4.75V to 7V
Power Consumption
90mA (typical)
Operating Temperature
-20°C to 70°C
Storage Temperature
-30°C to 85°C
Flash Memory
4MB
RAM
3584 bytes
Dimensions
85mm x 50mm x 5.1mm
Pin Configuration and Descriptions
The Nextion 2.8 module has a 4-pin interface for power and communication:
Pin
Name
Description
1
GND
Ground connection
2
VCC
Power supply (4.75V to 7V)
3
TX
Transmit data (output from Nextion to host device)
4
RX
Receive data (input to Nextion from host device)
Usage Instructions
How to Use the Component in a Circuit
Powering the Module: Connect the VCC pin to a 5V power source and the GND pin to the ground of your circuit.
Serial Communication: Connect the TX pin of the Nextion module to the RX pin of your microcontroller, and the RX pin of the Nextion module to the TX pin of your microcontroller.
Programming the Display:
Use the Nextion Editor software to design your user interface (UI). This software allows you to add buttons, sliders, text fields, and other UI elements.
Compile and upload the UI design to the Nextion module via a microSD card or serial connection.
Interfacing with a Microcontroller:
Use UART communication to send and receive commands between the Nextion module and your microcontroller.
Libraries such as the Nextion Arduino library can simplify communication.
Important Considerations and Best Practices
Power Supply: Ensure a stable power supply to avoid display flickering or unexpected resets.
Baud Rate: The default baud rate is 9600 bps. You can change it in the Nextion Editor if needed.
Touch Calibration: The module is pre-calibrated, but you can recalibrate it using the Nextion Editor if required.
Avoid Direct Connections to 3.3V Logic: If your microcontroller operates at 3.3V logic levels, use a level shifter for the TX and RX lines to ensure proper communication.
Example Code for Arduino UNO
Below is an example of how to interface the Nextion 2.8 with an Arduino UNO:
#include <Nextion.h>
// Define Nextion display object with serial communication
// Connect Nextion TX to Arduino pin 2 (RX) and RX to pin 3 (TX)
SoftwareSerial nextionSerial(2, 3); // RX, TX
Nextion myNextion(nextionSerial, 9600); // Initialize Nextion with 9600 baud rate
void setup() {
nextionSerial.begin(9600); // Start serial communication with Nextion
Serial.begin(9600); // Start serial communication with PC for debugging
// Send a command to clear the screen and display "Hello, World!"
myNextion.init(); // Initialize the Nextion display
myNextion.sendCommand("cls WHITE"); // Clear screen with white background
myNextion.sendCommand("xstr 50,50,200,30,0,BLACK,WHITE,1,1,1,\"Hello, World!\"");
}
void loop() {
// Example: Read touch events (if any)
String touchData = myNextion.listen();
if (touchData != "") {
Serial.println("Touch Event: " + touchData); // Print touch data to Serial Monitor
}
}
Troubleshooting and FAQs
Common Issues and Solutions
Display Not Powering On:
Ensure the VCC and GND pins are properly connected.
Verify that the power supply provides sufficient voltage (4.75V to 7V).
No Communication with Microcontroller:
Check the TX and RX connections. Ensure they are not swapped.
Verify that the baud rate in your code matches the baud rate of the Nextion module.
Touchscreen Not Responding:
Ensure the display is not physically damaged.
Recalibrate the touchscreen using the Nextion Editor.
UI Not Displaying Correctly:
Confirm that the UI design was successfully uploaded to the module.
Check the microSD card for errors if used for uploading.
FAQs
Q: Can I use the Nextion 2.8 with a 3.3V microcontroller?
A: Yes, but you must use a level shifter for the TX and RX lines to ensure proper communication.
Q: How do I reset the module to factory settings?
A: Use the Nextion Editor to upload a blank project or send the rest command via serial communication.
Q: Can I use the Nextion 2.8 for video playback?
A: No, the Nextion 2.8 does not support video playback. It is designed for static and interactive UI elements.
Q: What is the maximum size of the UI project I can upload?
A: The module has 4MB of flash memory for storing UI projects. Ensure your project size does not exceed this limit.