How to interface a thermal printer to an Arduino

I've a thermal printer which has TTL, RS232 & a four pin interface. I want to connect it to an Arduino and take printouts with it. It has the following pinouts:

RS232 & TTL

• GND
• TXD
• RXD
• DSR
• DTR

Another Four Pins Interface

• LED
• FEED
• ONLINE
• GND

I've tried printing using the serial communication by sending serial print commands from the TX of the Arduino to the RXD of the printer but for some reason it did not work.

How can I connect it to an Arduino and write a program for it?

• You find the datasheet Nov 16 '20 at 13:26
• I have what seems to be a data sheet..what exactly should I look for in it? It only mentions about some ESC codes. Not much about pin descriptions. Nov 16 '20 at 13:27
• One issue you could have is your voltage to your printer is too low. I've had issues trying to print at lower voltages like 5v. If you have the one I'm thinking of, I would recommend printing at 9v. Nov 16 '20 at 13:52
• "It is both TTL and RS23[2]" How? Provide documents. Also sketch out, and share, your wiring connections once you provide the documents. Nov 16 '20 at 16:03
• Maybe: tronixstuff.blogspot.com/2011/07/… (be weary of dead links) and sites.google.com/site/tronixstuff/home/… will get you going. See example38p1.ino Nov 16 '20 at 21:24

You might want to take a look at this library. The command set seems similar (for example Init is ESC + @). If anything, you can try to copy fragments of code for a simple printout.
3. Make sure the baudrate of the Arduino is compatible with the printer (e.g. Serial1.begin(19200);