Skip to content

Nextion display

Robin Müller edited this page Aug 3, 2026 · 4 revisions

Nextion display

Smart Drink Fridge 1.3.8 adds an optional status and sign-in interface for the Nextion NX4832K035 Enhanced 3.5-inch display (480 × 320, resistive touch).

The exact unit used for development and hardware testing is available through this Amazon product link. For countries where the Amazon listing is unavailable, the same model is also listed through this shortened international AliExpress product link. Store listings and selectable variants can change, so verify that the full model number is NX4832K035. Basic, Discovery, and Intelligent Nextion variants with similar screen sizes are different devices and are not covered by this setup.

Printed enclosure

The installation shown in the project README uses this printable Nextion 3.5-inch case with cable pass-throughs on MakerWorld. It provides an enclosed mount while routing the four-wire serial cable out of the case. Verify the display dimensions and selected print profile before printing, particularly if your display is not the tested NX4832K035.

What the display does

  • Shows the currently selected scanner user
  • Prompts for NFC or PIN when the strict scanner policy is enabled
  • Offers an on-screen user selector and masked numeric PIN keypad
  • Shows the product, quantity, remaining stock, and user from the latest successful camera barcode booking
  • Can optionally rotate to an inventory summary showing products, total units, and low-stock products

Drinks are not added or removed by touching the display. The camera barcode scanner remains the only booking input.

Configure pages in Settings

Open Settings → Nextion display to choose whether the display shows:

  • The active user and PIN sign-in button
  • The latest scanner booking
  • A rotating inventory summary page
  • The number of seconds between the main and inventory pages

The display service reads these choices from the application database. Changes therefore take effect automatically and do not require a new .tft file or a display reflash.

Wiring

Switch off the Raspberry Pi before changing connections. TX and RX must be crossed:

Nextion wire Raspberry Pi physical pin
Red, +5V Pin 2, 5V
Black, GND Pin 6 or pin 14, GND
Yellow, Nextion RX Pin 8, GPIO14 / TX
Blue, Nextion TX Pin 10, GPIO15 / RX

Do not power the Nextion from the Pi's 3.3 V pin. Use a stable Pi power supply with enough capacity for the display, camera, and NFC reader.

Enable the Raspberry Pi UART

Run:

sudo raspi-config

Under Interface Options → Serial Port:

  1. Disable the serial login shell.
  2. Enable the serial hardware.

The boot command line must not contain console=serial0,115200 or console=ttyS0,115200. On current Raspberry Pi OS it is stored in /boot/firmware/cmdline.txt and must remain a single line.

For a Raspberry Pi 3, use the stable PL011 hardware UART by adding this to /boot/firmware/config.txt:

enable_uart=1
dtoverlay=miniuart-bt

Reboot and verify:

readlink -f /dev/serial0
systemctl is-active serial-getty@ttyS0.service

The first command should normally print /dev/ttyAMA0 on a Pi 3 and the Getty must be inactive.

Docker setup

The default configuration is:

NEXTION_PORT=/dev/serial0
NEXTION_BAUD=9600
NEXTION_LANGUAGE=de
NEXTION_USER_SECONDS=120

Supported display languages are de, en, and fr. Start the complete setup:

docker compose --profile scanner --profile nfc --profile display up -d

Check it with:

docker compose --profile display ps
docker compose logs --tail=100 display

The service detects both 9600 and 115200 baud and switches to 115200 for fast rendering. It uses its own pixel font, so it does not depend on fonts inside a preinstalled HMI project.

Factory demo and flashing

Many NX4832K035 units arrive with the blue Production Plant demo. Flashing a custom .tft file is not required. The service opens the known demo page, disables its page-change timer, and redraws the Smart Drink Fridge interface whenever the container starts. This avoids the risk and maintenance burden of a separate proprietary Nextion project.

NFC and PIN flow

When user accounts are enabled, presenting an assigned NFC tag selects its user for 120 seconds. If no tag is available, tap Sign in with PIN, select an active account, and enter its existing web PIN. The value is masked, checked locally against the stored password hash, and never logged.

After the next successful removal scan, the temporary user selection is cleared and the display shows the completed scanner booking. When user accounts are disabled, anonymous scanning continues normally.

Clone this wiki locally