Thermal Printer Hacking

 As part of my knucklebuster hacking project, samples of viagra I’ve been working with a portable thermal receipt printer. I picked up a Citizen PD-22 on eBay at a very attractive price, but later realized why it was so attractive: the printer uses a proprietary RS232 cable, and replacements are hard to come by at any price, much less a reasonable one.

Mysterious Port

Aside from that hitch, the printer itself is great. I found a full list of the control codes on the manufacturer’s website, and got it to spit out some configuration information. It runs on 4 AA batteries, which fits the bill of "portable electricity" for our show. 

The printer also has an IrDA port, but after poking at it for a day and talking to a friend about it, I’m abandoning hopes of getting the Arduino to interface with it. I have a bunch of IR LEDs, but the IrDA protocol is apparently a big pain.

Poking around on DigiKey didn’t bring up any connectors which fit the bill, so at the suggestion of someone on the NYCR Microcontroller Study Group list I set about building my own by etching a tiny PCB with appropriately spaced traces.

A pair of calipers measured the traces at 0.8mm, so I came up with a board in Eagle, shown at left. It’s super simple, just 10 wires and 10 holes. I plan on using a Makerbot to make a nice little housing for the board, after I trim it down some. 

Note that the traces fan out at the end simply because I am not very good at soldering in small spaces, and i wanted plenty of room for error since I was using the toner transfer method of making the PCB. 

The board was actually a bit too thick, and while someone more patient might have ordered thinner copper-clad board, I am nothing if not impatient so I took it to the belt sander to remove a little bit of material from the back.

 After some trimming I got something which appears to work! I’ve located power and ground on the pins, but not much else. None of the other pins seem to be saying anything, which is surprising.

Still left to do is drilling out the holes for the wires and soldering them up. Then I’ll cut/file the excess board away and build a little housing for it on a Makerbot. I may decide to re-etch the board with slightly longer traces, right now there’s *just* enough room to clear the printer housing. That and one of the traces didn’t come out quite right (although it’s still serviceable as-is).

Admittedly, I did end up ordering an official cable for the princely sum of $35. I figure I can use it as a control, and to double check that I’ve figured out the pins. So far I haven’t located TX/RX. I would have expected RX to be floating, but my cheap RadioShack multimeter shows no signs of life on the other pins.



Folded paper boxes

I’ve been working on learning Processing, a language which is a bastardization of Java used for drawing pretty pictures (among other things). Most of its functions are based around drawing/graphics.

Processing project #1 was to generate templates to be cut on the laser cutter. Specifically paper boxes, because I needed something to package my Tinysaurs in. They end up looking like this:

Laser-cut boxes

You enter the depth, width, and height of the box, and Processing draws the pattern

Processing has a PDF library which I use to generate the template in PDF format, which Corel Draw is able to read. I’m looking into using Python instead of Processing, because it apparently has a nice DXF library. Although the fact that Adam scoffs at Processing makes me want to keep using it just to annoy him.

The Processing program is available in the NYC Resistor SVN repository. Which is public, hooray! The code is only vaguely commented, but it should be pretty clear what it’s doing. Maybe.

Of course you dont’ need a laser to cut these out, and xacto knife would work just fine. But… I have a laser so I use it.

If you don’t want to mess with Processing and just want to print box patterns, you can do that too. I’ve generated a bunch of sizes:

You may need to right-click and save the pdf to your hard drive to get it to load.

lased, Networked USB Lamp

New Project: Lamps

Hooray, a new project!

At work it often gets very loud in my office, so everyone wears headphones. Unfortunately this makes it difficult to get someone’s attention, because they’re all rocking out to David Bowie or whatever. Also, it gets very dark in my office because we don’t have desk lamps.

The solution, clearly, is networked USB lamps that you can make blink if you want to get someone’s attention. Someone else suggested a cheaper solution would be Nerf balls to throw at each other, but that’s way less fun to build.

Lamp prototype

Here’s my prototype for part of the first lamp. I’m making 5 lamps total, and they’ll all be different. Each lamp will have white LEDs for general lighting, and then different colored LEDs for various alert functions. The first couple will probably just use normal, colored LEDs. I’ll try some RGB LEDs later, they’re just so stupidly expensive compared to normal LEDs.

I wrote a program in Processing to generate the parts, so I can easily make models of different sizes or with different thickness materials. I’ll post it in a bit when things are a little farther along.

I’m using an Arduino to prototype the electronics, but will probably switch to something cheaper like an ATTiny when I go to build the lamps.

Just because it’s handy, I’ve written the prototype drivers for the lamp in Processing, but that’s only because I already had it open. Eventually I’ll want something that can hang out in the systray / menu bar, and I don’t think Processing allows for that. Tho one advantage of Processing its an easy way to make executables for both Mac and Windows. Or it pretends to be, I’ve had inconsistent luck getting Processing applications to run on my windows machine. Thanks, Java!