DEV Community

David Thomas
David Thomas

Posted on • Originally published at circuitdigest.com

ESP32 Thermal Printer Tutorial – Print Receipt, Barcode, and QR code

Thermal printer technology has revolutionised receipt printing in retail, healthcare, and IoT projects. This comprehensive tutorial shows you how to interface popular thermal printers like the PNP-500 with ESP32 and Arduino, enabling receipt, barcode, and QR code printing.


Project Overview

  • Build Time: 3-5 hours
  • Cost: $30-50
  • Difficulty: Beginner–Intermediate
  • What You'll Learn: UART communication, ESC/POS commands, bitmap image printing, QR & barcode generation
  • Applications: IoT monitoring, smart home automation, receipt systems, barcode labelling

Understanding Thermal Printer Technology

What is Thermal Printer: Basics

Thermal printers use heat-sensitive paper instead of ink. A heated print head creates text or images by darkening specific dots on the paper.

Key Benefits:

  • Paper sizes: 57mm, 76mm, 80mm, and 110mm widths
  • Key advantages: No ink required, silent operation, fast printing

PNP-500 Thermal Printer for ESP32 and Arduino

The PNP-500 is a compact panel-mount thermal printer, commonly used in diagnostic equipment and embedded systems.

Technical Specifications of thermal printer:

  • Print Width: 48mm
  • Speed: 50–80 mm/sec
  • Resolution: 384 dots/line (8 dots/mm)
  • Interfaces: TTL UART, RS232, USB
  • Voltage: 5–9V DC (works best at >6V)
  • Print Head Life: 50 km of printing

controller PCB


What are the advantages of using an ESP32 with a thermal printer?

Pairing a thermal printer with ESP32 offers several benefits:

  • Cost-effective: No ink or toner needed, just thermal paper
  • Compact design: Small printer + ESP32 fits into handheld or IoT devices
  • Wireless connectivity: ESP32 adds Wi-Fi/Bluetooth for mobile app or cloud service integration
  • Performance: Fast and quiet operation, perfect for on-demand receipts, labels, or alerts
  • Versatile printing: Supports text, barcodes, QR codes, and bitmaps with simple commands

What can you build with ESP32 and Thermal Printer?

  • IoT monitoring devices (print real-time data logs)
  • Smart home status printers (daily to-do lists, reminders)
  • Portable receipt printers
  • Barcode/QR code label makers

Hardware Requirements

  • ESP32 Development Board
  • Thermal Printer (PNP-500 / RS203)
  • Resistors (1kΩ × 2)
  • Breadboard + Wires
  • 2S Li-ion Battery (for printer)
  • Push Buttons × 2 (optional)

Circuit Connection Guide

ESP32 Thermal Printer Circuit Diagram

ESP32-Thermal-Printer-Circuit-Diagram

How to Connect the Thermal Printer to ESP32

  • Use UART (TTL pins) on the printer
  • ESP32 pin connections (example):
    • RXD2 → Printer TX
    • TXD2 → Printer RX
    • GND and Vcc as required

Important Notes:

Use pull-up resistors on RX/TX to reduce interference

Printer needs separate power (Li-ion battery recommended)


Programming Your ESP32 Thermal Printer

Thermal printers understand ESC/POS commands over serial (UART). You can print bitmaps, barcodes, and QR codes using simple commands.

Source Code

Full source code is available on GitHub:

ESP32 Thermal Printer GitHub Repo

Top comments (0)