Table of Contents
Introduction
The thermal printer you may have come across this term or you may have seen this printing machine in a handheld card swiping machine, in an ATM, in petrol pumps, etc… Right after the payment, you get a received payment in a small paper. Everywhere when it comes to a small readily available cost-effective printing solution to a big machine or a handheld device. Now a day’s thermal printer is used in almost every corner of applications where printing is becoming an add-on feature to the device or machine.
Thermal Printer uses a special quality of paper known as thermo-chromic paper, this paper is active to a temperature that changes its color when a specific amount of heat or proper temperature is provided to this paper. So when a signal maintains a specific temperature at the head of the printer and paper starts to pass through it, According to the heated head the color of the paper turns into blue/black, and thus we can see printed content on it.
In this tutorial, we have a block diagram, circuit explanation, and code explanation and the end upload the code and test the thermal printer using the Adafruit library.
About Thermal Printer
Interfacing protocol which is Serial (RS232, TTL) and USB: I am using TTL serial mode of communication, reason easy to use.
Power rating 9v DC: this means we need to use any 9v DC power adapter.
Serial Communication: It is done through the pin available as TTL. Here I am not using RS232 just to reduce circuitry, you can use it to communicate with the printer but again you need to use an RS232 to TTL converter for using any microcontroller.
The printer is powered with a 9v, 2amp after converting the voltage using a buck converter from a 12v, 2aps SMPS.
Hardware Requirements
Disclaimer: It may contains Amazon affiliate links. which means I can get a small commission on the sale. This might be your indirect help to me. Thank You 🙏
- Arduino UNO (HERE)
- Thermal Printer (HERE)
- Small Bread Board (HERE)
- Connectors (HERE)
- 12v,2AMP Power adapter (HERE)
Software Requirements
- Arduino IDE (You can download it from HERE)
- Printer Adafruit library
Block Diagram
Circuit Diagram
Circuit Explanation
The circuit is the simplest circuit as it is an interfacing tutorial. So, you need to connect the serial pins only and power them up. You can follow the circuit diagram and connect the Tx in of the thermal printer to the Rx pin of Arduino (which is PIN5 in this case) and connect the Rx pin of the thermal printer to the Tx pin of Arduino (which is PIN6 in this case).
Video Tutorial
Download Source Code
Download the complete source code: click here