Skip to content

Nextion Display

Wotever edited this page Mar 7, 2019 · 40 revisions

WARNING !

Unfair sellers sells a chenese version of the nextion, these are branded TJCxxxxx, they are not supported by the nextion editor and would be useless with SimHub, make sure to buy a real nextion (model starting with NXxxxx)

** 5" and more nextion sizes are not advised due to average performance ** ** 4.3 or 2.8 nextion have bundled templates other sizes will work but will require custom template design.** ** Designs are specific to the nextion, take care not to confuse with DashStudio dashs (which are compatible with computer/phones or USBD480) **

Introduction

Nextion is a standalone serial screen. Design is rendered by the screen itself. Despite some performances limitations of the screen due to it's internal MCU, it's still a good alternative for lightweight dash as it can be embedded easily in a wheel with only a single usb port.

Designs are specific to the nextion, take care not to confuse with DashStudio dashs (which are compatible with computer/phones or USBD480)

Wiring nextion display

Parts needed :

  • Nextion display (4.3 or 2.8),
  • Wires
  • Usb TTL

Connect USB TTL following these wirings

GND => GND
5V => 5V
RX => TX
TX => RX

Warning ! Trap inside ! Take care, TX goes to RX

Always make sure Simhub is closed before uploading.

Wiring nextion through an Arduino Micro

MICRO => Nextion
GND   =>   GND
VCC   =>   5V
RX1   =>   TX
TX0   =>   RX

In order to draw enough power from the arduino micro (for the 4.3 and more nextion screens) you may have to solder the J1 jumper of the arduino :

Uploading Arduino Micro sketch

Upload the sketch found in C:\Program Files (x86)\SimHub\_Addons\NextionMicroBridge It offers the structure to add gamepad support, please note that it's just a sample with a single button and you must add your own logic.

In order to compile the sketch please use the arduino IDE in C:\Program Files (x86)\SimHub\\_Addons\Arduino\ArduinoIDE\arduino-1.6.13 it contains all the required libraries

Optionnal : enabling led support

WS2812b leds can be added to the arduino micro

WS2812b Leds wiring

Aduino Micro => Leds
GND => GND
5V or VCC => 5V or VIN
D6 or 6 => DIN

LEDS have a direction ! Do not mix uy DI/DIN with DO/DOUT ! DO/DOUT can be used to cascade another strand

Sketch configuration

In order to enable leds you have to configure the sketch in the Aduino IDE :

  • Before (leds disabled):
// ----- LEDS ---------
// Uncomment to enable leds
// #define INCLUDE_WS2812B 
// How many leds
#define WS2812B_RGBLEDCOUNT 8
// Data pin
#define WS2812B_DATAPIN 6
// 0 left to right, 1 right to left
#define WS2812B_RIGHTTOLEFT 1
  • After (leds enabled), change WS2812B_RGBLEDCOUNT according to how many leds are plugged
// ----- LEDS ---------
// Uncomment to enable leds
#define INCLUDE_WS2812B 
// How many leds
#define WS2812B_RGBLEDCOUNT 8
// Data pin
#define WS2812B_DATAPIN 6
// 0 left to right, 1 right to left
#define WS2812B_RIGHTTOLEFT 1

Enabling leds into simhub :

The leds can be configured in Arduino/Leds

Uploading Nextion template through arduino Micro

Before any upload make sure SimHub is not running !

Upload to nextion will not work using the Itead nextion editor but Simhub offers an alternative uploader.

  • Build your template using the editor using the "compile" button :

  • Open build folder :

  • double click on your template file :

  • Choose your arduino serial port and click on upload, you're ready !

Clone this wiki locally