I've been browsing through the web and noticed that there isn't much support for thermal printer especially for Epson branded or the ESC POS printer types using Arduino boards. Therefore, I will provide some useful insights on how to get a thermal receipt printer working using ESC POS codes with the Arduino...
Here's what you need:
-RS232 level converter (Maxim 232 chip or equivalent and assembled with preferrably an RS232 male connector)
-Epson printer or ESC POS compatible printer (Citizen, etc.)
- cable to connect your printer to the RS232 converter.
To make an RS232 converter all you need is:
- a Maxim232 or alternative equivalent,
- 4 .1uF Capacitors
- a breadboard or pcb board to solder with wire connectors.
Go find datasheets for the converter chip of you choice and follow the pin numbers for connecting the capacitors and for voltage input and ground and viola, you got one.
Write some program. Fortunately I have developed a sample program for you.(below) :)
void setup ()
Serial.begin(19200) //Epson default printer settings for baud rate for parallel type printer
void loop() //looping sequence
Serial.print(0x1B,BYTE); //ESC POS command
Serial.print('@'); //ESC POS initialize followed after command
Serial.print("Hola Epson"); //Print "Hola Epson" to buffer
Serial.print(0xA,BYTE); //Print and Line Feed from Buffer
//*** Upload you program
Put it all together.
Make or purchase an RS232 level converter. Connect the Arduino 5V and Ground to the RS232 level converter so that it can communicate with the printer. Then pray it all works.
Final Result (Pics)
The Printer here is a parallel printer and I am using a parallel to serial cable to communicate with Arduino directly.