Thermal printers are everywhere.
Whether you're printing shopping receipts, restaurant bills, parking tickets, shipping labels, or queue tokens, chances are you've interacted with a thermal printer at some point. Unlike traditional inkjet or laser printers, thermal printers produce text by selectively heating special thermal paper, eliminating the need for ink cartridges or toner.
Because of their speed, reliability, and low operating cost, thermal printers have become one of the most popular output devices in embedded systems and IoT applications.
If you've ever wanted to add a printer to your Arduino or ESP32 project, you'll be happy to know that it's much easier than it might seem.
In this tutorial, we'll interface a QR204 Thermal Printer with the ESP32-S3-BOX-3. Rather than building a complicated billing system or receipt printer, we'll start with the simplest possible example.
Whenever the on-screen Print button is pressed, the ESP32 sends text to the thermal printer over a UART serial connection. The printer immediately prints:
Hello World!
I am QR204
Thermal PrinterAlthough this example is intentionally simple, it introduces one of the most important concepts when working with embedded printers—serial communication.
Once you understand how text is transmitted to the printer, you'll be able to create much larger projects, including:
- Point-of-Sale (POS) systems
- Billing machines
- Restaurant ordering systems
- RFID attendance receipts
- Inventory labels
- Visitor passes
- Smart ticketing systems
- Medical reports
- IoT data loggers
- Portable receipt printers
Think of this project as the first building block toward professional thermal printing applications.
Why Use the ESP32-S3-BOX-3?The ESP32-S3-BOX-3 is much more than a standard ESP32 development board.
It combines a powerful dual-core ESP32-S3 processor with a high-quality touchscreen display, USB Type-C connectivity, wireless networking, and excellent graphics support, making it an ideal platform for Human Machine Interface (HMI) projects.
Instead of relying on external buttons and displays, the touchscreen allows us to build interactive interfaces with very little hardware.
For this project, the touchscreen acts as our print button. A single touch triggers the printing process, making the demonstration clean, intuitive, and beginner-friendly.
Why Thermal Printers?Thermal printers offer several advantages over conventional printers.
- Fast printing speeds
- Quiet operation
- No ink or toner required
- Low maintenance
- Compact size
- Low power consumption
- Easy UART communication
- Widely used in commercial applications
Since most embedded thermal printers communicate using simple serial commands, they are incredibly easy to interface with microcontrollers such as the ESP32.
Project OverviewThe overall workflow of the project is extremely straightforward.
User Touches
Print Button
│
▼
ESP32-S3-BOX-3
│
UART Serial
Communication
│
▼
QR204 Thermal Printer
│
▼
Prints
Hello World!
I am QR204
Thermal PrinterThe ESP32 continuously monitors the touchscreen.
As soon as the Print button is pressed, it sends standard ESC/POS initialization commands followed by the text that we want to print.
The printer receives the serial data and immediately begins printing.
Because thermal printers internally interpret standard ASCII characters, printing text is almost identical to writing data to the Serial Monitor.
This makes thermal printers one of the easiest peripherals to integrate into an embedded project.
FeaturesThis project includes:
- Interactive touchscreen interface
- One-touch printing
- UART communication
- ESC/POS printer initialization
- Beginner-friendly Arduino code
- Compatible with QR204 thermal printers
- Easy to expand for larger applications
- Fast printing
- Low hardware complexity
- Perfect starting point for embedded printing projects
Before connecting any wires, it's useful to understand how the printer works.
Unlike USB desktop printers, the QR204 communicates using UART (Universal Asynchronous Receiver Transmitter).
UART is one of the simplest communication protocols used in embedded systems.
Instead of sending complex packets or network messages, the ESP32 simply transmits a stream of bytes through its TX pin.
The printer receives these bytes through its RX pin and interprets them as printable characters or printer commands.
For example, sending:
Hello Worldover UART causes the printer to print exactly those characters onto thermal paper.
This simplicity is one of the reasons thermal printers are so widely used with Arduino and ESP32 projects.
How UART Communication WorksUART communication requires only two signal lines:
- TX (Transmit) – Sends data from the ESP32 to the printer.
- RX (Receive) – Receives data from the printer (optional for this project).
The ESP32 transmits each character one byte at a time.
For example, when we execute:
PrinterSerial.println("Hello World!");the ESP32 converts each character into its ASCII representation and sends it through the TX pin.
The QR204 printer receives this stream of bytes and prints the corresponding characters on paper.
This process happens almost instantly, making UART one of the fastest and easiest communication methods for thermal printing.
Step 1: Understanding the HardwareNow that we've covered the project overview, let's assemble the hardware.
One of the best things about this project is that it requires only two main devices:
- ESP32-S3-BOX-3
- QR204 Thermal Printer
Unlike many printer projects that require shields or complicated driver boards, the QR204 communicates directly using UART, making it extremely beginner-friendly.
Before making any connections, let's briefly understand the purpose of each component.
ESP32-S3-BOX-3The ESP32-S3-BOX-3 serves as the brain of the project.
It is responsible for:
- Running the Arduino program.
- Detecting touch events on the display.
- Sending UART data to the printer.
- Displaying the printer status.
- Managing the user interface.
Since the board already includes a high-quality touchscreen display, we don't need external push buttons or LCD modules.
This allows us to create a clean Human Machine Interface (HMI) using only the built-in display.
Image Placeholder:ESP32-S3-BOX-3 Development Board
QR204 Thermal PrinterThe QR204 is a compact thermal printer capable of printing plain text, receipts, QR codes, barcodes, and graphics.
Instead of using ink cartridges, it prints by heating specially coated thermal paper.
Some advantages include:
- No ink required
- High-speed printing
- Low maintenance
- Quiet operation
- Compact size
- UART interface
- ESC/POS command support
Since the printer communicates using UART, interfacing it with an ESP32 is remarkably simple.
Understanding UART CommunicationOne of the most important concepts in this project is UART communication.
UART stands for Universal Asynchronous Receiver Transmitter.
It is a serial communication protocol that allows two electronic devices to exchange data one byte at a time.
Unlike SPI or I²C, UART requires only two communication lines:
- TX (Transmit)
- RX (Receive)
Think of UART as a one-way conversation.
The ESP32 "speaks" by transmitting data through its TX pin.
The printer "listens" by receiving data through its RX pin.
Whenever the ESP32 sends a character, the printer immediately prints it.
For example:
PrinterSerial.println("Hello World!");Each character is transmitted individually:
H
e
l
l
o
W
o
r
l
d
!The printer receives these characters and prints them exactly as they arrive.
This simplicity makes UART one of the easiest communication methods for beginners.
Understanding the WiringThe QR204 printer requires only a few connections.
QR204 Printer
ESP32-S3-BOX-3
RX
GPIO43 (TX)
TX
GPIO44 (RX) (Optional)
GND
GND
VCC
External 5V Supply
Image Placeholder:Complete Wiring Diagram
Notice something interesting.
The printer's RX pin connects to the ESP32's TX pin.
This often confuses beginners.
The reason is simple.
The ESP32 is transmitting data.
The printer is receiving data.
Therefore:
ESP32 TX
│
▼
Printer RXSimilarly,
ESP32 RX
▲
│
Printer TXAlthough the printer's TX pin isn't required for this simple project, connecting it allows future two-way communication if needed.
Powering the Thermal PrinterOne of the most common mistakes beginners make is trying to power the thermal printer directly from the ESP32.
Thermal printers draw a relatively high current, especially while heating the print head.
Because of this, it is strongly recommended to power the QR204 using a stable external 5V power supply capable of supplying sufficient current.
The ESP32-S3-BOX-3 should continue to be powered through its USB Type-C connection.
Keeping the printer and ESP32 power supplies stable helps prevent unexpected resets during printing.
Tip: If your printer behaves erratically or the ESP32 restarts while printing, inadequate power is often the first thing to check.
Step 2: Preparing the Arduino IDEWith the hardware assembled, the next step is preparing the Arduino development environment.
If you've already worked with ESP32 boards before, most of these steps will feel familiar.
If this is your first ESP32 project, don't worry—we'll go through everything step by step.
Install the ESP32 Board PackageOpen the Arduino IDE.
Navigate to:
File → Preferences
Locate the field labelled:
Additional Boards Manager URLs
If it's empty, paste the following URL:
https://espressif.github.io/arduino-esp32/package_esp32_index.jsonClick OK.
Next, open:
Tools → Board → Boards Manager
Search for:
ESP32Install the latest board package published by Espressif Systems.
Image Placeholder:Installing ESP32 Board Package
Select the Correct BoardConnect the ESP32-S3-BOX-3 to your computer using a USB Type-C cable.
Now navigate to:
Tools → Board
Select:
ESP32S3 Dev Moduleor
ESP32-S3-BOX-3depending on the board definitions available in your installed package.
Next, select the correct COM port from:
Tools → Port
Installing the Required LibrariesThis project uses only a few libraries.
Open:
Sketch → Include Library → Manage Libraries
Install:
- LovyanGFX
- LGFX_AUTODETECT
The following libraries are already included with the ESP32 board package:
- HardwareSerial
- Wire
- SPI
So no additional installation is required for those.
Step 3: Uploading the ProgramOpen the Arduino sketch provided with this tutorial.
Before uploading the code, verify the UART pin definitions:
#define TXD2 43
#define RXD2 44These correspond to the UART pins used to communicate with the QR204 printer.
If your hardware uses different pins, simply update these values.
Now click the Verify button.
If no compilation errors appear, click Upload.
The upload process typically takes less than a minute.
Once complete, the ESP32 will automatically restart and display the main screen with the Print button.
In the next section, we'll walk through the program itself, explain how the code communicates with the printer, and perform our very first thermal print.
Step 4: Understanding the Arduino ProgramNow that the hardware is connected and the program has been uploaded successfully, let's take a closer look at how the software works.
Don't worry if you're new to Arduino programming. You don't need to understand every line of code to build this project. However, having a basic understanding of the program structure will make it much easier to modify the project in the future.
The sketch can be divided into five major sections.
- Library Initialization
- Display Initialization
- Printer Initialization
- Touch Detection
- Printing Function
Let's understand each section one by one.
Including the Required LibrariesAt the beginning of the program, several libraries are included.
These libraries provide ready-made functions that allow us to communicate with the display and the thermal printer.
For example:
- HardwareSerial allows the ESP32 to communicate with the QR204 printer using UART.
- LovyanGFX provides graphics support for the built-in display.
- LGFX_AUTODETECT automatically configures the display for the ESP32-S3-BOX-3.
Without these libraries, we would need to write hundreds of lines of low-level code ourselves.
Initializing the Thermal PrinterUnlike USB printers, the QR204 communicates using serial data.
Inside the setup() function, the printer is initialized using:
PrinterSerial.begin(9600, SERIAL_8N1, RXD2, TXD2);Let's understand what each parameter means.
- 9600 – Baud rate (communication speed)
- SERIAL_8N1 – Data format (8 data bits, no parity, 1 stop bit)
- RXD2 – ESP32 receive pin
- TXD2 – ESP32 transmit pin
The baud rate of 9600 is commonly used by many thermal printers. However, some models may use 19200 or 115200 baud. If your printer doesn't respond, verify the correct baud rate from the printer's documentation.
Initializing the DisplayThe next part of the program prepares the ESP32-S3-BOX-3 display.
During startup, the display shows a simple user interface containing a Print button.
This provides visual feedback and makes the project much more user-friendly compared to relying only on the Serial Monitor.
The display is also used to show messages such as:
- Printing...
- Ready
- Print Complete
This immediate feedback helps users understand what the device is doing.
Detecting a Touch EventThe ESP32-S3-BOX-3 includes a built-in capacitive touchscreen.
Instead of connecting an external push button, we simply wait for the user to touch the on-screen Print button.
The Arduino sketch continuously checks for touch events inside the loop() function.
When a touch is detected within the button area, the printing function is called.
The workflow is simple:
Wait for Touch
│
▼
Button Pressed?
│
Yes
│
▼
Start PrintingThis approach makes it easy to expand the interface later by adding more buttons for different print options.
Sending Data to the PrinterThe QR204 thermal printer understands standard text as well as ESC/POS commands.
Before printing any text, the printer is initialized using the ESC/POS reset command.
This ensures that every print starts from a clean state.
The initialization command looks like this:
0x1B 0x40This command resets the printer's settings and prepares it to receive new data.
Once initialized, printing text is as simple as writing to a serial port.
For example:
PrinterSerial.println("Hello World!");The ESP32 sends the ASCII characters one by one over UART, and the printer immediately prints them onto thermal paper.
Additional println() statements are used to print multiple lines.
Finally, a few blank lines are sent to feed the paper slightly, making it easier to tear off the printed receipt.
Step 5: Running the ProjectWith everything connected and the firmware uploaded, it's time to test the project.
Power on the ESP32-S3-BOX-3 and the QR204 thermal printer.
Within a few seconds, the display will show the main interface.
Image Placeholder:Main Screen
Touch the Print button displayed on the screen.
Immediately, the ESP32 sends an initialization command followed by the text data to the thermal printer.
The display changes to indicate that printing is in progress.
After a brief moment, the printer produces the following output:
========================
Hello World!
I am QR204
Thermal Printer
========================Finally, the printer feeds a few blank lines and returns to the idle state, ready for the next print request.
The display also returns to the main menu, allowing you to print again with another touch.
Step 6: TroubleshootingEven a simple project can occasionally run into issues. Here are some common problems and their solutions.
The Printer Doesn't Print AnythingCheck the following:
- Is the printer powered on?
- Is thermal paper installed correctly?
- Is the paper facing the correct direction?
- Is the TX pin connected to the printer's RX pin?
- Is the baud rate correct?
Most printing issues are caused by incorrect wiring or an incorrect baud rate.
Random Characters Are PrintedIf the printer produces unreadable symbols instead of text, the baud rate is incorrect.
Try changing:
9600to
19200or
115200depending on your printer model.
ESP32 Restarts While PrintingThermal printers draw significantly more current while heating the print head.
If the ESP32 resets during printing, the power supply may not be able to provide enough current.
Use a stable external 5V power supply for the printer.
Nothing Happens When the Button Is PressedVerify:
- The touchscreen is functioning correctly.
- The touch coordinates match the button area.
- The firmware uploaded successfully.
- The display initializes without errors.
Thermal paper quality can vary significantly.
Try:
- Using fresh thermal paper.
- Ensuring the printer battery or power supply is stable.
- Cleaning the thermal print head if necessary.
Congratulations!
You've now built your first touchscreen-controlled thermal printing project using the ESP32-S3-BOX-3. Even though the program simply prints "Hello World, " you've learned the essential concepts required for building more advanced embedded printing applications.
Giving Your Project a Professional FinishBuilding a working prototype is often only the first step of any hardware project. Whether you're developing an Arduino project, an ESP32 based IoT device, a robotics system, an embedded application, or even a custom PCB, there eventually comes a point where you want the final build to look clean, organized, and professional
While breadboards and exposed wiring are perfect during development, a custom enclosure protects the electronics from accidental damage, improves cable management, makes transportation easier, and gives the project a polished appearance. For engineering exhibitions, hackathons, client demonstrations, YouTube videos, or commercial prototypes, a professionally manufactured enclosure can make a significant difference in both durability and presentation.
Over the past few months, I've ordered several custom 3D printed parts from JUSTWAY for different electronics projects, and the overall experience has been consistently positive. The printed parts arrived well packed with good dimensional accuracy, clean surface quality, and required very little post-processing before assembly.
One thing I particularly like about JUSTWAY is that it isn't limited to only 3D printing. The platform is designed to support the complete product development cycle—from rapid prototyping to low-volume manufacturing and eventually mass production.
Depending on your application, the platform offers several manufacturing services, including:
- 3D Printing for rapid prototyping, concept models, custom enclosures, and functional mechanical parts.
- CNC Machining for precision components manufactured from aluminum, stainless steel, brass, titanium, copper, and engineering plastic
- Sheet Metal Fabrication for industrial enclosures, mounting brackets, control panels, and structural assemblies.
- Injection Molding for producing large quantities of plastic parts with consistent quality.
- Silicone Vacuum Casting for producing low-volume production-quality parts without investing in expensive tooling.
According to JUSTWAY, these services support customers ranging from individual makers and engineering students to startups and industrial manufacturers working in consumer electronics, robotics, automotive, aerospace, medical, and industrial automation.
Uploading Your CAD DesignThe ordering process is refreshingly simple.
Instead of exchanging multiple emails for quotations, you simply upload your CAD model directly through the online quotation system.
The platform supports several commonly used engineering formats including:
- STL
- STEP / STP
- OBJ
making it compatible with popular CAD software such as Fusion 360, SolidWorks, Autodesk Inventor, Creo, FreeCAD, and Onshape.
Once uploaded, the model is automatically prepared for quotation, allowing you to continue configuring the manufacturing parameters immediately.
For projects containing multiple components, several files can also be uploaded together, making it convenient to manufacture complete assemblies rather than individual parts.
Configuring the Manufacturing ParametersAfter uploading the model, the platform provides a detailed configuration panel where almost every manufacturing parameter can be customized before placing the order.
Depending on the manufacturing process, a wide range of materials is available.
For FDM 3D printing, commonly available materials include
- PLA
- ABS
- PETG
- Nylon
- TPU
- Polycarbonate (PC)
- ASA
- Carbon Fiber Reinforced Materials
- Engineering-grade Thermoplastics
For CNC machining, users can choose from materials such as
- Aluminum 6061
- Stainless Steel 304
- Brass
- Copper
- Titanium
- Engineering Plastics
Each material offers different characteristics depending on whether the priority is strength, heat resistance, flexibility, surface finish, or dimensional accuracy
SLA Resin Printing OptionsFor projects requiring extremely fine details or presentation-quality models, JUSTWAY also offers SLA resin printing with multiple specialized materials.
Available resin options include:
- Standard White Resin
- Standard Black Resin
- Transparent Resin (UTR-8100)
- Translucent Resin
- High-Temperature Resin
- Flexible Resin
- Engineering Resin
- Tough Resin
- ESD-Safe Resin
- Dental and Professional Resins
These materials are designed for different applications ranging from display models and transparent covers to engineering validation, electronic fixtures, medical prototypes, and functional mechanical components.
For example:
- Transparent Resin is excellent for display windows, LED covers, and visual prototypes.
- Engineering Resins provide higher strength and dimensional stability for functional parts.
- Flexible Resins are suitable for rubber-like components.
- High-Temperature Resins perform better in applications exposed to elevated temperatures.
- ESD Resins are useful when manufacturing fixtures for handling sensitive electronic assemblies.
- Having access to different resin formulations makes it much easier to choose the right balance between appearance, strength, and functionality.
The platform also allows users to customize the appearance of printed parts.
Depending on the selected material, various colors and finishes are available, including standard colors, silk finishes, matte textures, translucent options, and specialty finishes.
This is particularly useful when manufacturing demonstration models, educational kits, exhibition prototypes, or consumer-facing products where aesthetics are just as important as functionality.
Instant Online QuotationOne feature I personally appreciate is the instant quotation system.
As different materials, quantities, manufacturing technologies, or finishing options are selected, the estimated manufacturing cost updates automatically.
The quotation page also provides useful information such as:
- Manufacturing Cost
- Shipping Cost
- Estimated Delivery Time
- Shipping Method
- Total Price
- Part Weight
Being able to compare multiple material options within a few minutes makes it much easier to optimize both performance and budget before placing an order.
Engineering Support Throughout the ProcessBeyond manufacturing, JUSTWAY also offers several features that simplify product development.
Their platform provides instant online quotations, design review before production, order management, production tracking, and shipping updates, making it easy to monitor the entire manufacturing process from a single dashboard.
For larger production runs, additional services such as dedicated engineering support, DFM (Design for Manufacturability) review, First Article Inspection (FAI), and quality inspection reports are also available to help ensure consistent production quality.
Final ThoughtsWhether you're building a one-off hobby project, a university engineering project, an open-source hardware design, or preparing a commercial product, custom manufactured parts can significantly improve both reliability and presentation.
Having used JUSTWAY for several of my own projects, I found the platform straightforward to use—from uploading CAD files and selecting materials to receiving an instant quotation and tracking production. Its combination of rapid prototyping, precision manufacturing, and scalable production services makes it a practical solution for makers, students, startups, and professional hardware developers looking to turn their ideas into finished products.
ConclusionCongratulations! 🎉
In this tutorial, we've learned how to interface a QR204 Thermal Printer with the ESP32-S3-BOX-3 using simple UART communication.
Starting from understanding how thermal printers work, we covered hardware connections, Arduino IDE setup, code execution, and finally printed our very first message with the touch of a button.
Although the example prints a simple "Hello World" message, the techniques you've learned form the foundation for many real-world embedded applications. Thermal printers are widely used in commercial systems, and understanding how to communicate with them opens the door to building more advanced projects such as billing systems, ticket printers, access control devices, inventory management tools, portable IoT terminals, and smart reporting systems.
One of the goals of this project was to show that getting started with thermal printing doesn't have to be complicated. With just an ESP32-S3-BOX-3, a QR204 thermal printer, and a few lines of Arduino code, you can build an interactive printing system that's both educational and highly expandable.
I encourage you to experiment further by changing the printed text, adding logos, printing QR codes, integrating sensors, or connecting the printer to cloud-based IoT applications. Every enhancement will help you better understand embedded systems while giving you practical experience with real-world hardware.
If you build this project or create your own variation, I'd love to see what you make. Feel free to share your ideas, improvements, or questions in the comments.
Happy making, and see you in the next project!
If You Enjoyed This ProjectIf this tutorial helped you learn something new, please consider:
- ❤️ Liking the project
- ⭐ Saving it to your favorites
- 💬 Leaving a comment
- 🔄 Sharing it with fellow makers
Your support motivates me to continue creating more beginner-friendly embedded systems and IoT tutorials for the maker community.
Happy Building! 🚀





Comments