shahar @ itp

physical computing

drawingtool: the aftermath

New website!


Inverse Plotter

After a day of hard work, the physical construction is almost done. The rest is finishing touches – add the table on top, the plexiglass window, secure the Y stage properly, etc. The code is nearly ready as well. Yay


pcomp/drawing machines final – inverse plotter

My pcomp/drawing machines combined final will be is the inverse plotter (details to come). For that, I needed to build an XY table. I spent the last week messing around with scavenged parts from printers/scanners/copiers/etc., trying to figure out the mess that is the mechanics of an XY table… Yet another case of HTIL (Harder Than It Looks).

I finally got some few basic parts together and built a ghetto X stage.

It actually worked pretty well, even though the bearings were very poorly done. I got some skate bearings but no nuts, bolts, or washers. Later Igal (who’s also working on an XY table) got some and made his own bearings, which worked great. I’ll be doing the same once I get the rest of my parts.



pcomp midterm – the water is the message

For our pcomp media controller midterm, Adib, Luis, and I decided to choose water as our medium. We went through several iterations of ideas for how to control the water, and finally ended up with a piston mechanism, using a servo to control a syringe.
After a few tests we figured out the proper way to mount these beasts and Luis produced 4 units. Here they are running together off of a TLC5940 LED driver chip, which could (evidently) be used to control servos as well.

Our final plan is to have 4 servos, 4 DC motors (for creating turbulence in the water) and 12 LEDs, all triggered by 4 Sharp infrared rangefinders.


pcomp week 8 labs



pcomp week #5: observation

I am waiting in line at KMart, trying to observe how people are using the credit/debit card terminal. Most of them are used to it, and do it pretty much automatically: Wait for the cashier to finish, slide card, enter their pin and approve, sign, do a cash back (or not).

The whole thing takes less than half a minute for the experienced ones, more than twice that time for newbies. The parts people seem to be having the most difficulty with are:

  1. Deciding which way to slide the card. Even though it is indicated on the device itself, few bother looking at the instructions, or people just fail to understand it. Maybe it’s time for doubled-sided magnetic stripe readers?
  2. Realizing that you have to use a stylus to manipulate the touch screen. I have no idea why it’s like that, maybe they don’t want people to touch it with their greasy fingers? Anyhow, people tend to sometimes forget about the stylus and try using their finger (like they do with the MetroCard machines). I suppose this has something to do with the device’s affordances. There is no indication of the stylus’s role – it’s inconspicuous, pretty much merging with the outline of the device itself. Perhaps matters have become worse since the advance of touch screens in the last years.

Overall, I’d say the interaction is pretty simple (especially once you know figure out the stylus part), but has the potential to be even simpler. Some new cards already implement a wireless (RFID?) system to avoid the card-swiping issues, and it works pretty well from the little experience I had. To be fair, it’s not very easy to indicate this action clearly to the user, and although I haven’t had the chance to observe people using this kind of system, I’m sure they are often perplexed as to how they should be using it. The second obvious fix would be to drop the stylus. I suppose the reason they used it is for the signature part, that is pretty redundant in my opinion and can be dropped altogether.


pcomp week #5-6: serial duplex

For this week’s (and next week’s lab), I used a potentiometer and an FSR to control the frequency and pan of sounds generated using the minim sound library in processing.


fun with electricity

Last week I discovered the junk shelf. I found a CD player mechanism and apparently all you need to do to make it run is to hook it up to power and ground! Sounds trivial, but everyone (including me) were pretty surprised to find out it’s that simple. After reading up a little bit, I got the H-bridge working too and could control the motor’s linear movement pretty well.

H-bridge

Then I wanted to get the laser working, but couldn’t find its datasheet anywhere. My guess is that it’s just too old to be found online. I wanted to do something with it anyway, so I decided to tear the laser out and put a photoresistor in its place. Looks a little like this:

Motor and sensor front

