All posts in Technology

Blinky Love Note

I made a blinky love note for my sweetheart this Valentine’s Day, because what’s more romantic than Morse code?

morseblinky

A single LED paints a 6″ x 6″ canvas with light. It first tells a story through color, and then slowly pulses a secret message in Morse code, fading from deep to light pink.

The smart LED is run from a 5v Adafruit Trinket, powered by 4 AA batteries. Download the code here. (This just blinks “hello world.” The secret message will remain secret).

LED Strip Clock

I just put together a clock with Adafruit’s 60-NeoPixel LED strip, running off a Teensy 3.0 microcontroller. The flexible 1-meter strip has 60 RGB lights, so different colors represent the second, minute, and hour — you can read it like a normal clock if it’s in a circle, but you can also leave it in a straight line or drape it over something for the Salvador Dalí look.

Version 1 of the clock code advances the second using the delay() command, and moves the minute every 60 seconds and hour every 60 minutes. It’s a good exercise in procedural logic, but loses time quickly.

Version 2 uses a crystal soldered directly onto a Teensy 3.0, which will keep time if you attach a watch battery. Look at the Teensy Time Library page for more info.

The LED clock lets you pick different color schemes, add faint dots every 5 or 15 minutes (or none), and turn on blinking hour “chimes.” Right now you need to set these options in the Arduino IDE and re-upload, but I’ll add the ability to change that with buttons or a knob at some point.

View or download the code here.

pixelclock1

I don’t have any pictures of the final clock in action — I gave it to my dad.

pixelclock2

[UPDATE 5/24/14]

I’ve discovered some design problems with this project. First, Adafruit recommends adding a capacitor between the – and + on the NeoPixel strip, and a 300 to 500 ohm resistor between the Teensy’s data pin and the NeoPixel data-in (at the NeoPixel end of the connection). This doesn’t affect the clock’s performance, but protects the NeoPixels from damage.

Second, I’ve gotten reports from someone who built this project that occasionally the second-hand LED stays on until the next time it passes by. I got a lot of glitches the first time I had v1 hooked up, but that got resolved when I used a different power supply. But the Teensy 3.0 uses 3.3V logic, and the NeoPixels are powered at 5V.

The Adafruit NeoPixel Überguide says that the data has to be at least 70% of the power or its message will get lost, and 3.3V / 5V is 66%. Close enough to work most of the time, but I’m guessing that the glitches occur when the signal doesn’t get through.

The best thing to do is add an I2C-safe Bi-directional Logic Level Converter to boost the 3.3V data to 5V. But if you’re using a Teensy 3.1 which has 5V tolerance on all digital pins (and presumably won’t get damaged by talking to a 5V device), then try this revised code for v2. I added redundancy to the erase and write message, to give it a better chance of getting through.

I’m checking to make sure that, glitches aside, nothing will get damaged with this setup. Stay tuned…

LED Candle in a Jar

I’ve been wanting to create a small light with realistic fire animation, so hot off the workbench in time for mid-winter: a flickering LED candle.

Its brain is a programmable microcontroller, running a smart RGB LED via a single data pin, housed in the lid of a jar. I used Adafruit’s Atmel-powered Trinket — a tiny, inexpensive board available in 3.3V or 5V flavors.

Here are three prototypes:

1) A self-contained 3.3V candle with a single Flora NeoPixel, powered by a tiny rechargeable 150mAh lipo battery inside the lid, with a pushbutton toggle power switch hot glued to the outside of the lid.

lantern3v

2) A 5V single-pixel candle, with Trinket on the outside for powering via USB, plus an extra 2.1mm socket for external wall or battery power. I used a nail to punch holes in the lid for the wires, and a diagonal cutter for the power socket. The Trinket is held down with hot glue.

lantern5v1

