Chording glove prototype pics

Jul 04, 2009 13:17

First off, my apologies for the lousy picture quality. We have a really good camera, thanks to foxgrrl, but I am a terrible photographer who cannot hold a camera steady one-handed to save her life. Also, unfortunately there are no macro shots, because either we don't have a suitable lens for it or I don't know how to use our existing lenses properly (the latter is far more likely). But these should get the picture (har!) across.

So, how does this thing work?




This is the circuit, all breadboarded out. Major components of the circuit are labeled -- which is basically all of them, it's not that complicated of a circuit. The whole thing is basically a USB keyboard with only seven buttons. It both talks to the computer and is powered via USB thanks to the connector over there on the right. (The production model will use a mini-USB connector.) Those four skinny red wires (thanks, wire-wrap tool!) are connected to four pins sticking out of the board, marked "Headers for USB"; the outer two are +5V and ground, the inner two are the data lines. Below and to the right of that, you'll see a couple of resistors, capacitors, and diodes. (There are actually two diodes but only one is visible.) The diodes make sure that current over the data lines only runs over the data lines (think of them as valves to hot and ground that are always turned off), and the resistors and capacitors clean up the signal going to and from the microcontroller.

The long green and yellow wires carry data to and from the microcontroller. I'll get to that long orange wire in a minute.

The microcontroller itself is an Atmel ATMega8. It's an 8-bit microcontroller with 8 kilobytes of onboard storage -- Flash, like a card for a digital camera -- and 1 kilobyte of RAM. The silver can labeled "Timing crystal" dictates the speed at which the processor runs, which is 12 MHz, or over 100 times slower than the 1.66GHz Intel Atom processor in my laptop. You can kind of think of it as the moral equivalent of a faster Apple II with less RAM, although if I needed more RAM, I could do what Woz did and add external RAM chips. (I don't, though, because the program the microcontroller is running is very small.)

Okay, so what program is the microcontroller running? Well, for that we have to look at the switches. This is actually breadboarded-circuit version 2: the twisted red-and-black wires running off the board go to the switches on the glove itself, but when I first breadboarded it up, they just went to the seven black-and-silver pushbutton switches on the board. (Those still work, and it will work without them, I was just lazy and didn't take them off.) The orange and red wires in the background, as well as the orange wire in the foreground, each connect one input pin on the microcontroller to one switch apiece. (So I'm using 7 input lines for switches.) See the pullup resistor and the ground for the pinky switch? (The ground is half-covered by the arrow, sorry about that. It's a little red wire.) Normally, the output of that switch is +5V, because the pullup resistor pins it there. (For microcontrollers like these, "pin X is off" corresponds to "high or floating voltage detected at pin X". The pullup resistors aren't strictly necessary, but they help prevent spurious input from voltage fluctuation by keeping that voltage pegged at +5V.) When the switch is pressed, the output drops to 0V because closing the switch closes the circuit to ground. Meanwhile, over at the microcontroller, the input pin that the switch is connected to detects that the input voltage has gone to 0, and the code on the uC handles the input signal appropriately.

So, the program running on the microcontroller simply listens for input signals and combinations of input signals, and when it receives one that it recognises (it has a table of input signal combinations and how they correspond to keyboard symbols -- ASCII characters, cursor movement, whatever), it sends a signal for the correct keyboard symbol over the data lines to the USB connector, which sends that signal on to the computer, which processes it the same way it would an input from a regular old USB keyboard.

The colour-coding on the wires doesn't mean anything special with respect to the circuit, by the way. They're just standard jumper wires from a kit, and they're coded for length.

People who know their way around microcontrollers may be saying at this point "but where's the FTDI chip? The ATMega8 doesn't have onboard USB!" You're right, it doesn't -- we're handling USB in software thanks to V-USB.

Also, the one thing I forgot to label is the ISP (in-system programming) headers. Those are the little gold pins (there are six, though it's hard to tell from this angle) between the microcontroller and the pushbutton switches. With these, when the board is powered up (over USB), I can plug in my AVR-ISPmkII programming device, hook that up to my computer via USB, and flash a new program onto the microcontroller. Making this was kind of hilarious, because finding six adjacent pins on a breadboard that aren't electrically connected to each other is a little difficult. I ended up completely dismembering a 6-pin piece of angled header and jamming all six pins in backward. But hey, it worked.

By now you're probably sick of my nattering about circuits and want to see what the glove looks like in action. Here you go!




There are 7 switches total on the glove: three along the side of the index finger, which the thumb presses, and one on each fingertip, which I can drum on the table (or my leg, or my head, or a nearby wall, whatever) or press by closing my hand. Yes, they are inside the glove. You can kind of see the pins for some of them; the yarn of the glove hides them pretty well, but they're fairly mechanically secure. I'll be soldering them in place on the real glove, or possibly wire-wrapping the positive and negative poles to their unused counterparts (they're double-pole-single-throw switches, meaning that each switch has two identical outputs, but only one output is actually used in this circuit), but I'd like to use this glove again next winter.




When I need to tap one fingertip switch, I can just do it with the tip of my thumb.




The centre thumb switch (yeah, I know it's on my index finger, but the thumb actuates it) is used for a lot of key combinations. With the production version I'll probably tap my fingertip on a solid surface, but I can also press my fingertip to the palm of my hand.




Another thumb-and-fingertips combination, this one the near thumb, middle, and ring. Here, I'm pressing the near thumb switch with the inside of my thumb knuckle, though the thumb tip works too.




Finally, a three-fingertip combination, made by making a half-fist. All this hand squeezing gets a little tiring after a while, sort of like working with one of those hand exercisers. I'm going to have really strong fingers if I use this approach a lot.

Sadly, no video yet, because I don't have a suitable camera for it with me. The footage would be kind of boring anyway, because I'm not very good with it yet -- the one-sentence post I typed took a good ten minutes, easily -- and I screwed up with the leads and didn't give myself a lot of room to maneuver. The next step of this project is to move the circuitry into a pair of 28-pin wirewrap sockets which I can attach to the wrist of the glove, and then it will be a lot easier to move around. I expect I'll have my camera that does video back by then, so I'll take some action vids when that happens.

This post brought to you by free software. No, really. Image editing was done on my EeePC running Ubuntu Netbook Remix, using F-Spot and UFRaw for importing and colour correction, and The Gimp for annotation and resizing. And, of course, the SpiffChorder design is itself free-as-in-speech and free-as-in-beer.

microcontrollers, chording glove, hacking, stuff i made, you did what?, circuits, hardware

Previous post Next post
Up