DIY Stream Deck With Arduino & Nextion - Customize Your Workflow!

by Electronic CNC Lab in Circuits > Arduino

151 Views, 8 Favorites, 0 Comments

DIY Stream Deck With Arduino & Nextion - Customize Your Workflow!

098_Stream Deck FAI-DA-TE con Arduino! Controlla il PC con un tocco!

πŸ”§ Build Your Own Custom Stream Deck! πŸ”§

Are you a content creator, a streamer, or just looking to automate your workflow? Then this project is for you! 🎯

In this step-by-step guide, I’ll show you how to create a DIY Macro Touch Deck using a Nextion display and an Arduino Pro Micro. With this device, you can launch programs, open folders, execute keyboard shortcuts, and more – all with a simple tap!

πŸ’‘ Why build it instead of buying one?

βœ… Affordable – Costs way less than a commercial Stream Deck.

βœ… Fully customizable – Assign any function to your buttons!

βœ… Open-source project – Easily modifiable and expandable.

πŸ“Œ What will you learn in this guide?

  1. Designing the graphical interface with Nextion Editor.
  2. Programming the Arduino to send custom commands.
  3. Assembling and testing a fully functional DIY Stream Deck.

πŸ’¬ Have ideas or improvements? Drop a comment and let me know!

Supplies

Mini USB B Cable.png
Electronic Wires.png
USB C Cable.png
FTD782.png
Arduino Micro PRO.png
Display Nextion.png
Crimping Tool for JST.png
Boccole filettate.png


  1. Nextion 2.8" Display (NX3224K028) – HMI touchscreen for the graphical interface;
  2. Arduino Pro Micro – Microcontroller with HID support for keyboard emulation;
  3. USB-to-Serial Converter (FT782 or equivalent) – For communication between Nextion and Arduino;
  4. Standard Wires + JST Connectors – For soldering connections and easy plug-in;
  5. JST Connector Crimping Tool – To Make The Cable That Connects The Display To Arduino
  6. USB C Cable – For power and programming the Arduino;
  7. Mini USB B – For power and programming the display;
  8. Threaded Inserts, M2 M2.5 M3 M4 M5 M6

Creating the Graphical Interface for the Nextion Display

00-Nextion.png

Creating the Graphical Interface for the Nextion Display

The heart of our DIY Stream Deck is the touch interface, allowing us to execute commands on the PC with a single tap. To build it, we will use Nextion Editor, a dedicated software for designing graphical user interfaces (GUIs) for Nextion displays.

Installing Nextion Editor

01-Nextion.png

Before getting started, download and install Nextion Editor from the official site: ITEAD Nextion.

  1. Open the software and create a new project.
  2. Select the display model you’re using (Nextion 2.8” NX3224K028 in this case).
  3. Set the correct resolution (320x240 px).


Designing the Interface

02-Nextion.png
03-Nextion.png

Now, let's start building the buttons and layout of our interface:

βœ… Adding a Main Screen:

  1. Click "Add Page" and rename it "Home".
  2. Set a background color or upload a custom image as the background.

βœ… Adding Function Buttons:

  1. Select the "Button" widget from the toolbar.
  2. Position and resize the buttons in the grid.
  3. For each button, assign:
  4. Object Name (objname) for identification (e.g., btn_YT for YouTube).
  5. Unique ID for Arduino recognition.
  6. Label or Icon (you can upload custom images).

βœ… Assigning Serial Commands:

  1. In the Touch Release Event tab, insert the serial command that will be sent to the Arduino when the button is pressed:
print "a"
  1. (This will send the letter "a" via serial, which Arduino will interpret to open YouTube.)
  2. Repeat this process for each button, using different letters (b, c, d…) for other functions.


Uploading the Interface to the Display

NEXTION DISPLAY PROGRAMMING DIAGRAM.png
FTD782.png
04-Nextion.png
05-Nextion.png
06-Nextion.png
07-Nextion.png
08-Nextion.png

