This project features an ESP32 controlled thermal printer solution to print payment receipts as payments are made to the LNbits TPoS extension.
Buy a complete kit on the LNbits shop: https://shop.lnbits.com/product/lnbits-tpos-thermal-receipt-printer
The project is fully inspired by the Coinos printer project.
- An ESP32. This project used an ESP32-C3 SuperMini but any ESP32 will do as long as you can smush it into an enclosure
- A 58mm Embedded Thermal Printer with TTL interface
You will need:
- Visual Studio Code with the platformio extension installed
- Your ESP32-C3 board
- A USB-C cable.
- Open VS Code and open the
firmware
directory that is in this repo. Platformio will initialise the project and load all required dependencies. - Copy the file config.h.example to config.h and edit the variables in the file to your own values:
- Connect your ESP32 board to your computer using the USB-C cable
- Click the Upload button (the right facing arrow in the footer of the VS code IDE)
- After flashing, your printer will connect to WiFi and print a short status message.
Connect the printer to the ESP32 as follows.
You will probably need a seperate power supply for the printer as it needs ~ 1amp which an ESP32 struggles to provide.
- Printer GND to ESP32 GND and power supply GND
- Printer VCC to power supply 5v - 9v
- Printer RX to ESP32 GPIO 21
- Printer TX to ESP32 GPIO 2
You may be able to use the ESP32 5v pin to power the printer and I have had some success with this. However print quality is slightly degraded and speed is low. If you are going to do this, use a 5V power supply with at least 2 amps available. Wiring as follows:
- Printer GND to ESP32 GND
- Printer VCC to ESP32 5v
- Printer RX to ESP32 GPIO 21
- Printer TX to ESP32 GPIO 2
- Copy config.h.example to config.h
- Edit config.h to match your setup
- Compile and upload to ESP32
- Power on