Thermal pinters have been around for a while. Everytime you go to the local supermarket or gas station, the printout of the receipt is usually from a thermal printer. It’s a quick, easy and cheap method to print on small paper rolls. Recently, Sparkfun introduced a thermal printer that can be easily connected to an Arduino, hence good for custom DIY applications. Furthermore, the ability to connect it to the Internet (e.g. through an Arduino Ethernet shield), makes the thermal printer an interesting device for Internet-of-Things applications. Check out this post from Wired-magazine for more background info.
I ordered the Sparkfun thermal printer, and did a bit of research what software solutions exist to control it via Arduino. Here’s my outcome, grouped into 3 categories according to their functionality:
1) Solution using manual commands and formatting: The tronixstuff-tutorial explains basic setup and connection, and a couple of Arduino sketches for basic printouts using manual commands over the Serial port. These sketches won’t work on Arduino 1.0, but require the old v22 or v23.
The full set of commands (bold, underline, etc) supported by the thermal printer can be found in the printer’s user manual:
2) Libraries for easier text layouting / formatting: Manually controlling and formatting the printer output can be a pain. However, Buildr and Adafruit provide Arduino-libraries that make this process much easier. The libraries abstract from the printer’s formatting codes, and provide simple methods that you can call in your sketch. This saves a lot of time, as it spares you from looking up individual codes in the printer’s user manual.
The Adafruit library seems to base on the Buildr library, but includes some extra features such as printing images. Don’t expect anything high-resolution, but basic logos or QR codes work great. Any image needs to be pre-converted into a 1-bit Bitmap with a max widht/height of 384 pixels.
3) Solutions to network-enable your thermal printer: I found three projects that provide a framework for connecting the thermal printer to the net:
– http://wiki.ladyada.net/tutorials/products/iotp: This is not really a framework, but rather a hardware-kit that Ladyada put together for people to start building “Internet of Things” based printing applications. She provides a simple sketch that checks for and prints particular Twitter feeds. You can modify this sketch for your own needs.
– http://newsinternational.github.com/iot-assistant/. This is a Ruby-on-Rails based solution, which provides a web-based interface to send printing jobs or schedule them for a particular date and time. It also includes a some example apps that e.g. print a personal daily agenda based on google calendar or emails from one’s gmail inbox.
– Gofreerange Printer: I found this probably the most flexible and powerful framework for network enabled thermal printing applications. It has a modular architecture which consists of a Backend Server, Content Services and the physical printer itself. Each printer is registered with a unique address at a Backend Server and polls it regularly to check for new content. Different Content Services (simple HTML webpages) can push print-jobs to a backend server which are then printed by the according printer. The nice thing is that everyone can provide a Backend Server or develop Content Services for someone else’s printer. This makes it a great distributed solution. The framework is open source and available from github https://github.com/freerange/printer/.