I pushed the photoresistor through the laser socket, and insulated the wires, then hot-glued it to keep it from wiggling. Here is what looks like from the back:

Motor

Then I wrote a little program to basically make the motor go away from darkness and towards light.

const int motor1Pin = 12;    // H-bridge leg 1 (pin 2, 1A)
const int motor2Pin = 13;    // H-bridge leg 2 (pin 7, 2A)
const int sensorPin = 5;

int direction = 0;

void setup() {
  // set all the other pins you're using as outputs:
  pinMode(motor1Pin, OUTPUT);
  pinMode(motor2Pin, OUTPUT); 

  // set enablePin high so that motor can turn on:
  //    digitalWrite(enablePin, HIGH); 
  direction = random(1);
  Serial.begin(9600);
}

int lastSensorRead = 0;

void loop() {
  int thisSensorRead = analogRead(sensorPin);
  Serial.println(thisSensorRead);

  if ((thisSensorRead-thisSensorRead%10)  < (lastSensorRead-lastSensorRead%10))
  {
    direction = !direction;
    Serial.println("direction change, go back");
  }

  lastSensorRead = thisSensorRead;
  go();
  delay(200);
}

void go() {
  digitalWrite(motor1Pin, direction ? LOW : HIGH);   // set leg 1 of the H-bridge low
  digitalWrite(motor2Pin, direction ? HIGH : LOW);  // set leg 2 of the H-bridge high
}

And here’s what it looks like in action:

It’s definitely not accurate, but I think the noise gives it a more organic quality. It actually looks like it’s “afraid” of the dark, doesn’t it?

As for the LCD display that’s sitting there on the breadboard, that has nothing to do with this project. I found it on the junk shelf and was trying to make it work. I borrowed a TLC5940 but failed to make the library work. Thank god someone told me an hour later that in Arduino 0017 you have to place the libraries in a different folder! I also managed to desolder some 74HC595 shift registers off some board I found in the junk shelf. They came off pretty easily using the heat gun, though I haven’t tested to see if they still work…


pcomp week #3 – electronics lab

As promised, this week’s lab wasn’t very exciting, but I did finally understand how to use the multimeter as an kind of debugging tool. I know it’s an important tool, and in fact it already came in handy when Chika and I tried figuring out why her LEDs wouldn’t light up. After we checked the voltage across the LEDs, the resistors, and the voltage regulator, we understood something was wrong. In fact, something was very wrong – even when we changed the power supply the voltage was still way too low. Turns out the whole power supply to Chikka’s table was defective… it’s good to know these things happen.

Miscellaneous measurements and documentation from this week’s lab:
One LED: 1.88 + 2.98 (resistor) = ~5V
Two LEDs: 1.98 + 1.77 + 1.12 (resistor) = ~5V
Three LEDs: 1.69 + 1.73 + 1.55 + 0.01 (resistor) = ~5V

Current with three LEDs in series: 7.29mA
3leds1cup?

Voltage across pot + across resistor + across LED equals………. ~5V!


pcomp week #2: fantasy device

I actually had a hard time trying to think of my fantasy device. The difficulty stemmed from the fact that it had to have an interface, which meant it had to be complex enough to require one. Most of the devices I imagine don’t need an interface because they’re either one-purpose, one-button devices, or they’re just smart enough to know what I want…

Anyhow, I came up with two ideas. The first one is a biofeedback ring that monitors the state of your body, effectively providing the functionality of the dashboard in your car. It can measure, for example, your heart rate, blood pressure, sugar levels, stress hormone levels, etc… There’s no end to this, but you probably don’t need to know everything there is to know, unless you’re a doctor. When the ring detects a problem, it can notify you using the built-in LCD (or some futuristic equivalent), and also vibrate if it’s really important. You can “click” the ring to tell it to stop bothering you.
biofeedback1
If you’d like to know more, you also have a projected dashboard interface. Put your hand on the table and hold down the ring button, and it’ll project a dashboard on the surface. The interface can be manipulated by touch, using your free hand.
biofeedback2

