Category Archives: PhysComp

PhysComp midterm project, week 2: Rough prototype, sexed up

Our project is now all dressed up, NYC-style:

The black box: closed

Diego and/or Filippo cut all the squares out of black foamcore and set two of the infrared sensors into the sides. Then, when I rolled in after dinner, I taped the pieces together into a flat pattern and made velcro hinges to pull it together into a box:

The black box: interior

And then—my crowning achievement of the day—I devised a neat little latch for it.

The black box: closed latch

While Diego and Filippo were figuring out more deluxe ways to use Minim than what I had hashed together the day before, I set about making my breadboard setup a little more robust, so that it could stand being sloshed around a bit in the box. Because the wires that came with the IR sensors are multistranded and very fine, they’re difficult to poke into the holes in a breadboard, and then they don’t want to stay in once they’re there. So it seemed to me that they ought to be soldered to header pins, as shown in the soldering lab.

This is, of course, much more difficult than it looks—for me, at least. I present to you what I believe to be my ugliest soldering job yet:

Another bang-up soldering job

Hideous. Pathetic. Heartbreaking.

But soldered they were, and they were, in fact, slightly easier to plug into the breadboard. Once I, you know, straightened the pins out with pliers.

How are you supposed to do this? Is there some trick to soldering multistrand wire to a header pin? Was I just doing it all wrong, wrong, wrong? Is it a mess because (a) I can’t see in the shitty light of the lab, and (b) I can’t hold my hands steady? I hate this. Help!

PhysComp, week 6: Bride of Serial Out

This week’s lab was mostly uneventful, although it took me something like six hours to do—I started after our CommLab make-up class ended, around 4 pm, and stayed until nine or ten.

First I thought I’d use one of these nifty sensors I got from SparkFun,

PComp lab, week 5: Serial Out

but then I realized I have no idea how you’re supposed to hook them up. Stick the pins straight into the breadboard? Solder wires on? How long should the wires be? So instead I used the stupid knob again, plus one of the IRs I bought for our midterm project.

The thrill of the knob has totally worn off. Then I saw Jorge soldering wires to an ultrasonic range finder just like the one I have, and I thought maybe it was a good time to try out my own. Ha! Thus began one of my more frustrating soldering bouts so far.

Helping hands

It must have taken me forty-five minutes to solder three freaking wires onto this cookie . . . and then it took me another hour to realize that the reason it wasn’t working was that I’d soldered the yellow wire to the wrong hole. And then I couldn’t get it unsoldered to save my life, so I just attached a fourth wire.

Finally I got them all hooked up:

1 digital + 2 analog

And then, there was serial output:

Et cetera.

