December 2007 Archives

Physical Computing - Final

| | Comments (1) | TrackBacks (0)
Abstract: The intent of this project is to provide color and possibly motion to a sculpture in a way that feels natural, intuitive, and fun for the user. 

Sculpture Design

 Dangling sculpture

    This is what it looked like when Alberto and I were just playing around.

The original idea was a suspended structure hanging from the ceiling, but a hexagonal mesh that could contract and expand. The balls were lit with LEDs in the original design, but they didn't change. Then I remembered a talk I read (in slides) from Sketching '07. Tod Kurt wrote about (and had prototypes of) a smart LED. Suddenly, with these LEDs, there was a way to add fluidity to an overhead structure. I wrote to him, and he gave me a great number of references, but he couldn't give me the exact code, as he'll be selling the BlinkM as a product soon. See the BlinkM

Software Design

This meant that Alberto and I had to start coding our own version. From Tod's flickr set related to his blinkM, we saw that he had a attiny45. One quick look at the Datasheet told us that because of its 3 hardware PWM's, it was ideal. We didn't have any AtTiny45's on hand, but we had an AtTiny13, and no experience with microcontroller development (outside of arduino). We had an Attiny13, and an Atmel AVRDragon board, as well as the AVRISPMKII's in the equipment room. We definitely broke my AvrDragon during the project, and I'm not sure how. The tiny13 didn't have any hardware PWM, so we used a pre-posted software-pwm code and cycled through the colors to see what software could do (courtesy of Tod Kurt and a few register modifications). The result is that I think software PWM is a bad idea. It looks very jittery.

The tiny45 code:
Here is the code that was on the attiny45. The address portion is clearly marked so that it can be changed. It uses a GNU two-wire library to access the I2C hardware in the chip.
link

Here is the code that was on the arduino:
link
It's basically a pass-through from Processing to the I2C space. Thanks to Rob Faludi for his suggestion of the start byte!

The processing code is right here:
link
It requires a camera, and the JMyron library to operate, and you should comment out the serial code if you'd like to just run it on your laptop, as I did when i was debugging.

Hardware Design

This is the hardware design we ended up sending to the goldphoenix PCB manufacturing facility. The ribbon cable connector holes are in the center so that the board is balanced.
board.png
And this is what the solder mask looked like from the gerbers. (Viewed using Gerbv for linux). Note the fact that things appear inversed. The board came out fine, despite the soldermask looking inverted in this view. That was a big leap of faith.
 gerbv.png

    So we got the boards back, and populated them, and the first iteration had 5 greenwires (each). This is because when we were prototyping, we were using an attiny13, and a common anode LED. This project has forever embedded the definition of cathode and anode in my brain. The Attiny13 the same number of legs, but a few quirks, such as pins 1 and 8 should be pulled high, and it needs diodes on the LED legs in order to be programmed. This is apparently the same reason the Arduino has diodes: because the atmega168 has the same diode quirk. When I fix the eagle files to match the Attiny45, I'll post the eagle schematic and boards.

Controller Boards and I2C

Enter the most difficult phase of this project: the 4 line bus. We designed this project with a ICSP connector that looks something like the left half of this:

   
    This was incredibly handy for programming. We really only had to break out 6 pins for programming our microcontroller boards. Atmel AVR chips only require 6 pins to program. The neat part, is that our green LED pin shared one of the programming pins, so a successful programming routine could be seen immediately by a bright green flashing light. We had to connect 40 of these tiny boards for our final project.

So we made connector boards:
 spoon pacman

They didn't all have a spoon on them. Some had a bus, or a boot, or a pacman on them. That was for organizational purposes, because in the heat of the build process, Alberto and I were more likely to remember "oh, the ghost is bad" than, "oh, 8 is bad". Coincidentally, I remember the spoon had some broken connector pins. The bullseye was the "in" connector and the circle was the "out" connector. On top of the structure, this is what the cables looked like:
 wide connectors
connectors side
The masking tape flaps had the hex addresses of each connector on them.

The Testing Phase
This is where the prettiest pictures came from.
 balls on table
ontable, splayed
table, under
table pretty1
table pretty2
table test1
computer testing

The image on the laptop is the camera's eye view of under the structure. We used the camera to add interactivity to the structure through motion tracking. Motion underneath the structure was mapped back to the structure's x-y data, and colors changed based on motion underneath the structure. (video soon). bigblue

The Final Product

You may notice that some of them are different colors. When the camera detected motion, the balls went from blue to green, and then cycled through their hues back to blue, providing a wake behind the user. finishedworking2
finishedworking1
finishedworking

References:
Leah Buechley's tutorial on Intel Mac AVR programming toolchain setup
 using the TWI Module as an I2C Slave
using the TWI Module as an I2C Master
board design/function modeled after the BlinkM from ThingM
flickr photostream about the blinkM
Tod E. Kurt's post about software PWM in smart LED's
Smart LED device idea comes from Tod E. Kurt's talk on "Things at ThingM" as well as his Sketching '07 talk.
Julian Bleecker on TWI and I2C using the Arduino
Atmel application note on low-jitter software PWM
Clay Shirky's hardware PWM in Arduino example
Arduino's 2Wire Library
I2C Slave on an ATTiny45 thread on AVRFreaks.net
Evil Mad Scientist AVR Pinout
Specifically any posts by Don Blake or Dan Gates
Special thanks to Tod E. Kurt of ThingM for pointing us in the right direction! Also, thanks to Tom Igoe and the physical computing residents at ITP for their guidance.

About this Archive

This page is an archive of entries from December 2007 listed from newest to oldest.

November 2007 is the previous archive.

January 2008 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.1