My second fantasy device is the weather control cube. It had to be portable, easy to use, and precise. I thought of a cube you can hang from your keychain. Each of the six faces has a dial on it (why dials? just because I like them and they don’t stick out). The dials control various parameters, as you can see below. You can also just give it a shake and get randomly-chosen weather!
Weather Control Cube


pcomp week #2

This week I tried my hand at an analog circuit, first with the potentiometer:

I then replaced it with a photosensor and added a simple dynamic calibration algorithm:

You can see it working on a different range here:

Here’s the code for the thing:

int sensorPin = 0; // Analog input pin that the photosensor is attached to
int led = 9; // PWM pin that the LED is on. n.b. PWM 0 is on digital pin 9

int timeToReset = 10000;

int minValue, maxValue;
int lastSeenMax, lastSeenMin;

void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);

minValue = maxValue = analogRead(sensorPin);
lastSeenMax = lastSeenMin = millis();
}

void loop() {
int sensorValue = analogRead(sensorPin); // read the pot value

int now = millis();

if (sensorValue > maxValue || (now - lastSeenMax) > timeToReset) {
maxValue = sensorValue;
lastSeenMax = millis();
Serial.println("seen max");
}
if (sensorValue < minValue || (now - lastSeenMin) > timeToReset) {
minValue = sensorValue;
lastSeenMin = millis();
Serial.println("seen min");
}

int outValue = map(sensorValue, minValue, maxValue, 0, 255);
analogWrite(led, outValue);
delay(50); // wait 50 milliseconds before the next loop
}

You don’t see it in the videos, but I encountered a rather strange bug: after a certain (short) time, the thing would start going crazy, thinking every value is a new maximum value. At first I thought it was the milliseconds overflowing, but the manual says it should take a few weeks so that’s not that. I guess I’ll have to debug it some more in order to get to the bottom of it….


sensor walk

Is a simple button also a sensor? Is my/your/your dog’s eye (or ear, skin, nose, for that matter) a sensor? I guess they are – they all respond to stimuli and do some kind of transduction. I have to say I expected to encounter more sophisticated sensors on my walk. Other than surveillance cameras, it seems like the UES is technologically blind and deaf, for the most part.

Payphones have sensors that can detect the shape, size and weight of coins. They also have a microphone that converts vibrations to electrical current. Oh, and buttons, too.

Payphones have sensors that can detect the shape, size and weight of coins. They also have a microphone that converts acoustic waves to electrical current.


Button, microphone

Button(s) + microphone


Reads the magnetic stripe on the card?

This card lock can sense the magnetic stripe on the card


Buttons, cameras, microphones

Sensor extravaganza! Buttons, cameras, and microphones


Digital weight scale: pressure sensors

Digital weight scale: pressure sensors


Bigass camera


pcomp week #1

Extreme Physical Computing! This is actually harder than it looks – especially if no one bothers to tell you what a wire stripper looks like.


(vimeo decided to turn the video upside down. It was right side up when I uploaded it, I swear!)

So after burning a whole day mostly on wires, I finally began messing with Arduino trying to make a combination lock. Being a programmer and all, you’d think that would be trivial: All you need to do (apart from connecting a few more switches) is to capture button presses, store them, and compare them to the secret combination.

Needless to say, I failed miserably, but hey – didn’t Red say that’s what we’re here for?

Insights and observations:

  1. Button press events, please? Tried getting debounce to work but couldn’t.
  2. Arduino’s IDE is, by far, one of the worst IDEs I’ve ever had the privilege of working with (I guess that’s the price you pay for cross-compatability). Eagerly waiting for someone to tell me there’s a better way to do this.
  3. Gotta find a better way to mount switches than leaving them hanging on the wires.
  4. It’s amazing how much satisfaction one can derive from one blinking light.