Friday, September 4, 2009

Hackerspaces - a way for computers and the people who love them to get out more often

An unfortunate stereotype of members of the Geek Kingdom is that they are introverted and anti-social. There's an old joke:
Q: How can you tell if a programmer is extroverted?
A: He looks at your shoes instead of his when he talks to you.
(I didn't say it was funny). The truth is that while Geeks do appreciate being left alone occasionally to focus on a problem or a project they're working on, they are often social animals, not unlike people in general. They go to conferences, they collaborate on Open Source projects, they go to events like Bloomington's ongoing Geek Dinners or user group meetings. In a college town like Bloomington (yes students, we townies do appreciate you) there are an abundance of opportunities to get out and mix it up.

For all the 'we live in a new era' wonder of computers and the internet, they live in a somewhat insular world. Sure, data travels around the globe via TCP/IP, HTTP, etc, but for many their interaction with the world outside is limited to fingers tapping on their keyboard or perhaps a temperature sensor to make sure they don't melt down. I believe Macbooks have light sensors, too. But the fact remains: for most of the computers we see and interact with day-to-day (I'm not talking about all the more-or-less hidden microcontrollers all around us), there's no meaningful direct interaction with the outside, sun shining, birds singing, the plants need watering world.

There's a nice illustration in the book Physical Computing that shows how your computer sees you:

Physical Computing is about giving computers (often really tiny inexpensive ones, aka microcontrollers) sensors to allow them to take in their environment, and sometimes motors or other physical/mechanical devices so they can move around or change their environment (as with the plant watering).

A new place in town for like-minded creative types with interests in Physical Computing, electronics, and creative activities in general is the Bloomington Hackerspace (really cool name like NYCResistor or more serviceable name like HackDC to follow). Hackerspaces have been around for years, and as the name suggests they offer a physical (as opposed to virtual) space for hackers. Here hacker is defined as a person with an ongoing interest and aptitude for finding creative and usually not obvious uses for the objects, devices, and technological tools around them. These are NOT the let's-break-into-somebody's-system hackers. The very simple distinction: these hackers are all about creating, not destroying (although they do break things down for parts).

While not every great idea with a lot of enthusiasm behind it coalesces into a real-life implementation, things have been going very well for the Bloomington hackerspace under the capable leadership of non-official leader Nathan H. (aka dosman). After an initial meeting a couple weeks ago featuring members of the IU Robotics Club (the future of which is uncertain as at this point as pretty much none of the members are students), a space was identified (donated by member Jennette T.).

For the second meeting, we gathered in this space, which featured a worktable big enough for all of us and many breadboards and electrical components. Some of us brought our Arduinos and a guy named Will brought a MeggyJr he had built. I had heard about these hand-held, Arduino-based game consoles, but this was the first time I'd seen one. It was running a version of the classic memory game Simon, and later Will uploaded other games that one of Jennette's sons enjoyed playing.

While the gathering had a somewhat informal air, we did have a defined goal, as we were all going to get a chance to wire up an ATMega8 (AVR microcontroller) and program it to do the 'Hello World' of microcontroller programming, blinking an LED. It sounds somewhat trivial, but it ended up being interesting as we had to debug things like malfunctioning components or minor wiring errors. As somebody who's played with the Arduino, I found it interesting to take a step down from the ease-of-use and accessibility of working with the Arduino.

Arduino programming works like this:
  1. Write your program using Wiring, a very nice IDE based on the very accessible Processing environment used for Visualization and graphics. (Actually the sketch is available as an Example).
  2. (Optional) put the long pin from your LED in the designated output pin, and the short one in ground (usually there'd be a resistor in the mix, but the Arduino's got that covered. Also there's an LED built in, so even this is optional).
  3. Plug a USB cable into your computer, and the other end into the socket on the Arduino.
  4. Upload the sketch.
  5. Admire the blinky light.
Programming the ATMega8 is a bit more involved:
  1. Grab your breadboard, a 5 Volt Regulator, a power supply, a header for the programmer, the programmer, an LED, lots of wires, and of course, the microcontroller.
  2. Wire up the regulator to your power supply so you have a nice steady 5V.
  3. Look up and print out or draw the pin diagram for the ATMega8. Here it is:
  4. determine which pins from the ATMega8 connect to which pins on the header, and wire it up.
  5. Don't forget the LED.
  6. On your computer, set up avr-gcc and avrdude
  7. Get a program for the blinky thing and preferably a Makefile. You don't necessarily have to write this one either, but you do have to locate it.
  8. Make it.
  9. Connect the header to your computer.
  10. Try to upload the code.
  11. If it fails, go back and figure out where things went wrong. A second pair of eyes often helps here.
  12. Admire the blinky light.
This is not to say programming a microcontroller is hard or inaccessible - it's not, especially in the company of helpful and more experienced people. It did make me appreciate the relative simplicity of the Arduino, but not everybody can spring for a ~$30 a shot Arduino. ATMega chips are cheap. You can potentially do a lot for a lot less money once you've jumped this hurdle (the programmers are a non-trivial initial cost, but with a group you can share resources). Also, the Arduino is more a prototyping tool, so often once you've figured something out with the Arduino, you can build a more permanent version using an ATMega chip programmer in this manner.

Having identified a space and had a successful hands-on meeting, things are really taking off for the Bloomington hackerspace. Perhaps some fantastic product or great robot will be born there, or a Jobs/Wozniak style partnership will form. Whatever happens, hackerspaces are a really great idea, Bloomington is lucky to have one, and I look forward to future meetings.

Some Resources:

Tutorial on AVR programming with pictures at the Physical Computing at ITP site.

Arduino Home Page

Sparkfun is a good source of electronics

Adafruit is a good source for kits (including the MeggyJr)