Sprite_TM’s Magic Paintbrush

When it comes to hackers we love, there’s no better example than Jeroen Domburg, a.k.a. Sprite_TM. Sprite’s now working for Espressif, makers of the fantastic ESP8266 and ESP32, where he created a miniature Game Boy and turned this PocketSprite into a real product. He’s installed Linux on a hard drive, and created a Matrix of virtualized Tamagotchis. In short, if you’re looking for someone who’s building the coolest, most technical thing of sometimes questionable utility, you need look no further than Sprite_tm.

Sprite was back at this year’s Superconference, and again he’s bringing out the big guns with awesome hardware hacks. This time, though, Sprite is tapping into his artistic side. Sprite is very accomplished in making PCB art and DaveCAD drawings, but actual art is something that’s been out of reach. No problem, because you can just buy an inkjet printer and make your own art. Sprite’s doing something different, and he’s turning his inkjet into a Magic Paintbrush.

The schematic for the first inkjet cartridge

This hack began by buying a simple HP inkjet printer from China for $28 USD. There’s some interesting hardware in this cheap printer — an ARM processor that might run Linux, there’s a big ‘ol serial Flash chip with all the code completely unencrypted, and there’s a serial port that spits out debugging info. On the printer carriage itself, there’s an encoder, but the real story here is in the ink cartridge itself. There’s a reason inkjet cartridges cost more than the printer itself. Inside each inkjet cartridge, there’s a reservoir of ink, and a series of tiny holes. Right beside those holes, there’s a small heating element. When current is applied to that heating element, the ink literally boils (yep, that’s where the trademark ‘Bubblejet’ came from) and squirts out the nozzle onto a piece of paper.

The first HP ink cartridge had twelve of these nozzles, which is easy enough to control directly from a computer or microcontroller. To print faster, though, you’re going to need more nozzles, and that means more heating elements. To do this, HP engineers simply lay out the nozzles in a grid, and control each nozzle with a MOSFET and a matrix that will heat up these nozzles individually. The HP cartridge in Sprite’s printer is much more complex, and after removing the metal mask on the printer cartridge and carefully inspecting the silicon underneath, he was presented with hundreds of nozzles, all controlled through just a handful of pins. That’s alright, because oscilloscopes exist, and this is something that can be eventually reverse engineered.

After a few tries, Sprite got his inkjet cartridge squirting ink everywhere, which meant only one thing: he had to turn it into a magic marker that could draw in any color. A quick bit of KiCAD later, and Sprite had a PCB that wrapped around the ink cartridge that printed nyan cats on anything.

Of course, being able to print nyan cats on everything from skin to lattes is cool, but with the simple addition of a color sensor, Sprite’s magic marker can become a marker that will write in any color. Yes, if you hold this magic marker up to a banana, it will write in yellow. Hold it up to an apple, and it’ll do green or red. If this sounds familiar, you’re right: this is the idea behind the perpetual Kickstarter scam, the Scribble pen, but this one works.

If you haven’t watched the video, please do. Sprite’s presentations are as humorous and enjoyable as they are informative and technical. And thanks again to Sprite for the great talk!

