HP Forums

Full Version: aftermarket IR printer
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone,

With software emulators for various operating systems already available for the HP82240, I'm wondering whether anyone has tried to make a hardware emulator. I just discovered that there's a range of offers of $20 thermal printers from China that have a USB port and claim to use the ESC/POS command set. Given the many ESC/POS printers in use all over the world (and thus also available surplus or used) with various printer technologies (matrix, thermal, etc.), it would make sense to have an adapter that receives HP commands via an IR photodetector, then convert them to ESC/POS and dump them to the printer.

Does something like this exist? I guess it wouldn't take much more than a Raspberry Pi Zero (which already has a USB host interface) plus a photodiode to implement something like this.

If only I had a few evenings of free time to play around... Smile
Martin Hepperle has done this with an Arduino mini and a ('obsolete') HP IR printer interface. Excellent documentation and details of operation. I've built one and it works great:


Brilliant, thank you! Now only the ESC/POS code is missing.
(04-07-2017 05:53 PM)c785 Wrote: [ -> ]Brilliant, thank you! Now only the ESC/POS code is missing.
Depending on how they look internally, it might be worth to check whether these POS system printers can be tapped behind the USB interface - at some point there might be a simple TTL serial data stream. There are also a few older models with serial interface.
While there are some USB host I/F boards available for Arduinos (the Raspberry implements the host I/F), but these are already rather large boxes.

My solution is not an USB-Host - it uses a Serial-USB interface to talk to a host (a PC) though a virtual COM port. Perfect for a PC connection using Christoph Giesselinks printer emulator. If the printer could be tapped, the serial interface stream could be fed easily into it without the need for USB. The ESC/P conversion should be easy, except for special characters and graphics.

My 82240b printer stopped working and I considered making a hardware simulator for it. Today my considerations started to take shape as this contraption.

[Image: ir-overview.jpg]

IR sensor is TSOP38233-ND. It is a 33 Khz sensor. While HP protocol specifies 32768, this turned out to be close enough — oscilloscope shows something that looks like a valid frame(s) when I send printing commands from my infrared modded WP 34s.

The printer is CSN-A2 thermal printer with TTL serial interface. It is not exactly compatible with HP's printing unit but I hope it is close enough to emulate. I've got my from Adafruit. They sell it as a kit with a 5V 2A power supply and a connector. I was having whole lot of weird unpredictable behavior until I realized that printing in graphic mode (bitmaps) and printing block characters drains too much power for this power supply. Oscilloscope showed that voltage drops as low as 2 volts, which sends printer in reset midprint. To be fair, the kit power supply works ok with normal text printing. Anyway, I've searched my bin of power supplies that need home and found a 9V 4A one which works much better. I still have some weird behavior when trying to print bitmaps, but Adafruit sample programs (QR code, logo, etc) print normally, so, I assume, I just need some more figuring out to do.

The controller for now is RPi1B. I installed lirc and only use hardware driver (lirc_rpi) to get pulse/space timings, which I process myself with a perl script. Maybe there is a way to teach lirc to do the parsing, but I have not figured it out right away, so went with a perl script. This is a good thing, since I will not be able to use lirc in the decoding layer of the final product. RPi is ok for prototyping, but it takes 60-90 seconds to boot up and I would prefer faster availability. So, I will not be able to run linux and, by extension, lirc.

The parsing still has some glitches, but it correctly parses 99% of the frames.

(from here)
Reference URL's