3) A 5V 8-pixel candle using Adafruit’s 8 NeoPixel Stick, with all electronics inside the lid and a 2.1mm power socket on top. The Trinket can handle 150mA output, which is right around the stick’s draw when all pixels are set to candle flame yellow (R=255, G=100, B=10) — but the stick jumps over 200mA when fully lit, so it gets its power upstream from the Trinket.

lantern5v8

The jars have a white paper disc at the bottom and a tracing paper tube running the jar’s height. I plan on replacing them with some theatrical lighting diffusion so nothing bursts into flame — probably not a risk, but you never know.

The Arduino code runs a basic fade on the green pixel, causing it to dip down and back every 120 milliseconds, roughly 8 times per second. When the green dips, the light gets dimmer and redder, as if it’s losing oxygen.

An RGB mix of 255, 100, 10 (on a scale of 0 – 255) looks like a pretty good candle flame yellow to me. The starting green pixel value is “grnHigh.” You then set how much below grnHigh the green pixel should dip for normal burning, and when it’s flickering more. “grnLow” is grnHigh minus the dip value.

The main function is a basic for-loop, called fire()

void fire(int grnLow) {
  for (int grnPx = grnHigh; grnPx > grnLow; grnPx--) {
    strip.setPixelColor(0, redPx, grnPx, bluePx);
    strip.show();
    delay(fDelay);
  }  
  for (int grnPx = grnLow; grnPx < grnHigh; grnPx++) {
    strip.setPixelColor(0, redPx, grnPx, bluePx);
    strip.show();
    delay(fDelay);
  }
}

So green starts at grnHigh, the max green value, and decreases until it reaches grnLow, then goes back up again. fDelay is calculated by doing some math with the number of steps to keep the cycle time constant.

The next set of functions all call fire() with adjusted dip and delay time. Your options in increasing amount of animation are: on(), burn(), flicker(), and flutter().

The main loop just looks something like this, with the variable as the number of seconds you want each animation to run:

void loop() {
  burn(10);
  flicker(5);
  burn(8);
  flutter(6);
  burn(3);
  on(10);
  burn(10);
  flicker(10);
}

The Adafruit NeoPixels officially run on 5V, but according to the power page of the Adafruit NeoPixel Überguide, small numbers of NeoPixels can run off 3.7V. (I’m powering them from the 3.3V pin on the 3.3V Trinket, and it seems to work). The thing to consider is that green and blue pixels draw more power, so they’ll be dimmer and the whole RGB effect will be warmer. So grnHigh, bluePx, burnDepth, and flutterDepth all need to be tuned higher for the 3.3V version. I eyeballed 3.3V next to 5V, and include both values in the sketch’s comments.

lanternOn

For the 8-pixel strip (above), I created a color and flicker-depth gradient that was more exaggerated toward the top, and not at all at the bottom. It’s supposed to look like the flame height is dancing. It looks more convincing, but the portability of the battery-powered 3.3v model’s pretty nice — and the lid fits on any Ball jar (below).

ITPjar

Get the full code here: https://github.com/timpear/NeoCandle

Photographic Monument

Vanderbilt Republic partnered with K2imaging again for this years’s Art From the Heart all-media art show, to create a massive outdoor video projection — the Photographic Monument — this time on the construction mesh below the Gowanus F/G train viaduct in Brooklyn.

PM_screen1

Mark Kleback and I wrote a Max/Jitter patch which would randomly cycle through all photo submissions to the show, and allow the viewer to tweak how the images interact with the environment. We used a controller that Mark built for video mixing, with four switches and four knobs.

The photos showed up on top of a background image which you could select with the controller. They were video loops which I’d shot from the F and G trains, abstract shapes, a cascade of all the photos, and a blown-up version of the photo that was being displayed. Other controls affected size, blending mode, and brightness/contrast/saturation.

PM_window

You could stand at the controls and see the monument through the window. The projector was massive. The deer was impressed.

PM_setup

Thanks to George Del Barrio for inviting us to participate. Also check out my Déjà View Master which premiered at the show.