Once the interface is ready, we need to upload it directly to the Nextion display's internal memory, without using a microSD card.

1️⃣ Connect the Nextion display to your PC using a USB-to-TTL adapter (e.g., FTDI FT232RL).

2️⃣ Open Nextion Editor and navigate to File > Upload.

3️⃣ In the upload settings:

  1. Select the correct COM port assigned to the Nextion display.
  2. Set the baud rate (e.g., 115200 for faster transfer).
  3. 4️⃣ Click "Upload" and wait for the process to complete.
  4. 5️⃣ Once done, restart the Nextion display to verify that the interface is correctly loaded.

Now, your Nextion display is ready with the custom interface, stored in its internal memory! πŸš€

Link to file: Project loaded on nextion display


Connecting the Nextion Display to Arduino Pro Micro

09-Nextion.png
10-Nextion.png
11-Nextion.png
16-Nextion.png

Now that we have prepared the firmware, it's time to connect the hardware and upload the code to the Arduino Pro Micro. The connections are simple and require only four wires between the Nextion display and the Arduino.

πŸ”Œ Wiring Diagram

In the diagram above, you can see the final wiring between Nextion 2.8", Arduino Pro Micro, and PC for firmware upload. Here are the necessary connections:

⚠️ Important:

  1. The Nextion display operates at 5V, so it can be directly connected to the Arduino Pro Micro.
  2. If using a 3.3V microcontroller, a logic level shifter is needed for RX/TX.
  3. The Arduino must be connected via USB to the PC to upload the firmware.


Uploading the Firmware

12-Nextion.png
13-Nextion.png
14-Nextion.png
15-Nextion.png

Once the wiring is completed:

1️⃣ Connect the Arduino Pro Micro to your PC via USB

2️⃣ Open Arduino IDE and load the firmware sketch

3️⃣ Select the correct board and port (Arduino Pro Micro / ATmega32U4)

4️⃣ Click Upload and wait for the process to complete

Once the upload is complete, the Nextion display should now be able to communicate with Arduino, sending commands that will be executed on your PC! πŸŽ‰


/**
* Stream Deck - PC Control with Arduino and Nextion Display
*
* This sketch transforms an Arduino Pro Micro (HID) and a Nextion display
* into a Stream Deck, a programmable keyboard with a customized graphical interface.
* The device is capable of:
* - Opening websites such as YouTube, Facebook, and Instructables
* - Launching applications like Filmora, Arduino IDE, Total Commander, PowerPoint, and Word
* - Opening specific folders like "Download"
* - Taking screenshots using the Windows + Shift + S shortcut
* - Simulating key combinations to enhance the user's workflow
*
* This project is perfect for anyone looking to simplify daily PC operations
* and create a personalized touch interface.
*
* πŸ“Ί Project video: [INSERT VIDEO LINK]
* πŸ”” Subscribe to the YouTube channel Electronic & CNC Lab: https://www.youtube.com/@Electronic.CNCLab
* Video link: https://youtu.be/jhJxBRKb4Ug
*
* Β© Giuseppe from Electronic & CNC Lab - 2025
*/

#define HID_CUSTOM_LAYOUT
#define LAYOUT_ITALIAN
#include <HID-Project.h>

void setup() {
Serial.begin(9600); // Debug on USB
Serial1.begin(9600); // Communication with Nextion on Serial1 (RX1/TX1)
Keyboard.begin(); // Activate HID keyboard emulation

Serial.println("Macro Touch Deck Started!");
}

void loop() {
if (Serial1.available()) {
char cmd = Serial1.read(); // Read a single character
Serial.print("Command received from Nextion: ");
Serial.println(cmd);

executeCommand(cmd);
}
}