After all that hair-pulling, the ultrasonic sensor was giving me really erratic readings (then again, so was the push-button switch: its value didn't change when I pushed the button, but it did when I touched the button). So I switched to two IR sensors, since I had so many lying around.

Then I got to the part about the handshake. Handshaking? Was not happening for me. I think it may have had something to do with this:

PhysComp homework, week 6: serial out 2: 15 PhysComp homework, week 6: serial out 2: 16

The Processing application was looking for the word "hello," but the Arduino didn't seem to be able to say the word without stuttering horribly. I tried for more than an hour, I think, to get them to talk to each other, but finally I had to just give up.

PhysComp midterm project, week 2: Rough prototype

A semi-working prototype!

Part 2 in the saga that began last week.

After spending about an hour playing with the Minim library in Processing, I went into the lab to see if I could get it to work with actual input from our IR sensors. This was basically a repeat of this week’s homework, which I’d done, for once, before the morning it was due, so the wiring part was uncharacteristically easy. I need to get some header pins, though; the stranded wire on the IR sensors is a pain to plug into a breadboard.

So our project—which I realize I didn’t explain last week—is going to be a cubeoid musical (or, at least, noisy) instrument with an infrared sensor set into each side, mounted corner-up (as demonstrated by Diego) on a camera tripod. One or more players can then use their hands or other body parts or utensils or pets to trigger different sounds from each side. We were thinking that for Phase One, i.e., this week, we’d have the sounds be synthesized tones, and that for Phase Two, the final version, we’d make it play various different loops.

It turned out, however, that it’s far easier—for me, at least—to get Minim to play loops than to synthesize sounds. And there are a lot of free sound clips out there in the world. I got mine from CanadianMusicArtists.com. This pre-prototype, therefore, has only two sensors, both of which trigger audio loops. It also has the beginnings of a lame-ass bouncing ball animation, but it doesn’t do what I want it to do, mostly because the signal’s changing too rapidly. Graphics were a tentative feature for Phase Two, so I’m not going to fuss with that part any more this week.

Here’s some crappy video of Filippo (left) and Diego (right) making the sensors generate noise. You can barely hear it, unfortunately—listen for the annoying rapid clicking sound, which I think is the hi-hat sound.

The beauty part? This doubles as my ICM homework.

Here’s the Arduino code:

/* Reads data from two analog sensors (IR sensors, in this specific example)
and outputs the values in a format that can be easily parsed in Processing.
*/

int ledPin = 7;
int irSensor0 = 0;
int irSensor1 = 1;
int sensorValue = 0;

void setup()
{
// Flash the LED three times to announce the start of program.
pinMode( 7, OUTPUT );
digitalWrite( 7, LOW );
delay( 300 );
digitalWrite( 7, HIGH );
delay( 300 );
digitalWrite( 7, LOW );
delay( 300 );
digitalWrite( 7, HIGH );
delay( 300 );
digitalWrite( 7, LOW );
delay( 300 );
digitalWrite( 7, HIGH );
delay( 300 );
digitalWrite( 7, LOW );

// Start serial port at 9600 bps:
Serial.begin( 9600 );
}

void loop()
{
if (Serial.available() > 0)
{
// Read the first (0) sensor:
sensorValue = analogRead( irSensor1 );

// print the results:
Serial.print( sensorValue, DEC );
Serial.print( "\t" );

// read the second (1) sensor:
sensorValue = analogRead( irSensor0 );
// print the results:
Serial.println( sensorValue, DEC );

// Follow the last sensor value with a println() so that
// each set of four readings prints on a line by itself:
Serial.println( sensorValue, DEC );
// delay ( 100 );
}
}

And here’s the Processing code, where most of the excitement takes place.

Midterm project, week 1: Observation

First, Diego, Filippo, and I met to talk about what we thought our project was going to be, how we would actually implement the idea, and what materials and research we’d need to do to get there.

Diego checking out the vintage iPod box I brought in as a visual aid for the shape of our thing:
P1000151.JPG

I’m not sure what else we might have observed that would be truly relevant in the development of a gadget that doesn’t serve any real purpose, but we observed whatever we could think of.

What I think is significant about the cat thing is that it’s proof that, really, anyone can play a theremin. You don’t have to be human, you don’t need opposable thumbs, you don’t have to know anything about electricity or traditional musical instrument interfaces (though there is evidence that animals know more about electromagnetic fields that humans do, in some ways).

Filippo showing the Jon Spencer video:
P1000153.JPG

The Jon Spencer video shows us a similar thing, but also introduces theatricality to the mix. Anyone, even a nonhuman, can play a theremin or thereminic instrument, but if you are a human and you have a sense of whimsy, you can play that instrument in a much greater variety of ways. Spencer shows that you can play a theremin with any part of your body. Probably the only other instrument that can boast such versatility is the drum, but even that is mostly theoretical. Yes, sure, you can strike a drum with your nose, but it’s going to hurt, so most people probably don’t do it. Playing a theremin with your nose is harmless, however. There is no penalty for eccentricity, except that if you flail around too much, you might stray out of the sensors’ range.

The loopqoob is also versatile—you don’t have to have fingers, necessarily, but they certainly help. Ditto for eyes—the markings on the loopqoob help you tell the sides apart, but do they really hint at what revealing each side does? No. Those patterns on the side probably respresent something, but the metaphors are not obvious.

And then, we observed actual, live humans using the IR-sensing thingummy on Diego’s Groovebox. Here’s Diego setting it up:

and here are various people trying to make sense of it.

Mostly, we learned that people like playing with IR sensors. But I think it’d be more interesting to be able to play one of these things with someone else—to introduce some more variety to the mix.

PhysComp, week 5: Serial Out

I was trying to figure out the math to make part of the graph show up as brown—i.e., earth—and then scatter flowers on top, but something wasn’t working out and I was running late, so I gave up.

Anyway, here are the progress shots:

Setup:
P1000190.JPG

Pot hooked up:
P1000199.JPG

Blinking LED:
P1000204.JPG

I also shot a fascinating movie of the program loading on the Arduino and starting up—you know, flickering yellow light, then blinking LED; hot stuff:

Final code on Arduino:

int potPin = 0;
int potValue = 0;
int ledPin = 2;

void setup()
{
// flash LED three times to announce start of program
pinMode( 2, OUTPUT );
digitalWrite( 2, LOW );
delay( 500 );
digitalWrite( 2, HIGH );
delay( 500 );
digitalWrite( 2, LOW );
delay( 500 );
digitalWrite( 2, HIGH );
delay( 500 );
digitalWrite( 2, LOW );
delay( 500 );
digitalWrite( 2, HIGH );
delay( 500 );
digitalWrite( 2, LOW );
delay( 500 );
digitalWrite( 2, HIGH );

// start serial port at 9600 bps:
Serial.begin( 9600 );
}

void loop()
{
// read analog input, divide by 4 to fit it in the range 0-255:
potValue = analogRead( potPin );
potValue = potValue / 4;
Serial.print( potValue, BYTE );
// pause for 10 milliseconds:
delay( 10 );
}

Final Processing applet

Servo

Two birds, one stone:

Sorry about the wobbles.

This is my video journal of the Servo lab for PhysComp, filmed for CommLab on a Sanyo Xacti 6MP digital movie camera.

I tried to edit this within the Xacti, but I ended up joining the clips together in the wrong order. It was way too much work to separate them again—it’s just a lousy way to edit—so then I dumped the mess into iMovie HD (an older version, recommended by Bre Pettis in his very fine Getting Started in Video series), recut and rearranged it, and added title frames from Photoshop (too bad they look like crap after compression) and CC-licensed music by the excellent Kristin Hersh. This was my first time using iMovie; I found it reasonably intuitive.

So, basically, it’s just the worst video for a Kristin Hersh song ever. Rock on.

PhysComp lab, week 3: Electronics

This week’s PhysComp lab looked pretty straightforward, but that’s only if you don’t take into account my singular gift for turning LEDs backward and mixing up power and ground on the breadboard.*

So, first, there was the obligatory soldering. It wasn’t quite so bad this time, I think, though I did manage to melt some of the plastic inside the jack.

Soldering the DC power jack

Then I had a lot of puzzlement over the high voltage readings I was getting. And there was a burning smell, even though I’d turned off the soldering iron ten minutes before. Hmm. Could there be something wrong with the—

Ice used after I made the mistake of touching the voltage regulator

Handy Tip: Voltage regulators get really fucking hot. Don’t touch them.

Finally, I found the wire that was going into ground instead of power and got the desired voltage reading. Then, I added a switch and an LED.

Breadboard with power jack, voltage regulator, push-button switch, and LED

And, again, wired the switch into ground instead of power. Got that sorted, and—

Pressing the switch to light the LED

Ta da!

The next step, putting two LEDs in series, went fine (with voltage readings of 2.11 for the red LED and 2.88 for the green), but when the instructions said to add a third . . . well, I’m not sure how you add a third LED in series. Is it like this—

How do you put three LEDs in series?

Probably not, since that wiring scheme works, while the instructions imply that adding a third LED makes them all go out. Comparing my voltage numbers here would probably tell me the answer to this question, but although I took lots of photos to record the multimeter readings, I can’t remember which reading was from which part of the circuit or taken at which step. Sigh. I should have just written them down.

Setting the LEDs in parallel was also pretty easy, but measuring the amperage across them was simply not happening. I tried it every which way, but I couldn’t get the circuit closed with the multimeter as part of it. After trying several interpretations of the written instructions and circuit diagram, I gave up and moved on to the pot part.

Breadboard with potentiometer and LED

Again, no problem wiring it. The voltage readings were 1.78 at about halfway and 2.89 at full blast.

This lab took me about four hours, sadly.

* The reason for the latter, in my defense, is that the breadboard in my kit has ground on the outside rows, while the breadboard in all the photos within the instructions has power on the outside. I always forget to check the color of the row, matching only the position. And sometimes I’m just not paying attention.

I, Spy

I-Spy books

On Sunday, Diego, Juri, David, and I slogged around Park Slope in the heat, snapping photos of strangers and writing notes about them, à la Harriet the Spy. The assignment was to

take a one-hour hour walk or ride around the city. Try to travel as far as you can from your start and get back in an hour, this will give more variety. Take note of every time you see a person using a digital device. This could be anything from buying and using a Metrocard on the subway to playing video games in an arcade to making cell phone calls to using an ATM to swiping an ID at the gym. With each action you note, take note of:

* location and time of day
* apparent intent of the actor
* time taken for the action
* number of people involved
* motor skills needed (hands, legs, seeing, hearing, etc)

Collect your notes on your blog. Do this in pairs, with one person observing and the other keeping notes. Alternate roles as well.

My data

Observation photos by Juri

Because there were four of us, the taking turns part was a bit chaotic. Most of the time, whenever anyone spotted a new subject, they’d call it out and we’d all start scribbling or photographing (I didn’t bring a camera, because mine is big and obvious), though there was one point when Diego told me he’d take notes for a while, as he’d mostly been photographing people. We spent almost the entire hour walking, so it was hard to get a sense of the time taken for most of the actions we observed, especially as most of those were cell phone calls or iPod usage that started and ended outside our view. There was one guy whom we walked behind for several minutes, and while everyone else went into a shop to poke around, I waited on the sidewalk and saw a couple of people who had ongoing calls.

The lack of variety was kind of surprising, but it had a lot to do with where we were. There was no subway along our route, and no buses arrived while we stood near any bus stops, so we didn’t see any Metrocard use. And in some spots where there was a lot going on, we’d focus on different people, so, for example, David and Juri observed some people using ATMs, while Diego and I were facing the other way. We had to go out of our way to see a coffee shop with people working on laptops, and though we saw several people carrying cameras, I spotted only one person using one (besides us, of course). I was also surprised to see only one person apparently using his cell phone as a timepiece, especially since I was pulling mine out every two minutes for that purpose.

Nearly everyone we observed was solo. Nineteen out of the thirty-six people whose actions I recorded were using cell phones, apparently to communicate with someone else (though you never know, with all the stuff you can do through your phone now). Fourteen of those were walking or bike riding while doing so. All but one person held his or her phone in hand; of the two people I saw using hands-free phone mics (one of whom is not on the list, because it was after we’d officially stopped stalking people), one still had to use his hand to hold the mic close enough to his mouth that he could be heard. Most people who didn’t have iPhones had flip phones, which require a fair amount of dexterity to use.

One thing we didn’t make note of was people using digital tools within cars. For one thing, it’s hard to see into a car. For another, it’s safe to assume that any car made in the last fifteen years has something digital in it, so probably every car we saw was eligible. I would have liked to see a driver using that system that helps you back up without hitting anything—a gadget I became aware of for the first time in July, when I rode in my brother’s ginormous SUV—but there are very few parking spot in Park Slope, so finding anyone trying to parallel park would have required much more time walking around in the blazing heat.

My impression was that not only were most of the people we saw using technology walking while doing so, but also that most of the people we saw walking were using technology while doing so. It might have been useful to count the number of people not using digital devices, for comparison. Then again, we were having enough trouble keeping up, as it was.

I-Spy photo: I-SPY books by Leo Reynolds / LeoL30; some rights reserved. All other photos by Juri Imamura.