One of my latest projects i just finished is a hardware thermal printer driver. This project designed/developed for Delmac Instruments as a part of my internship. Thermal printers are used in cash and weighting machines for receipt printing.

Thermal Printer Connected on the driverThermal Printer attached on the driver

What the specific hardware does is to receive ASCII characters, escape sequences in UART and convert them in a printable form to send to printer mechanism for printing. Escape sequences are used to send commands to the printer to change character size, line spacing etc.

Thermal Printers don't use ink as usuall printers but they have a head of tiny resistors in a row (about 384) which behave on the paper as dots. Also they use a suitable paper which is thermal sensitive. 

By supplying voltage to a single resistor, you heat the resistor and you make the paper burn at the specific point drawing a tiny single dot on the paper. If you supply voltage to a single resistor and you move the paper at the same time by stepping the head motor you will have a tiny width vertical row. This is the basic. (Resistors are refered as elements).

The main behavour of the head is like a shift register. You shift data to be print on the head register and then you supply voltage to the elements, mapping the shifted data, on the paper. For example if you shift a value like 000011100111000111 and you power the elements you will have the '1' bits appeared on the paper with dots.

Here is a diagram showing how the data are shifted.

To print a single character you have to draw it line by line. To do this fast and simple the character pattern has to be saved on a table with all the other characters. Then you select each line of each character you want to print and you shift it on the printer register by the order you want.

For example a simple character pattern of A in 8-bit width and 9-bit height could be:

00000000
00011000
00011000
01100110
01111110
01100110
01100110
00000000
00000000

If we want to print A A then we have to shift the following data line by line.

0000000000000000
0001100000011000
0001100000011000
0110011001100110
0110011001100110
0111111001111110
0110011001100110
0110011001100110
0000000000000000
0000000000000000

The main printing algorith is:

1) Shift one pattern line data to the head register

2) Power the Elements

3) Move motor one step

4) Power the Elements

5) Shift next pattern line data to the head register

Repeat.

 

Note.   Steps 2 and 4 are repeated because each line we see on the paper is two dot lines of the printer head.

Thermal Printer DriverThermal Printer Driver
Thermal Printer Driver

5 thoughts on “Thermal Printer Driver

  1. wow!!! amazing….!!

    may i have all documents of this project in detail  please…

    Thanks anyway

    -Dodi-

    1. Thank you for your interest. I'm sorry but i can't share more information. This project was designed/developed for the private company Delmac Instruments.

      If you are interesting for a comercial use of this project please send me an email with more information.

      1. Hi Haris! I'm interesting this project for a commercial (educational) using. Please send me more information and help. Thanx and sorry for my bad english. Regards: Martin. My email Address is: martinhanek@pobox.sk Thank you.

  2. SOmething that i was looking for quite sometime, i know you can't share further infrormation. I just wanted to know where did you start on with this project brother. Like some sample c code or something that i can refer to. It will be of great use. Great projects you making brother.

Leave a Reply

Your email address will not be published. Required fields are marked *