Party printer project

From Helpful
Jump to: navigation, search
It's a box that prints things.

This was made as a selfie thing at a party - at the height appropriate for an erotic party, in fact - with the idea that it was just high quality enough to be recognizable but not very identifying.


The printer is a thermal printer, the kind that prints receipts at a checkout. This means you don't need to worry about ink, and the paper isn't very expensive - or particularly wasteful, being small.

It turns out most POS printers (there's not a lot of difference) do around 200dpi at least (more is rarely useful), so can print a decent image if you tell it to do more than letters, and massage the image beforehand.


In the box

  • a power strip
makes image processing easier than on a uC
  • an access point (and power supply)
  • Thermal printer meant for point of sale (receipts)
    • thermal printer means no need for ink, just the paper rolls
    • Currently a HS802UL (USB and network), I previously broke a serial Star TSP600
    • having a cutter is nice
    • I would recommend trying to find one with network interface, because serial interface is rather slower, and potentially finicky (e.g. if you don't have proper flow control), whereas networking comes down to 'open TCP connection and send data'
  • some creatively positioned plastic and wood for positioning


With a little image massaging (contrast enhancement and in particular dithering), the quality is better than you'ld probably expect from a 58mm (2.3") receipt. It'll look a little worse if you use a webcam in lower lighting as we did
It makes random-wordy decoration


Alongside:

  • A WiFi-capable IP camera
Here a DCS-930L, but any should do, as long as it exposes an URL to fetch the current image from (without too much trouble)

The code

Capturing from the IP camera is continuous, and we detect a sudden increase in brightness, collect a number of candidates, and choose the best.

This means we can trigger with a button that lights a lamp, rather than a button that triggers the Pi to do an image capture and print directly.

This avoids wiring you can trip over, and makes it much easier to put the box somewhere else without any wiring - hence the WiFi.


Various POS printers speak their own proprietary but more capable protocol, but many should be able to speak ESC/POS, a relatively basic protocol, which means fairly simple code should work for most POS printers.

Say, that decoration is mostly just sending strings, alternated with cut commands.


The conversion to an image is mostly basically finding yourself a binary image, and packing it into bits, a row at a time.