Adafruit Thermal Printer w/Arduino

Updated: 3/20/15


I finally got a thermal printer from Adafruit. The nice folks at MakerspaceUrbana got me a discount. I'm not sure what all I'm going to do with it but  I'm sure it will come in handy at some point down the road. The instructions and library are available from Adafruit. I use codebender for all of my Arduino programming. The libraries weren't built in so I had to upload them but that's a simple enough process.

I decided to test this out so I looked at the code and decided it would be pretty easy to make it print the time and temperature whenever I hit a button.

The parts I used to test this out.
  • Arduino Uno
  • SC1307 Real Time Clock Module
  • DHT11 Temperature and Humidity Sensor
  • Button
  • Thermal Receipt Printer
 Basically I just wired these up with a protoshield. The RTC module uses I2C on analog pins 4 and 5. The DHT just uses digital pin 7. They both run from 5vDC supplied by the arduino. The printer uses digital pins 5 and 6 and a ground. You'll need an external power source for the printer itself. Here's a layout of the connections.


The code is pretty straight forward. It checks every second to see if the button is pushed. If it is it prints out the time and temperature along with humidity and heat index.

I think that's a good first sketch for the printer. If you take a look at the Adafruit page you should be able to easily change the code and/or sensors to make this thing print out whatever you want. I'm sure I'll come up with a good project for this thing before long. The library comes with more example sketches and there's even a python library for using this with a raspberry pi which I may have to revisit later.

Update:

I mounted the printer in a nice wooden box. I added a built in button and on/off switch and some LEDs that aren't connected to anything yet. I found a nice library to print QR codes but I'm still working on getting this thing to print pictures.

Here's some example code. I had to change the button pin to 11 because that's what's available on the Tinkerkit LCD. If you look at the libraries used you can see how to change different settings like text size and justify. Some of the libraries I've used aren't built in to codebender but you can copy them from my account here.

Comments

Popular Posts