Thermal Printer Serial Protocol

Posted : adminOn 9/3/2018
Thermal Printer Serial Protocol Average ratng: 4,3/5 8019votes
Thermal Printer Serial Protocol

Use inexpensive thermal printers with Arduino in chapter thirty-eight of a series originally titled “” by – a series of articles on the Arduino universe. The first chapter is, the complete series is detailed. Updated In this article we introduce the inexpensive thermal printer that has recently become widely available from and their resellers.

Number of the serial printer line. The PROTOCOL command allows you to manipulate the software flow control by setting both the inward and the outward X-ON/X-OFF protocols.

The goal of the article is to be as simple as possible so you can get started without any problems or confusion. In the past getting data from our Arduino to a paper form would either have meant logging it to an SD card then using a PC to finish the job, or perhaps viewing said data on an LCD then writing it down. Not any more – with the use of this cheap and simple serial printer.

Before we get started, here is a short demonstration video of it in action: Not bad at all considering the price. Let’s have a look in more detail. Here is the printer and two matching rolls of thermal paper: and the inside of the unit: Loading paper is quite simple, just drop the roll in with the end of the paper facing away from you, pull it out further than the top of the front lip, then close the lid. Program Hp Scanjet G4010 Driver And Software Epson M188d Printer Driver Windows 8. on this page. The paper rolls required need to be 57mm wide and have a diameter of no more than 39mm.. There is a piece of white cardboard stuck to the front – this is an economical cover that hides some of the internals. Nothing of interest for us in there.

The button next to the LED on the left is for paper advance, and the LED can blink out the printer status. From a hardware perspective wiring is also very simple. Looking at the base of the printer: there are two connections. On the left is DC power, and data on the right. Thankfully the leads are included with the printer and have the plugs already fitted – a great time saver. You may also want to fit your own to stop the printer rocking about. Please note – you need an external power supply with a voltage of between 5 and 9 volts DC that can deliver up to 1.5 amps of current.

When idling the printer draws less than 10 milliamps, but when printing it peaks at around 1.47 A. So don’t try and run it from your Arduino board. However the data lines are easy, as the printer has a serial interface we only need to connect printer RX to Arduino digital 3, and printer TX to Arduino digital 2, and GND to GND! We will use a virtual serial port on pins 2 and 3 as 0 and 1 will be taken for use with the serial monitor window for debugging and possible control purposes. If you want to quickly test your printer – connect it to the power, drop in some paper, hold down the feed button and turn on the power. It will quickly produce a test print.

Next we need to understand how to control the printer in our sketches. Critical Perspective Of The Construct Of Intelligence Pdf Printer there. Consider this very simple sketch. SoftwareSerial Thermal ( 2, 3 ); // printer RX to digital 2, printer TX to digital 3 configures the virtual serial port and creates an instance for us to refer to when writing to the printer. Next, four variables are defined.

These hold parameters used for configuring the printer. As the printer works with these settings there is no need to alter them, however if you are feeling experimental nothing is stopping you. Next we have the function initPrinter(). This sets a lot of parameters for the printer to ready itself for work. We call initPrinter() only once – in void setup(); For now we can be satisfied that it ‘just works’. Now time for action – void loop(). Writing text to the printer is as simple as. } And the results: Frankly bold doesn’t look that bold, so I wouldn’t worry about it too much.