I2C for Thermal Printer

Hello experts,
i am an hobbiest and working on a project....
i am using 1 ESP32, 2 RS485 (hardware) for 2 Nanos, 1 3.5" TFT, 1 PCF8574, 1 RTC etc.

need to connect Thermal printer
not having a single pin in hand now
used both RX/TX for 2 RS485
used SDA/SCL (21,23) for 1 PCF8574 and 1 RTC already

can i use the same SDA/SCL for thermal printer ? HOW ?
please help....
TIA

I2C uses the bus concept. You can hang many devices off that bus, the only thing is they have to have unique addresses.

A hardware matter must be considered, that is who and how the required I2C bus pull up resistors are installed.

There is a need to have enough but not too much pullup.

google

i2c pull-up resistors

and examine your devices to see what's already.

a7

I2C is a bus, and can be used with several devices connected in parallel.

Each device has to have a unique I2C address.

Could you maybe find an I2C UART device?

NXP used to do one, I think.

1 Like

Please show what You have achieved regarding code, wiring (schematics).
Help doesn't make forum create all of that, only help tuning it.

agreed, thats why i am thinking to use thermal printer with it
i used thermal printer with uart
i am just asking, whether it can be done with i2c or not

dear expert, i am asking whether thermal printer can be used with SDA/SCL or not
if yes, any hint regarding the same.
because i have never heard the same
not asking any coding, schematic etc.

To determine whether the printer supports I2C, check the printer data sheet or user manual.

1 Like

Okey.

Unlikley. I2C is really designed for comms between chips in close proximity.

I've not come across a thermal printer with an I2C interface. Most thermal printers have some history with Point Of Sale (POS) systems where the usual communication route would be either parallel, serial or USB.

Yes. Now I understand the OP's problem.

If she literally has no pins left at all, there's not much hope for serial, or I'd suggest trying a software serial solution. You can get them that only send so need only one pin.

I did see that ppl have interfaced to parallel ports on printers using an I2C port expander.

a7

There a lot of Bluetooth Low Energy (BLE) thermal printers. A few work with various Arduino boards with BLE. Thermal Printer Library - Arduino Reference

Are you using 2 serial ports on your ESP32, each with an RS485 module connected so that each Nano has a separate RS485 link with the ESP32?

You can connect to both Nanos using only 1 RS485 module and 1 serial port on the ESP32.

Maybe use a softserial library ?

2 rx/tx for 2 Nanos, no issue, its working OK
many more items connected, trying to use PCF8575
thinking to use 1/2 pins of PCF8575 for Thermal printer
thats why, i am asking....

whether it is possible to use softwareserial through PCF8575 pins ?

No, use the software serial on the device that prints to the thermal printer which I am assuming has a uart interface.

You could bit bang a software serial port through the PCF8575 pins but you would have to write your own code to do it. The standard softwareserial library is designed to work with pins on the micro rather than an i/o expander.

Your baud rate would be limited if you tried to bit bang over I2C - as a wild guess, maybe 4800 or 9600 baud, possibly even lower.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.