Deja View Master

The Déjà View Master is an interactive video installation for situations where people and their attention wander over the course of an evening. The audience uses a clock-like wooden controller to rewind surveillance video back from a live feed to some-time-before.

DVM_screen3

There are two parts: a surveillance camera and TV monitor, recording video on a Mac running a Max/Jitter patch, and a wireless wooden controller sending position data to the computer, to move the playhead.

DVM_held

Recording and Playing

The Max/Jitter patch takes video from a USB webcam and writes the camera feed to a hard drive as matrix files (.jxf), one per frame, while simultaneously reading them back for display on an external monitor (via a cheap VGA to RCA adapter). The files are numbered serially, overwriting the earlier files once a limit (time or drive space) is reached.

This is basically just doing what a DVR does, although it took a bit of figuring to get it running on an updating loop in Max.

The current frame (“now”) is set by a counter which resets at the maximum frame count. When the controller is set to display “now,” the live feed is actually reading the “now”-1 frame. As you dial the controller backward, it subtracts an appropriate number of frames from the current record frame, rolling backward through zero, until the earliest point of the recording is reached at “now”+1.

I added a video effect which becomes more visible the farther back in time you go — initially it was a feedback loop which caused motion blur, but I finally went with more visible and less processor-intensive black-and-white, with increased brightness and contrast. I’d still like to add a blur or luma increase during scrubbing, independent of distance from present, but that’s for a future version.

The matrix files recorded to a solid state USB 3 hard drive. I also added a rotate 180 degrees function (jit.rota) for when the incoming webcam is clamped upside down to the ceiling.

DVM_front

Controlling

The controller is the fun part. It’s a wooden box resembling a clock, with a wooden hand which controls the playback.

The design was inspired by the Pimoroni Timber Raspberry Pi enclosure, using stacks of laser cut wood. I used 1/8″ ply, which ended up taking close to an hour of laser time. It turned out well, but I might go for a different approach next time.

The face and back are 1/32″ veneer finished with Briwax, which allow two hidden LEDs to shine through (“now” and “before” indicators).

The clock hand is attached to a linear 10k potentiometer, which is wired to a Teensy 3.0 development board running standard Arduino code (take a look at the code here), powered by an 850 Ah lipo battery (it’s a 3.3V system). The Teensy sends serial data to the Max patch via a pair of XBee radios; the receiver XBee is attached to the recording computer with an FTDI cable and XBee adapter kit. The whole thing is mounted on an Adafruit perma-proto board.

DVM_open

George Del Barrio invited me to premiere the Déjà View Master at Vanderbilt Republic’s 2013 Art From The Heart photography show and event, curated by Renwick Heronimo. I had it set on a 70-minute loop, with the camera clamped to the ceiling, and monitor behind a transparent corrugated wall.

I may experiment with other controllers in future versions. The original idea was to use the position of a beer on a bar as the playhead, but I could see that ending with spillage. The wooden controller is pretty intuitive, as long as it’s obviously associated with the monitor. Another alternative to the current design is to use a radial encoder, so the hand can keep spinning as you wind through time.

Also check out the Photographic Monument that I programmed with Mark Kleback for the show.

[UPDATE 3/23/14: The Déjà View Master has evolved into Azimuth for the “Being and Time” art show.]

Gloves Video Controller

Six of us at NYU’s ITP Camp decided to follow The Gloves Project’s patterns to build our own gloves in June. These are sensor-laden gloves that can be used to control software through hand gestures. Our group included musicians, a theatrical sound designer, a gamer, and visualists, each with different uses for the glove in mind.

To get an idea of how it can be used with video in a live setting, take a look at this test clip, where I use hand movement to wirelessly control video playback and effects.

Here, sensor values on the glove are sent via Bluetooth to a decoder patch written in Max, and then out as MIDI controller data to VDMX, VJ software. It works!

