16

I've purchased a Mini Thermal Printer from Adafruit. The documentation states:

This printer is ideal for interfacing with a microcontroller, you simply need a 3.3V to 5V TTL serial output from your microcontroller

Since the serial pins on the GPIO output at 3.3V I assumed that I could just connect the printer directly to the pins and it would just work without a protection circuit. Is that a naive assumption? What else do I need to do in order to use the printer?

Ghanima
  • 15,855
  • 15
  • 61
  • 119
Jivings
  • 22,538
  • 11
  • 90
  • 139
  • 1
    Probably very little aside from software. If the printer produces any reply data, you might need a voltage limiter on that though. You might want to ask on the adafruit forums, since they sell both the printer and pi's as well. – Chris Stratton Oct 07 '12 at 15:59
  • As far as I can tell there is no reply data. – Jivings Oct 07 '12 at 17:33
  • This is taking me back a bit, so I might be wrong. The printer uses 5V TTL logic. I think the RPi uses 3V3 CMOS logic. I think TTL logic can pull a current larger than CMOS can handle, which may damage the RPi. – Alex Chamberlain Oct 07 '12 at 18:51
  • 1
    @AlexChamberlain in a word, no. That is not something people worry about in logic translation at all. A higher voltage driver damaging a lower voltage receiver, or a lower voltage driver failing to be reliably registered by a higher voltage receiver yes, but not excessive current draw when driving a a simple logic input from another family. – Chris Stratton Oct 07 '12 at 23:49
  • 2
    Have you seen this? https://www.sparkfun.com/products/8745 – Alex L Oct 08 '12 at 06:23
  • @Jivings FYI, according to this manual the RS232 TTL interface has 6 lines (1 - GND, 2 - NULL, 3 - VH - input voltage 5v to 9v, 4 - GND, 5 - RXD, 6 - TXD). Apparently there is transmit data from the printer. Not sure from this manual (parts are in Chinese) if line 3 is input voltage to the printer. Adafruit shows three lines from printer to Arduino board. Ground and pin 5 and 6 on Arduino. 5 and 6 could be TXD and RXD. – HeatfanJohn Oct 09 '12 at 01:52
  • @Jivings Hi Jivings, How RaspBerry PI detect this printer, when i connect it to RasberryPI and use CUPS to install, CUPS does not see it :| – Rong Nguyen Jun 13 '14 at 02:57
  • @RongNguyen It's not a regular printer, you will not be able to use CUPS. – Jivings Jun 13 '14 at 16:02
  • @Jivings Is there any ways to use it as printer, for example i can use it to print text, web,.. file as a regular printer, thank for your reply :-) – Rong Nguyen Jun 14 '14 at 01:49
  • 1
    @RongNguyen You can get it to print anything you like, you'll just have to do the hard work yourself. There's a tutorial here. – Jivings Jun 17 '14 at 16:31

3 Answers3

5

The voltage levels are not a problem, a LVTTL logical '1' will also be a TTL logical '1'. The only issue can be the (sinking) current, as Alex Chamberlain already suggested. This can be a problem.

This sinking current depends on the input circuit of the printer, as we can only guess how it is constructed, it might be better to be safe then sorry!

So to be safe put a CMOS buffer in between. A 74LCX244 for example. If something would start to smoke then, it will not be your Raspberry Pi.

Edit: I noticed criticism about the current statements, to back this statement up:

Quote from klabs.org:

  • CMOS output stages can also be tricky and subtle device characteristics can cause errors. Check all specifications carefully! For example, many CMOS devices when driving loads are specified at only very low current levels for high or logic '1' signals. However, TTL inputs take substantial currents and do not present the high impedance seen by CMOS FET inputs and the output may be dragged down.

More information about this current issue here: 5 V TTL and CMOS Input and Output Voltage Levels:

  • CMOS -> TTL: you may need a buffer to handle extra sinking current when CMOS output goes low

Hope this helps.

ikku
  • 4,494
  • 1
  • 25
  • 28
1

This may be what you need:

4-channel I2C-safe Bi-directional Logic Level Converter - BSS138

or

8-channel Bi-directional Logic Level Converter - TXB0108 (non I2C)

Dennis Williamson
  • 1,689
  • 3
  • 13
  • 11
1

I believe "TTL serial" means async serial you'd find in a common UART. A natural way to attach this printer to a PI would be to find a UART on the board (GPIO 14/15?) or attach one to another bus. There are a few good (FTDI, CP2102) and worse (Prolific) chips available for USB and loads for I2C and SPI. If the device demands handshaking, you'll have to worry about that as well. The Adafruit page doesn't seem to use any (Tx/Rx only if I read it right).

If you do want to do this over actual GPIO (logically fine, but see others for warnings about electical compatibilty), you could search for "software uart".

XTL
  • 1,389
  • 9
  • 22