Printing anything with a thermal receipt printer

Over the last year, [James] has been a part of a few commercial projects that used a thermal receipt printer as part of the build. Something must have cracked in his mind, because [James] spent a lot of time developing a way to print customized content on receipt printers, connecting these printers to the Internet, and sharing content with other Internet-connected receipt printers. Even [James] doesn’t know why he spent so much time on this project; [James] figured he was bound to find something interesting. We’ve got to commend him for that.

[James] had been aware of the Adafruit Thermal Printer Library, but this library is a little kludgy. Text is the Adafruit Library’s forte, and while graphics and non-ASCII characters are possible they’re certainly not easy to print with the existing libraries. With his current system based on HTML, CSS, and Javascript, [James] has a really easy way to print anything he can put on a webpage on receipt paper.

Getting his receipt printer onto the Internet had its own challenges. After wrangling with the Arduino Ethernet library through the month of February, [James] realized larger prints (about 15cm of paper) would fail inexplicably. To get around this, [James] wrote an HTTP client for the Arduino that would fetch data, put it on the SD card, and then start printing.

Right now, [James]’ project is a polished as anyone could hope. We’re a bit concerned – although we completely understand –  that he could get sucked into the black hole of pointless development of receipt printer software so easily. All was not for naught, though; now anyone can make very professional-looking prints on receipt paper very easily.

Comments

  1. KG4MXV says:

    Hey cool I can not scan in some of my old toll receipts and change the dates and get a few more bucks on my expense reports.

  2. Delmar says:

    This is a great project, I have a couple receipt printers gathering dust in the garage, now I can put them to some use.

  3. “We’re a bit concerned […] that he could get sucked into the black hole of pointless development of receipt printer software so easily.” Since when do the editors criticize hacks as pointless? Isn’t that supposed to be the cynical readers’ job?

    • Ren says:

      Maybe they were trying to make a pre-emptive strike.

    • Ren says:

      It would be nice to be able to add content (e.g. “Thank You!”, signature, ASCII graphics, border, hitleresque doodle) to an existing POS printout. You know, to personalize the receipt you are handing your customer.

  4. HAD says:

    Depending on how easy this is to use / integrate, I may have a use for it.

  5. KG4MXV says:

    Hey I got it.
    Use it during Halloween,
    set it up so when the little buggers ring my door bell it prints out a picture of a candy bar. LOL

  6. Tony says:

    So it works on one specific thermal printer.

    Still, it’s impressive getting even just that one to work as receipt printers, every single one of them, suck.

    They all require different drivers, weird libraries, restricted fonts, gah.

    And yes, @KG4MXV, if you work with POS hardware you can skip the ‘scan it in’ part and simply run up you own receipts to replace those you’d ‘lost’.

    • NsN says:

      I’ve only worked with 3 different thermal printers, but the basic concept seems to be pretty straight forward:
      – You have one shift register that holds the dot information for the head
      – The head is divided up into units of usually 64 dots, so you can reduce the power drain, each unit is activated with its individual strobe line
      – The paper feed is usually driven with a stepper motor, the coils have to be connected to a suitable driver
      – There are head up / down, temperature and paper sensors, those can usually be read out with a suitable resistor, according to the datasheet.

      Of course if you are looking for maximum printing speed, you need to look at the head temperature and how many dots are actually active. But this is also pretty similiar for all printers i’ve used so far.

      • Tony says:

        …and to power those printers you might want to build your own nuclear power station.

        First, dig a hole in you backyard and pull out some uranium.
        Then…

    • lazyatom says:

      Hey Tony,

      I’ve only written the software for a single printer, but it’s relatively trivial to add other printers. As long as you are happy to write the code that turns an array of bits into the serial commands your printer needs, or parse the very simple alternative bitmap format on your Arduino, you can use any printer at all.

      I’m going to add a page to the wiki about adding other printers that should hopefully clarify this more.

      If you’ve got any other questions, give us a shout at printer@gofreerange.com!

      • Tony says:

        Yeah, it’s not particular difficult, just tedious.

        It’s like back on the good old days of DOS and dot-matrix printers, writing code to handle all the different escape codes just so you can bold a heading. I can’t say I’m keen to go back.

        The last POS printer I needed to interface had a few driver bugs, when I asked how the developer was going I was told he committed suicide by shooting himself in the head. There’s a response you rarely get. I wrote my own after that, it didn’t seem right to ask when the new guy was due to start.

        Some printers don’t have a bitmap mode, or rather it’s either undocumented or you can’t get the documentation – that’s the main hurdle.

  7. joe anon says:

    watchout for the BPA

  8. truthspew says:

    Back about a decade I was doing POS installs. We used Eltron printers (I think they’re Epson now). They had escape codes to allow bit programming.

    We used the same software at our company so I programmed the company logo and bar codes on it.

  9. foogoid says:

    From the site:

    TL;DR: In a nutshell, I’ve accidentally built a software system that makes it easy for YOU to:

    -build your own small internet-connected printers,
    -produce customised content for them, and
    -share that content with other people who also have small internet-connected printers.

    Congratulations, you invented the fax machine 😉

  10. avaviel says:

    Remember the game the was played on a printer?

  11. CG says:

    But why does he want to print a picture of Hitler?

  12. bio says:

    very nice! i love thermal printers … i made 2 months back an mbed network connected that prints my transcribed Google voice voicemails from my droid and the main problem i had was conveying the strength of the transcription and without the ability to “grey” this may help make a symbol for that!

  13. abuthemagician says:

    I have 2 Epson TM-u88III thermal printers with the PS-180 power supplies I need to get rid of at work. Anyone want them for the price of shipping? You don’t have to take both of them…

  14. 0x223 says:
  15. Xenarian says:

    Godwin’s Law. That is all.

Speak Your Mind

*

Related Hacks in parts

  • Printing anything with a thermal receipt printer
  • StorageBot finds all your components, makes your storage drawers feel inadequate
  • Reverse engineering a Nokia LCD