Gloves have been used as controllers in live performance for some time — see Laetita Sonami’s Lady’s Glove for example. Our particular design is based on one created for Imogen Heap to use as an Ableton Live controller, so she can get out from behind a computer or keyboard and closer to the audience. She gives a great explanation and demonstration at this Wired Talk (musical performance starts at 13:30).

Heap and The Gloves Project team are into sharing the artistic possibilities of this device with others, as well as increasing the transparency of the musical process which can be obscured inside a computer. This is an attitude I’ve believed in since attending MakerFaire and Blip Festival in 2009, where I saw a range of homemade controllers and instruments. I was much more engaged with the artists who made the causal process visible. It doesn’t have to be all spelled-out, but in certain cases it helps to see the components: the performer is making the things happen. This is obvious with a guitar player, but not so much with electronic music. Also, you get a different creative result by moving your arms than pressing a button — a violin is different from a piano.

The Gloves Project has a residency program where they’ll loan a pair of gloves to artists, plus DIY plans for an Open Source Hardware version. The six of us at ITP Camp built one right-hand glove each. We had to do a bit of deciphering to figure everything out, but we had a range of skills between us and got there in the end.

Each glove has six flex sensors in the fingers (thumb and ring finger have one each, and index and middle have two each, on the upper and lower knuckle), which are essentially resistors: the more they bend, the less electricity passes through. This can be measured and turned into a number. The sensors run to a tiny programmable ArduIMU+ v3 board by DIYDrones, which uses Arduino code and includes a built-in gyroscope, accelerometer, and magnetometer (a compass if you attach a GPS unit for navigation). This is mostly used for flying things like small self-guided airplanes, but also works for motion capture. We make a serial connection to the computer with a wireless bluetooth device.

Here’s a wiring guide that we drew up.

We had more trouble with the software side of things. The Gloves Project designed is to communicate with their Glover software, written in C++ by Tom Mitchel. There are instructions on the website, but we couldn’t reach anyone to actually get a copy of the program. In the end, we copied the flex sensor sections of Seb Madgwick’s ArduIMU code and used it to modify the ArduIMU v3 code. It delivered a stream of numbers, but we still had to figure out how to turn it into something we could use.

We formatted the output sensor data like this:

Serial.println("THUMB:");
Serial.println(analogRead(A0));
Serial.println("INDEXLOW:");
Serial.println(analogRead(A1));
Serial.println("INDEXUP:");
Serial.println(analogRead(A2));

…and so on. I then programmed a patch in Max to sort it out.

Details:

When one of the sensors’ name comes through, Max routes it to a specific switch, opens the switch, lets the next line through (the data for that sensor), and then closes the switch. Data goes where we want, and garbage is ignored.

Every glove and person is slightly different, so next the glove is calibrated. Max looks for the highest and lowest number coming in, and then scales that to the range of a MIDI slider: 0 to 127. When you first start the decoder, you move your hand around as much as you can and voilà! It’s set.

I made the default starting point for flex sensor data 400, since the lowest point sometimes didn’t fall below 0, while the peak was always above 400. The starting point for movement data is 0. There’s also a “slide” object that smooths movement so it doesn’t jump all over the place while still being fairly responsive.

The number is now sent through a Max “send” object with a different name than the raw sensor data. If you’re keeping everything inside Max, you can just set up a corresponding “receive” object.

Otherwise, it gets turned into a MIDI control or note value, and sent out through a local MIDI device or over a network.

Finally, I tidied everything up so it’s useable in presentation mode. Anyone can download the patch and run it in Max Runtime (free).

There are probably more efficient ways of doing this, but it’s our first pass to get things working.

To download all our code, visit https://github.com/timpear/ITP-Gloves/

Since finishing that, I discovered that The Gloves Project has released a whole range of decoders / bridges in various languages. Their ArduIMU code has lots of clever deciphering on the gloves end of things, and the bridges primarily output OSC instead of MIDI, which is handy. Beyond that, The Gloves Project continues to develop new versions of gloves, and are worth checking up on.