/**
* Executes the command corresponding to the received character
*/
void executeCommand(char cmd) {
if (cmd == 'a') { Serial.println("Opening YouTube..."); openURL("https://www.youtube.com"); }
else if (cmd == 'b') { Serial.println("Opening Facebook..."); openURL("https://www.facebook.com"); }
else if (cmd == 'c') { Serial.println("Opening Instructables..."); openURL("https://www.instructables.com"); }
else if (cmd == 'd') { Serial.println("Opening Filmora..."); openProgram("Filmora.exe"); Serial.println("Ensure the correct path to Filmora is set on your system (use double backslashes '\\' in paths)."); }
else if (cmd == 'e') { Serial.println("Opening Arduino IDE..."); openProgram("Arduino IDE.exe"); Serial.println("Ensure the correct path to Arduino IDE is set on your system (use double backslashes '\\' in paths)."); }
else if (cmd == 'f') { Serial.println("Opening Total Commander..."); openProgram("C:\\Program Files\\totalcmd\\TOTALCMD64.EXE"); }
else if (cmd == 'g') { Serial.println("Opening Paint..."); openProgram("mspaint"); }
else if (cmd == 'h') { Serial.println("Opening Download folder..."); openProgram("Downloads"); Serial.println("Ensure the correct path to your Downloads folder is set on your system (use double backslashes '\\' in paths)."); }
else if (cmd == 'i') { Serial.println("Taking Screenshot..."); takeScreenshot(); }
else if (cmd == 'j') { Serial.println("Opening YouTube Channel..."); openURL("https://www.youtube.com/@Electronic.CNCLab"); }
else if (cmd == 'k') { Serial.println("Opening PowerPoint..."); openProgram("C:\\Program Files\\Microsoft Office\\root\\Office16\\POWERPNT.EXE"); }
else if (cmd == 'l') { Serial.println("Opening Word..."); openProgram("C:\\Program Files\\Microsoft Office\\root\\Office16\\WINWORD.EXE"); }
else { Serial.println("Unrecognized command!"); }
}

/**
* Opens a URL in the browser
*/
void openURL(const char* url) {
// Open "Run"
Keyboard.press(KEY_LEFT_GUI); // Windows Key
Keyboard.press(KEY_R); // 'R' key
Keyboard.releaseAll();
delay(300);

// Type the URL and press Enter
Keyboard.print(url);
Keyboard.write(KEY_RETURN);
}

/**
* Opens a specific program
*/
void openProgram(const char* path) {
Serial.print("Opening program: ");
Serial.println(path);

// Open "Run" using Win+R
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press(KEY_R);
delay(300); // Wait for the window to open
Keyboard.releaseAll(); // Release keys

delay(500); // Ensure "Run" window is ready

// Type the path and press Enter
Keyboard.print(path); // Use print to avoid additional newline
delay(300); // Wait for input
Keyboard.write(KEY_RETURN);
}

/**
* Opens a folder in File Explorer
*/
void openFolder(const char* path) {
Serial.print("Opening folder: "); Serial.println(path);

Keyboard.press(KEY_LEFT_GUI);
Keyboard.press('R'); // Open "Run" window
Keyboard.releaseAll();
delay(600); // Wait for the window to open

Keyboard.print(path); // Type the exact folder path
delay(300); // Wait briefly for safety
Keyboard.write(KEY_RETURN); // Press Enter to open the folder
}

/**
* Takes a screenshot (Windows + Shift + S)
*/
void takeScreenshot() {
Serial.println("Taking Screenshot...");
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press(KEY_LEFT_SHIFT);
Keyboard.press('S');
delay(100);
Keyboard.releaseAll();
}

/**
* Simulates a key combination (e.g., Ctrl+A, Ctrl+C, Ctrl+V)
*/
void pressKeys(uint8_t key1, uint8_t key2) {
Serial.print("Pressing keys: ");
Serial.print(key1, HEX);
Serial.print(" + ");
Serial.println(key2, HEX);

Keyboard.press(key1);
delay(50);
Keyboard.press(key2);
delay(100);
Keyboard.releaseAll();
}

STL Files