27 thoughts on “Sprite_TM’s Magic Paintbrush

  1. I want to go over this in detail later. I wonder if this could be the basis for an OSS inkjet printer and be a springboard for other hacks depending on what can be put though one of these print cartridges.

  2. It’s a cool project, but I can’t imagine any useful application for it.
    It would be somewhat cool, to have a smartphone that can not only take photos and read texts, but also print them by just moving it over a piece of paper, but this would also be a terrible mess when carrying it in a white shirt after printing.

    1. On the fly customized duct tape/scotch tape for packing/marking presents or almost anything. Just select your pattern and take however long piece of tape you need, paired with encoder from mouse it could print rather consistently. Will try making something like this for my company, those dymo label printers API really sucks.

      1. Or full color printhead for 3d printers, so you only print in white filament and printout is automatically painted in desired places. Or making large format 2d printer on the cheap. Or making printer for large wood panels. Or even large wall printer (won’t work outside, unless you spray with clear laquer afterwards). I also know someone who could probably use it to print obscene/funny things on windshields of people who park like a*holes (would easily wipe with typical wiper fluid).

  3. It’s always a blast reading up on Sprite_TM’s projects, he really is very talented, chooses interesting projects, and the way he conveys his work is very entertaining. Glad to have him as a source of inspiration in our community.

    1. I don’t know. esp8266 is second to none in being the worst microcontroller in the world. You want working code examples? Well, f*** you. You want some documentation? F*** you. But it’s literally dirt cheap, has wifi and kind of fun to hack if you’re not in a hurry and don’t need any kind of reliability. Also the tremendous effort of dedicated hackers like Sprite_tm and cnlohr make it more attractive.

      I have no idea about esp32, it could be very different. I would be very surprised though. What’s your experience with the alternatives that you listed?

      1. That’s what I thought… I am working with the Microchip ATWILC3000, because it is the only module not including a proprietary TCP/IP stack (i.e. a huge blackbox) and which is supported by a freely available driver that does not require Linux, and can be used with an RTOS. Effectively, this allows you to use any RTOS on a host processor with a TCP/IP stack such as lwIP which will then send raw ethernet packets to the WiFi module via SDIO or SPI, avoiding pesky AT commands and reducing the size of the black box somewhat (still has a large binary blob firmware, though). However, the code quality is horrible, the examples are lackluster, the documentation is as bad as can be, the support team apparently doesn’t really know how their own device works. I am kind of disillusioned about the whole embedded WiFi thing, there appears to be no way to do it properly; the “approved” ways of doing it always seem to be kind of a hack. Good old Ethernet is the most beautiful thing in the world compared to that…

        1. Interesting, thanks. The WiFi bit itself on esp8266 didn’t give me too much trouble as such, though I haven’t yet started trying to make it work in a more presentable manner. But good luck figuring out how to use its hardware SPI peripheral for example. The “authentic” espressif code samples are full of diarrhea and comments that show that nobody really knows what they are doing. I pieced my SPI driver from someoneelse’s SPI experiments on github and bits of the Arduino driver code, then just guessing some of the bits. Anyway.. I guess this is the state of the art.

          I still appreciate that for such a low price I get a very compact wifi-enabled module with a lot of flash that I also use to configure the FPGA. That’s still pretty cool I think. Just don’t use it in a commercial project.

          1. Thanks, sounds fun… The price of those things is crazy, yes. Supposedly the Marvel WiFi Chips are properly documented, if you sign some NDA’s. Google uses those in the Chromecast Audio. They might actually be nice, but no mere mortal may use them…

        2. The ESP32’s SDK, esp-idf, uses lwIP as its default IP stack, and it’s all based around tasks running on FreeRTOS. When writing code for the ESP32, I believe everything is setup very close to the model you’re describing (including needing a binary blob for the wifi radio), except that when lwIP hands packets to the wifi radio they’re going to an on-chip blackbox rather than one connected over SPI or SDIO.


          But that’s for running your application on the ESP32 MCU itself and it sounds like you’re more interested in a WiFi module to add to an existing MCU as a peripheral, which doesn’t really seem like a use case where the ESP8266/ESP32 has anything much to offer over any other option (aside from the ESP32 having an SDIO slave peripheral if you wanted to write your own firmware to shuffle packets back and forth between the SDIO-connected host and the esp32’s wifi modem’s api). Especially if one of your goals is to /avoid/ offloading network processing to the chip.

          1. Yes, i definitely need a “big” host processor (multimedia stuff) so the Wi-Fi module needs to be a peripheral-style device. So if the ESP32 uses lwIP, is it a modified custom version that is difficult to handle or is it a “mainline” version?

          2. (That link should include the ‘…2.0.3-esp’ to include the changes in the correct direction between the two branches. But if you click on the section of the URL that was turned into a link automatically, it will still work after you click the ‘Try switching the base for your comparison.’ link on the github page)

  4. I really enjoyed watching the video of this talk. I always love walk-throughs of reverse engineering attempts and the nyan cat reveal really was exciting to see after the build up. It’s left me excited about the whole idea, and desperately casting about for an excuse for what I could do with such a device.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.