Our decoder simply translates the raw sensor data. The next step is to get it to recognize hand gestures, and trigger specific events or adjust values based on that (which is what the Glover software does). We also need to program the glove’s RGB LED and vibration motor for feedback from the computer.

I showed this project to Karl Ward (rock star, Ghost Ghost collaborator, masters student at ITP), and it turns out that he’s currently working on an Arduino library to do a lot of this work, only more elegantly, within the controller. The first library is Filter, which he augmented over the summer to require another new library he wrote, called DataStream. He says: “They are both in usable, tested shape, but the API is still in flux. Right now I’m looking for folks who have Arduino code that does its own filtering, or needs filtering, so I can design the API to fit the most common cases out there.” We’re going to jam.

The glove has all sorts of possible artistic applications, but what else? When I showed it to my dad, he wondered if it could be used as a translator for sign language. Brilliant. It sounds like Microsoft is currently developing software for the Xbox One and new Kinect that will do this, although one advantage of a wearable controller in any case is the ability to get away from a computer (within wireless range). One of the people on our team is going to use it to adjust audio signals while installing sound in theaters. Easier than holding a tablet at the top of a ladder.

Another friend suggested that the glove as demonstrated here could be used for art therapy by people with limited movement. I imagine that something similar is in use out there, but the open-source aspect adds another level of customization and possibility, and again, transparency.

I’m looking to experiment with adjusting specific elements of a video clip with something more organic than a slider or knob, and also be able to interact more directly with a projection. I’ve worked with painter Charlie Kemmerer, creating hybrid painting-projections during Ghost Ghost shows. Charlie works on the canvas with a brush, but even standing beside him, I have to work on an iPad at best. Now I can point directly at the surface while selecting, adjusting, and repositioning clips. Or Charlie could wear it while painting to capture his movement, without it getting in the way of holding a brush.

Creative work reflects the nature of your instrument, so it’s exciting to expand the toolset and learn more about the media. Video A-B fades are pretty straight-forward, but the way that the IMU unit works isn’t nearly as predictable as a fader on a board, and I’ve gotten some unexpected results. That’s a good thing.

Even better, I can’t wait to see what other people with these gloves come up with. Tinker, modify, share.

Asteroids Controller with Raspberry Pi

The 1979 arcade version of Atari Asteroids is a beautiful thing.

A white triangle battles lethal polygons on the glowing phosphors of a vector display. The two-note pulse of the music is syncopated by the “pew pew pew” of your effort to stay alive. The controls are as minimal as the graphics, and yet the game itself is complex, never the same twice.

I am a fan.

Years ago, I wired up parts from a scrapped Asteroids machine to control a computer via USB. It’s a beast. So when I had access to the resources at NYU’s ITP Camp, I decided to learn some new tools and make a refined desktop version. This one is designed for a tiny Raspberry Pi computer running an arcade machine emulator (MAME), so all you need to provide is power in and audio/video out.

Asteroids Pi

I’ve included links to design files throughout this page — be sure to open the PDFs in a program that can handle layers. Or, here’s a zipped folder with all the files in one place:

DesktopAsteroidsPlans.zip

The Design

First up, I made vector artwork of the Atari Asteroids control panel by tracing a photo in Illustrator. (I’d actually done this a few years ago for a different project).

measuring

Asteroids Control Art

asteroids_controls.pdf (editable PDF)
asteroids_controls_cs3.ai (Illustrator file)

I decided how small the face could be and still have a comfortable layout, and how tall the controller needed to be to house all the components. From there I sketched up the basic design, and started fabrication with the frame.

The Frame

The acrylic faceplate wraps around 3/4″ plywood end caps, which are connected with two 1.5″ x .5″ plywood rails.

The end pieces have 3/8″ grooves for the acrylic and rails. The CNC machine (robot miller) carved these first, before making a deeper pass to cut the outer shape.

