Skip to content

Nextion Display

Wotever edited this page Jan 19, 2022 · 40 revisions

Intruction

Simhub allows to use nextion screens are simple graphics dash, they have a light system footprint, and can be integrated easily as it uses only a single USB connection (see wiring possibilities below).

Mainly targetting DIY lovers, it's an affordable alternative to USBD480 for simple wheel or device embedded dash.

WARNING !

5" and more nextion sizes are not supported due to bad performances

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)

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)

Nextion wiring

Nextion can be connected using two methods at choice :

  • USB TTL : The screen will work standalone
  • Arduino Pro Micro : The arduino will emulate a TTL and allow RGB LEDs or buttons to be added

NB : Why exclusively arduino pro micro ? Because it has the only arduino chip (ATMEGA32U4) capable of detecting dynamic baudrate changes making it fully compatible with TTL emulation.

Wiring nextion display using an usb TTL

Parts needed :

Connect USB TTL following these wirings

GND => GND
5V => 5V
RX => TX
TX => RX
  • Warning ! Trap inside ! Take care, TX goes to RX otherwise upload and connection will fail
  • Make sure to install the drivers coming with your USB TTL otherwise upload and connection will fail.
  • 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 :

Led editor guide

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 :

  • Output TFT file :

  • The output folder will open,double click on the file :

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

Clone this wiki locally