How to Interface Thermal POS printer (Black copper) with arduino

Hi, I am trying to interface Thermal POS Printer Black Copper with arduino. this printer support usb & Serial interface.
Serial port : Serial 19200,n,8,1
I have already tried ttl-rs232 module in between but unable to communicate. Please guide me or share link of any tutorial regarding this. Thanks in advannce.
Printer

janmahi:
Hi, I am trying to interface Thermal POS Printer Black Copper with arduino. this printer support usb & Serial interface.
Serial port : Serial 19200,n,8,1
I have already tried ttl-rs232 module in between but unable to communicate. Please guide me or share link of any tutorial regarding this.

What code have you tried? Post it. What did it do? How is that different from what you want it to do?

Consider this tutorial...

Perehama:
Consider this tutorial...
Arduino Code | Mini Thermal Receipt Printer | Adafruit Learning System

In this tutorial there is Mini Thermal Receipt Printer that have TX Rx pins for communication. but i have printer that normally used and have usb, ethernet and DB9 port

janmahi:
In this tutorial there is Mini Thermal Receipt Printer that have TX Rx pins for communication. but i have printer that normally used and have usb, ethernet and DB9 port

Surely your problem is not TTL to DB9 interface? I mean, you linked a module that solves that for you. Your problem isn’t exactly clear to anyone on this forum as you have yet to post any code. Take your module, connect it to the printer’s DB9 and now you have a printer that will probably work with the tutorial… The only thing to consider with a DB9-TTL adapter is are you adapting a DCE or a DTE. A printer is a DCE and your Arduino is the DTE… so critically consider how the pins might need to be swapped.

Perehama:
Surely your problem is not TTL to DB9 interface? I mean, you linked a module that solves that for you. Your problem isn't exactly clear to anyone on this forum as you have yet to post any code. Take your module, connect it to the printer's DB9 and now you have a printer that will probably work with the tutorial... The only thing to consider with a DB9-TTL adapter is are you adapting a DCE or a DTE. A printer is a DCE and your Arduino is the DTE.... so critically consider how the pins might need to be swapped.

Tried this example code present in library but of no use.
ttl-rs232 have 4 pins on arduino side as
Vcc,Rx,Tx,Gnd that i connected to arduino. On the other side there is female Db9 port. printer have also db9 so in between them i use male to male db9 connector. so how should i swap DTE and DCE.

#include "Adafruit_Thermal.h"
#include "SoftwareSerial.h"
#define TX_PIN 6 // Arduino transmit YELLOW WIRE labeled RX on printer
#define RX_PIN 5 // Arduino receive GREEN WIRE labeled TX on printer

SoftwareSerial mySerial(RX_PIN, TX_PIN); // Declare SoftwareSerial obj first
Adafruit_Thermal printer(&mySerial); // Pass addr to printer constructor
void setup() {
pinMode(7, OUTPUT); digitalWrite(7, LOW);
mySerial.begin(19200);
printer.begin();
printer.inverseOn();
printer.println(F("Inverse ON"));
printer.inverseOff();
printer.doubleHeightOn();
printer.println(F("Double Height ON"));
printer.doubleHeightOff();
printer.justify('R');
printer.println(F("Right justified"));
printer.feed(2);
printer.sleep(); // Tell printer to sleep
delay(3000); // Sleep for 3 seconds
printer.wake(); // MUST wake() before printing again, even if reset
printer.setDefault(); // Restore printer to defaults
}

void loop() {
}

janmahi:
Tried this example code present in library but of no use.

I know you are new, but try to put a little more effort into this if you would like some help. Let's start with what you want it to do, what it did, what you understand about the code you posted, what you understand from the tutorial, what your experience is in general, and what you want help with.

Perehama:
I know you are new, but try to put a little more effort into this if you would like some help. Let's start with what you want it to do, what it did, what you understand about the code you posted, what you understand from the tutorial, what your experience is in general, and what you want help with.

thank you very much for our reply.

Sir I want to take print from arduino using thermal receipt printer. I have arduino mega, ttl-rs232, db9 male to male connector and BC95AC Thermal Receipt Printer.
i have tried the above code on mini thermal printer that worked well But now i want to replace the printer with this one BC95AC Thermal Receipt Printer.

janmahi:
thank you very much for our reply.

Sir I want to take print from arduino using thermal receipt printer. I have arduino mega, ttl-rs232, db9 male to male connector and BC95AC Thermal Receipt Printer.
i have tried the above code on mini thermal printer that worked well But now i want to replace the printer with this one BC95AC Thermal Receipt Printer.

Do you have documentation on the BC95AC and what protocol it uses for communication?

You are using a mega - there are four hardware serial ports, do not use software serial.

You need to check the rs232 connection to see if you have rx and tx wired correctly, if they are swapped it will never work.

david_2018:
You are using a mega - there are four hardware serial ports, do not use software serial.

You need to check the rs232 connection to see if you have rx and tx wired correctly, if they are swapped it will never work.

I have connected ttl-rs232 to pc through db9 port where I receive everything what arduino sent.