CNC_asteroids_sides.pdf

CNC1
CNC2
CNC3

That done, it needed some good old cabinet art. I made a black and white vector image from the original arcade marquee, and etched that with the laser cutter in raster mode.

asteroidsmarquee_BW_vectors.svg
LASER_asteroids_sideart.pdf

Image link: marquee art
Image link: screen bezel art

marquee
sides etched

Finally, I carved out the rails with a table-mounted router. Nothing computer-driven here, but I did make a diagram. The slots are for removable acrylic shelves.

SHOP_asteroids_rails

The Faceplate

I used 1/4″ clear acrylic for the faceplate to show off the components. The control panel file has layers for raster etching (the artwork) and vector cutting (edges and button holes) with a laser cutter. The plans are flopped so the art is etched on the inside.

There are also 3 shelves that slide into the grooves in the wood. The smaller ones have mounting holes for a breakout board and terminal.

LASER_asteroids_faceplate.pdf
LASER_asteroids_shelves.pdf

LASER_asteroids_faceplate

cut acrylic

ITP has a large strip heater for bending acrylic. I heated up the laser-cut piece along one seam, holding it just above the heater. I flipped it over every minute or so to heat it evenly and prevent warping or blistering.

bending acrylic

Eventually it was soft enough to flex slowly. I put the shorter edge on the table, and holding the sheet evenly, pressed it forward. Holding a piece of wood along the seam helped start the crease straight. I had to re-heat the fold throughout the process, using the heater on the outside and a heat gun along the inside.

I matched the folds to the curve of the plywood end pieces. There was eyeballing involved. It’s not perfect but it’s secure, shiny, and strong.

bent acrylic
assembled1

Assembly and Wiring

I finished the wood with Briwax and glued it all together. The faceplate’s curved shape is enough to hold it in place, but it’s still easy to remove by lifting up on the front edge.

I wired up the buttons with quick disconnects and it looked like this:

final
21_final

The buttons are from an original Asteroids arcade machine, so they’re the old leaf switch type. You can’t get much simpler: a spring-loaded plunger presses two pieces of metal together. This was standard in arcade games until the mid-1980s, when they were replaced with micro-switches. The leaf switch is easier for rapid-fire and finesse. The micro-switch is more compact and goes “click.”

24_final

I scrounged my old buttons at Vintage Arcade Superstore in Glendale, California. The leaf switch buttons were meant for a thin metal plate, and just barely fit around the 1/4″ acrylic. A major supplier of new parts is Suzo-Happ.

I also got two original cone-shaped Atari start buttons. They’re supposed to blink when you insert a coin, but the old parts box I went through didn’t have any with working lights.

A micro-switch inside a hole on the front signals that a coin’s been inserted.

25_final

I wired the buttons to a small Perma-Proto Raspberry Pi Breadboard from Adafruit (details below), which was mounted to the acrylic shelf with 1/4″ standoffs. I also ran wires to a terminal on the other end, in case I ever want to attach the buttons to something other than a Raspberry Pi.

19_final
20_final

When it’s all put together, the Raspberry Pi computer sits on the large center shelf, with access for video, audio, and power cables running out the back.

26_final

Raspberry Pi

The Raspberry Pi is a tiny, inexpensive ($30 or $40, depending on the model), project-friendly Linux computer that came out in early 2013.

Adafruit has an excellent tutorial on setting up a Raspberry Pi to play classic arcade games, written by Phillip Burgess. It leads you through setting up a RasPi from scratch, installing a MAME (Multi Arcade Machine Emulator), and getting arcade buttons to work.

I modified the button wiring plan to suit the Asteroids controls. The buttons are wired to the RasPi like this:

Raspberry Pi pin, Asteroids function
#17, Hyper-Space
MOSI (GPIO 10), Thrust
MISO (GPIO 9), Right
#23, Fire
#24, insert coin
#25 (GPIO 25), Left
#4 (GPIO 4), Two Players
CE1 (GPIO 7), One Player
GND, ground rail

