Background
I threw this project together a while back to try out a better way to do shopping lists. Often I wanted to print out a list quickly and run out the door, but a full 8.5x11" sheet seemed like overkill. Sparkfun has a cheap thermal printer that uses receipt paper and so I wanted to see if that would be a good solution.
The added benefit of these printed lists is that you don't have to whip out your phone to check the list. With COVID-19 still a concern, this is an added benefit for those taking extra precautions. Avoiding using your phone while shopping reduces the number of things you have to clean when you get home.
Implementation
Upon receiving the printer I hooked it up to a 9V 3A supply and connected an FTDI USB to serial cable. This was straightforward as the device shipped with interface pigtails. The next challenge was formatting my inputs to the device to wrap text appropriately and get a little extra formatting.
I've written plenty of Python code to talk to serial devices, and I like Markdown as an 80% solution for formatting documents. So I wrote a script that takes in Markdown and formats it for the printer. You may find it on Github or mirrored here.
So now we can:
cat | ./thermal.py
# Test #
Hello World
<ctrl-d>
And boom goes the dynamite:
Example
One use case that I found works well is recipes. I can print the recipe (which is best if it is concise), shop for ingredients, and then pin up the instructions to run through the steps. Here is one that I like:
# Hoppin John Salad #
Makes a large bowl. Serves 6-7 people.
## Ingredients ##
* 2-3 celery ribs
* 1 bell pepper (when multiplying use different colors)
* 1/2 medium onion
* 30oz of canned (usually 2 cans) black-eyed peas rinsed and drained
* 1 jalapeno pepper or 2-3 thai chilis. Seeded, diced.
* 2 tablespoons fresh parsley chopped
* 1 garlic clove minced
* 1 tsp salt (more to taste)
* 1 tsp ground black pepper
* 1/4 tsp cumin
* 1/4 cup red wine vinegar or apple cider vinegar
* 2-3 tbsp olive oil
* 2 sliced bacon cooked, crumbled.
## Procedure ##
1. Dice first 4 ingredients. Combine with the next 7 in a large bowl. A large one. Really.
2. Put vinegar and spices in a small bowl. Whisk in olive oil in a slow steady stream. Blend well.
3. Add vinegar mixture to bean mixture. Toss.
4. Cover and chill for 4 hours (you can skip in a hurry)
5. Add bacon before serving.
6. Optional: Garnish with more parsley.
The result (full image):
Future Work
Hardware
I would like to integrate a power supply and USB serial interface with an enclosure to make the setup more robust and standalone. Ideally the assembly would include a battery to handle the large peak currents seen during printing. It would be topped off by USB power to avoid a separate cable and wall wort.
Script
The script makes a lot of assumptions about the character set used. Being more flexible could allow better international output, however the printer supports limited character sets so this may be a challenge.