BTHT V6 TTL RS232 thermal printer module

Sabtu, 25 Januari 2014

Review: BTHT-V6 TTL/RS232 thermal printer module

In this review, I have two thermal printer modules, as shown below:

(they both look the same, so I only showed one in the picture)



Lets call them V6 and V6-simple.  The manufacturer offered different variations inside the same chase(which caused me quite a bit of confusion). The only way to tell their difference is to open the casing and look at the electronics inside.




This one, I call it the normal V6, has a MAX3232 inside to support RS232 connection.

It has both TTL and RS232


The V6-Simple, does not have MAX3232, and the PCB layout is somewhat different.

It has only TTL connection.

Looking carefully, the TTL pin layout is different. This has caused me huge trouble when I was trying out the unit.

It turns out also supports only ANSI character printing.



Common specs:

  • 2.25"(58mm) paper width (48mm printing width)
  • Max paper roll diameter of 1.5" (39mm)
  • Default 19200bps baud rate
  • 9v~24v 15w power input

Difference between the two:


V6 V6-Simple
ANSI Chars Support Support
ESC/POS Support -
Bitmap Support -
Printer Status Support -
TTL Support Support
RS232 Support -

V6-simple can print only ANSI English characters, thats it. Nothing else.



Tests:

I used PL2303 usb-2-TTL cable and MicroRidge ComTest.  If you dont have it, go grab a copy, the software is free.  PL2303 is really cheap on ebay($1.5 shipped).



Powered by my 12v 5A power supply.  It is really handy to have a few of these around.  If you dont have one, no worry.  Chances are your router/monitor/other small appliace already have a 12v power supply, just use it.

If using linux, can do something like this to test printer:
cat file.txt > /dev/ttyS0
# file.txt must end with a Carriage Return{CR} to output immediately.


Test with V6-Simple:
There really isnt much to say. Send ASCII characters down the COM port, it prints out.  The printer will auto wrap text at 32 characters.


Test with V6 (feature rich version):
This one supports ESC/POS command, however the definition is slightly different from the EPSON TM88. For example, the "batch specify print mode" [ESC !] is not available on V6.

*Note: Another little thermal printer sold at sparkfun also has a different command set, but that one is different from standard EPSON too.


Here is a list of supported ESC/POS commands:
- ESC/POS command
(HEX value)
n value
Print and Feed n dots paper ESC
0x1b
J
x4a
n 1<=n<=255
Set line space ESC
0x1b
1
31
n 0<=n<=255
Default: 0
Set character space ESC
x1b
p
x70
n 0<=n<=255
Default: 0
Set right Margin ESC
x1b
Q
x51
n n: number of characters
Default: 0
Set left Margin ESC
x1b
1
x6c
n n: number of characters
Default: 0
Grey scale ESC
x1b
m
x6d
n 0<=n<=10
Default: 5
Set font Width ESC
x1b
7
x37
n 0,1,2,3,4
Default: 0
Set font Height ESC
x1b
8
x38
n 0,1,2,3,4
Default: 0
Underline ESC
x1b
-
x2d
n 0,1
Default: 0
Overline ESC
x1b
+
x2b
n 0,1
Default: 0
Inverse color ESC
x1b
I
x69
n 0,1
Default: 0
Reverse Direction ESC
x1b
c
x63
n 0,1
Default: 1
Initialize printer ESC
x1b
@
x40
Activate/Deactivate printer ESC
x1b
d
x64
n 0,1
Default: 1
Report printer status ESC
x1b
v
x76
n n=0 check paper
  return value:
  0x00 good
  0x04 no paper

n=128 check printer
  return value:
  bit0: printing
  bit1: no paper
  bit4: overhead
  bit6: feeding paper
Print and carriage return CR
x0d
Line feed LF
x0a
All the commands above are supported as advertised.

Here are some examples:
x1bx38x02 double font height
x1bx38x00
x1bx37x02 double font width
x1bx37x00
x1bx2bx01 enable upperline
x1bx2bx00
x1bx2dx01 enable underline


Bitmap Printing:  ESC K ml mh n1 n2...ni...

The bitmap printing function is a bit tricky to use. As the printer does not come with any library, I need to code the drawing part.
  1. The bitmap prints as 1x8 pixel block concatenated as a 8px hight row.
  2. one row per command.
  3. ml & mh specifies how many data [i] is attached for the current row.  On x86 processors I need to take a hex value and reverse its higher/lower byte.
  4. The bitmap can not be printed along, must accompany some text before or after it. (CR or space is okay too) Other wise there is no output.

The following example prints a 12 x 8 pixel image:


Test print 
x1bx4bx30x00xffxffx00x00xffxffxffx00x00xffxffxffxffx00xffxffx00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00xffxffxffxffxffxffxffxffxffxffxffxffxffxffxffxff

# To make the image taller, just repeat the command N times. Do not add {CR} or {LF} in between.
Here is the printout:



Final thoughts:

The V6 printer is easy to work with, RS232 + TTL connection is a big plus if I need to attach it to different devices.

It also comes with two cables. The printing quality is good compare to other lower priced printer on ebay (e.g. T5890). 

Only problem is that it could be a challenge to implement QR-code and other barcode.  I wish the manufacturer would supply a bitmap printing library so this becomes much easier.

Related Posts by Categories

0 komentar:

Posting Komentar