And I changed the appropriate lines of the “retrogame” utility code to this:

struct {
        int pin;
        int key;
} io[] = {
//        Input    Output (from /usr/include/linux/input.h)

        {  17,      KEY_SPACE     },
        {  10,      KEY_LEFTALT     },
        {  9,      KEY_RIGHT     },
        {  23,      KEY_LEFTCTRL     },
        {  24,      KEY_5     },
        {  25,      KEY_LEFT     },
        {  4,      KEY_2     },
        {  7,      KEY_1     }
};

Instructions for doing this are in the tutorial.

At some point I might add two more internal switches to trigger KEY_ESC and KEY_ENTER, to quit and shutdown (using an alias/shortcut) with just the controller.

I had a bit of trouble getting the MAME ROM (game file) to work. In the end, I had to unzip the Asteroids Rev. 2 folder, change the file extensions so the names matched the missing file names that the MAME asked for, re-compress the folder, and put that zipped file into the roms folder on the RasPi. The MAME complains that two of the files are funky, but it seems to run fine.

Finally, once everything was working, I set the RasPi to boot directly into Mame4All when it’s turned on. Instructions are here. Since everything is stored on a cheap SD card, I have one dedicated to Asteroids.

Hello World, Goodbye Asteroid

It works!

I mainly built this to learn some new tools. Maybe next I’ll learn Python and write a new game for five buttons, or maybe I’ll use it to run live visuals.

As for now, it’s time to break out a projector and throw a rooftop Asteroids party.

For more Asteroids love, check out AtariAsteroids.net. (I run the site. Like I said, I’m a fan).

Atari Asteroids Controller: Backstory

Years ago, I picked up scrapped parts from a 1979 Atari Asteroids arcade machine: a metal control panel, original buttons, and a screen-printed marquee — and then set out to wire them up to control Asteroids on a computer.

01_console_top

The buttons are the trick. They’re just a simple electrical circuit, two contacts pressed together, which need some way to speak in ones and zeroes to the computer. The simplest approach is with a keyboard encoder, so the computer will see button presses as standard keystrokes (as opposed to running additional software to interpret the signals).

In the spirit of hacking together spare parts, I ripped the circuit board (encoder) out of an old Apple Pro Keyboard, and wired it up to the arcade buttons. The keyboard is set up in a 12 x 20 matrix, where combinations of circuits create the different keystrokes. I labeled the contacts on the left “A” through “L,” and contacts on the right “1” through “20,” and with the USB end plugged into a computer, started touching all combinations of the contacts with a wire. Here’s what I came up with:

apple_pro_keyboard_matrix
Click here for a tab-delineated text (right-click or alt-click to download).

04_kbd_hack_finished

I mounted the final version on plywood. Dowel rods held the contacts in place, although an X-Acto knife and some flux improved the solder points later on.

On the computer end of things, I downloaded MAME (arcade machine emulator) and the ROM (software image of the arcade game’s data files) for Asteroids. The Asteroids control panel worked like a charm.

A month later, I bought a commercial keyboard encoder from Hagstrom Electronics, knowing that I’d want to be able to wire up contacts for other purposes like triggering video playback. Here’s the final version of the Asteroids controller, using the Hagstrom encoder with breakout board:

02_console_finished_under

I didn’t end up using it that much, partly because Asteroids just isn’t the same without a real vector display, and partly because the metal panel is kind of huge and awkward. I also started using more programmable or pre-built options (Arduinos, MIDI controllers) for my I/O needs.

That said, it was a good first project to learn about controllers. Years later, I made a smaller, self-contained, desktop-friendly Asteroids panel — read on to learn more.

(A nod and thanks to Machine Project in LA, whose workshop on building homebrew arcade machines offered valuable info. Also in SoCal is Vintage Arcade Superstore, with a warehouse full of old arcade parts.)

Upgraded LES Mount

projectormount

projectormount-spacer

I call this my Lower East Side rig: cheap to build and quick to install, perfect for a quick load-in and load-out. The old one was getting pretty beaten up, so version 2 is made of oak and has built-in aluminum spacers on the projector side. (I was balancing washers before).

The hardware is a baby wall plate and C-stand in this picture, although I use a mafer clamp for grabbing onto beams, shelves and pipes. There’s also an eye-bolt and safety cable.

Take a look at the original LES rig and some other VJ stuff.

Soldering Tools

A friend just asked about soldering equipment. Adafruit has an excellent starter’s guide that includes explanations and soldering how-to, but I thought I’d also share a list of what’s in my kit. (Links will open in a new window).

SOLDERING IRON – I have a Weller WLC100 soldering iron/station, with a conical tip (it comes with a flat tip). This is a 40-Watt iron that plugs into an adjustable base, and sells for around $50. A step up would be the Weller WES-51 (more like $128), although for occasional work you could do with something like the 30W iron that Adafruit sells for $22. Temperature regulation is nice, and a fine tip is key.

SOLDERING STAND – Irons with a separate temperature control like the Wellers I mentioned have holders for hot irons built in. If you get an iron without a base, be sure to buy a stand.

BRASS SPONGE – I’ve never used a wet sponge to keep the iron clean. A brass sponge is like steel wool. Jab the tip into it while soldering to prevent build-up.

HELPING THIRD HAND – Essential for holding the things you’re soldering.

FLUSH CUTTERS – tiny snips for cutting wire or leads after you’ve soldered them through a PCB.

WIRE STRIPPER – For stripping and cutting wire. The standard/nice one has holes for different wire gauges, although I prefer the simpler one that relies on finesse to not destroy the wire.

SOLDERING WICK – Useful for desoldering parts from a PCB.

SOLDER SUCKER – Vacuums up a big blob of solder.

FUME EXTRACTOR – I don’t have one of these, although it would be nice. I use a fan and window to keep from breathing fumes.

DIGITAL MULTIMETER – Most useful in the mode that goes “beep,” to make sure that connections you want are connected, and ones that you don’t aren’t.

SOLDER – There are unleaded versions, but a good leaded blend with rosin core does it right. 0.031″ gauge is good for general work.

HOOK-UP WIRE – 22 gauge wire is standard for making connections between parts. There are two kinds: solid and stranded. Solid is easier to thread through holes and keeps its shape, useful for making jumpers on a breadboard or PCB. Stranded is more flexible and good for longer runs. You usually want to twist the end and “tin” it with solder. I have both kinds on hand.

SAFETY GOGGLES – I grabbed some from the hardware store. Tinning and snipping sometimes makes lead and sharp metal fly.

Other basics include SMALL SCREWDRIVERS, NEEDLE-NOSED PLIERS, and ELECTRICAL TAPE.

There are other things like spacers and standoffs, screws, headers, power sockets, resistors, a hot glue gun, calipers, etc. that are good to have around, although it all depends on how much you do.

To make things easier, electronics websites have kits with most of what you’d need to start, like this from Adafruit.

Here’s a list of electronics RESOURCES:
Adafruithttp://www.adafruit.com/ – My favorite electronics supplier and community hub. They design products and offer tutorials and support.
Sparkfunhttps://www.sparkfun.com/ – Another DIY supplier, with big inventory.
Jamecohttp://www.jameco.com/ – A giant supplier of electronics parts and tools.
Digikeyhttp://www.digikey.com/ – Another giant supplier of electronics parts and tools. I’ve only dealt with them once, but they had incredible customer service.
Pololuhttp://www.pololu.com/ – Seems to be the place to go for motors.

And while I’m at it, here are a few more resources I’ve used:
Make Magazine
O’Reilly Media (tech books)
Machine Project (LA)
NYC Resistor (NY)