Wednesday, March 23, 2011

Personal Bubble - the next iteration


We will be refining our Arm's Length Technology through our last project, these diagrams show the system.

Arm's lengthWearable technology Presentation

Last week we presented our wearable technology project, Arm's Length.  Unfortunately, the Arduino shield gave us some problems and we were not able to incorporate it into the shirt we prepared for it.


//Author: Bruce Allen
//Date: 23/07/09
//Modified by A.Lopez breadboardsareus.blogspot.com with blink light code

//Digital pin 7 for reading in the pulse width from the MaxSonar device.
//This variable is a constant because the pin will not change throughout execution of this code.
const int pwPin = 7;
//variables needed to store values
long pulse, inches, cm;

void setup() {

//This opens up a serial connection to shoot the results back to the PC console
Serial.begin(9600);
pinMode(13, OUTPUT); //attaches LED to pin 13
pinMode(12, OUTPUT); //attaches LED to pin 12
pinMode(11, OUTPUT); //attaches LED to pin 11

}

void loop() {

pinMode(pwPin, INPUT);
int val;  // variable to store pulse value

//Used to read in the pulse that is being sent by the MaxSonar device.
//Pulse Width representation with a scale factor of 147 uS per Inch.

pulse = pulseIn(pwPin, HIGH);
//147uS per inch
inches = pulse/147;
//change inches to centimetres
cm = inches * 2.54;

val = cm;

if (val < 20 && val > 1){
  Serial.println("brazil");
digitalWrite(10, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(10, LOW); // set the LED off
}


if (val < 40 && val > 20){
 Serial.println("canada");
digitalWrite(12, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(12, LOW); // set the LED off
}


if (val < 60 && val > 40){
  Serial.println("india");
digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off
}


Serial.print(inches);
Serial.print("in, ");
Serial.print(cm);
Serial.print("cm");
Serial.println();

delay(500);

}

Wednesday, March 16, 2011

Critical Making Project #3: 'Arm's Length'

Based upon the third project criteria, our group examines the question- how can we design a wearable sensemaking device which shows how different nationalities perceive interpersonal space, 'the comfort zone', and indicates when that space has been transgressed?

For our first step, our group researched the definition of interpersonal space from the Oxford Dictionary of Geography, and found the following:

The linear distance separating one individual from others—the average distance by which one person separates herself or himself from the next person. Not surprisingly, the distance is least between couples, followed by family and friends, and greatest between strangers. It has also been observed that the extent of interpersonal space varies culturally, and that Anglo-Saxons tend to be more distant from their fellows than, say, Latins.

Then we researched the statistics for interpersonal space and found the following definition from neuropsychology, which describes personal space in terms of kinds of 'near-ness' to the body:

MaxSonar
  1. Extrapersonal Space: The space that occurs outside the reach of an individual.
  2. Peripersonal Space: The space within reach of any limb of an individual. Thus to be 'within-arm's length' is to be within one's peripersonal space.
  3. Pericutaneous Space: The space just outside our bodies but which might be near to touching it. Visual-tactile perceptive fields overlap in processing this space so that, for example, an individual might see a feather as not touching their skin but still feel the inklings of being tickled when it hovers just above their hand.
  4. Personal distance, or interpersonal space, is what anthropologists and sociologists might define as the distance consistently separating members of non-contact species.
  5. But people, unlike animals, determine personal distance culturally, not genetically, and so acceptable distance varies widely from country to country.

Upon further research of intercultural definitions of space, we incorporated data from the Cultural Crossings web site, which cited the distance of peripersonal space according to nationality with Brazil at 30 cm, Canada at 60-90 cm, and India at 90 cm. We used this data to measure the length of three LEDs attached to the sleeve of an arm in ascending order of distance to indicate peripersonal space from Brazil, Canada, and India as a direct mapping of arm's length in relation to interpersonal distance.

To actuate these LEDs according to distance, we used a MaxSonar®-EZ1™ High Performance Sonar Range Finder to activate the LEDs when someone approached the subject wearing the sleeve.

Flags were placed on the sleeve to denote nationality, with their size designed to be proportionate according to peripersonal distance data, and LEDs were attached above these flags with colours coordinated to that of the flags, to be actuated by the approach of a stranger through motion input to the Sonar Range Finder.

As the psychological definition of interpersonal space 'creates and defines the social dynamics of our interactions with others', the sensemaking apparatus of our wearable computing project demonstrates through LED feedback a subject's unease and discomfort according to cultural norms.

Research:


1. http://www.answers.com/topic/interpersonal-space
2. http://dictionary.sensagent.com/personal+space/en-en/
3. http://www.shockmd.com/2009/03/27/the-neuroscience-of-interpersonal-space/
4. http://www.maxbotix.com/MaxSonar-EZ1__FAQ.html

Wednesday, March 9, 2011

Wearables Project Brainstorming

We spent the class testing out the Maxsonar High Performance Sonar Range Finder with our Arduino. We used the code for the Pulse Width in order to interface the Maxsonar with our Arduino (see code at bottom).

This led to brainstorming about wearables that release personal information using the Maxsonar range sensor. One idea that hooked our group was a personal space sensor based on cultural proclivities. Using the Cultural Crossing website we will determine the standards for personal distance based on country of residence.




Code:
//Author: Bruce Allen

//Date: 23/07/09

//Digital pin 7 for reading in the pulse width from the MaxSonar device.
//This variable is a constant because the pin will not change throughout execution of this code.
const int pwPin = 7;
//variables needed to store values
long pulse, inches, cm;

void setup() {

//This opens up a serial connection to shoot the results back to the PC console
Serial.begin(9600);

}

void loop() {

pinMode(pwPin, INPUT);

//Used to read in the pulse that is being sent by the MaxSonar device.
//Pulse Width representation with a scale factor of 147 uS per Inch.

pulse = pulseIn(pwPin, HIGH);
//147uS per inch
inches = pulse/147;
//change inches to centimetres
cm = inches * 2.54;

Serial.print(inches);
Serial.print("in, ");
Serial.print(cm);
Serial.print("cm");
Serial.println();

delay(500);

}

Thursday, March 3, 2011

We own your Waste - Physical Rights Management Recycle bin



This prototype uses an blue LED light, a servo, and an RFID reader with 4 RFID cards on the Arduino platform. The bin closes when the Reader detects the unique identifier of the RFID card attached to an object that is valuable to the city of Toronto. It can only open when it detects the ID card of a City of Toronto worker. The project comments on how ubiquitous computing could be used by the city (or private company) as a way to enforce its legal ownership of our waste. We looked at watermarking as a technique for discretely attaching information to a physical object by embedding an 'invisible' RFID tag within it. The City of Toronto legally takes ownership of our waste the moment we take it to the curb or put it in a city bin. This critical technology project makes that ownership relationship explicit.


Arduino Code:

// RFID reader ID-12 for Arduino
// Based on code by BARRAGAN
// and code from HC Gilje - http://hcgilje.wordpress.com/resources/rfid_id12_tagreader/
// Modified for Arudino by djmatic
// Modified for ID-12 and checksum by Martijn The - http://www.martijnthe.nl/
//
// Use the drawings from HC Gilje to wire up the ID-12.
// Remark: disconnect the rx serial wire to the ID-12 when uploading the sketch

//Modified by Alejandro Lopez http://www.archinteractive.net/ with Servo Sweep and Blink light codes

#include

Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created
int pos = 0; // variable to store the servo position


void setup() {
Serial.begin(9600); // connect to the serial port
myservo.attach(9); // attaches the servo on pin 9 to the servo object
pinMode(13, OUTPUT);
}

void loop () {
byte i = 0;
byte val = 0;
byte code[6];
byte checksum = 0;
byte bytesread = 0;
byte tempbyte = 0;
myservo.write(180);

if(Serial.available() > 0) {
Serial.println("ok");
digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off

if((val = Serial.read()) == 2) { // check for header
bytesread = 0;
while (bytesread < 12) { // read 10 digit code + 2 digit checksum if( Serial.available() > 0) {
val = Serial.read();
if((val == 0x0D)||(val == 0x0A)||(val == 0x03)||(val == 0x02)) { // if header or stop bytes before the 10 digit reading
break; // stop reading
}

// Do Ascii/Hex conversion:
if ((val >= '0') && (val <= '9')) { val = val - '0'; } else if ((val >= 'A') && (val <= 'F')) { val = 10 + val - 'A'; } // Every two hex-digits, add byte to code: if (bytesread & 1 == 1) { // make some space for this hex-digit by // shifting the previous hex-digit with 4 bits to the left: code[bytesread >> 1] = (val | (tempbyte << 4)); if (bytesread >> 1 != 5) { // If we're at the checksum byte,
checksum ^= code[bytesread >> 1]; // Calculate the checksum... (XOR)
};
} else {
tempbyte = val; // Store the first hex digit first...
};

bytesread++; // ready to read next digit
}
}

// Output to Serial:

if (bytesread == 12) { // if 12 digit read is complete
//Serial.print("5-byte code: ");
for (i=0; i<5; i++) { if (code[i] < 16) Serial.print("0"); Serial.print(code[i], HEX); // Serial.print(" "); } Serial.println(); //Serial.print("Checksum: "); Serial.print(code[5], DEC); int val = code[5]; Serial.println(code[5] == checksum ? " -- passed." : " -- error."); Serial.println(); if (val == 2){ Serial.println("yes bitches"); for(pos = 100; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees

{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(150); // waits 15ms for the servo to reach the position
}
}


if (val == 19){
Serial.println("yes bitches");
for(pos = 0; pos < 100; pos += 1) // goes from 0 degrees to 180 degrees

{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(150); // waits 15ms for the servo to reach the position
}
}
}

bytesread = 0;
}
}
}

Wednesday, February 2, 2011

Moral Technology


Tasked with creating a moral or amoral technology, our group generated several potential maxims. As a tool, Elizabeth proposed the use of a praxinoscope, a Victorian self-propelled animation device, to send subliminal messages through rotation. This led to a discussion concerning the type of messages the scope could convey and the moral implications of those messages.

The praxinoscope requires a 360° rotation to work as an animation device, however the Servo Motor (which we programmed to run through an Audrino) is limited to a 180° range of movement. Therefore, we decided to incorporate the servo’s ability to stop anywhere between 0° and 180°. This led our group to the story of the Russian cognitive psychologist and the peasant:
 “And let me tell you a story: the Russian cognitive psychologist, Vygotsky, who worked just after the Russian Revolution, worked with peasants, some of whom had been to the collective schools and some of whom had not. And he gave them little tests. And the basic pattern of the test was "Put together the things that go together." So he showed this peasant a hammer, a saw, a hatchet and a log of wood, and he said, "Put together the things that go together." And the peasant said, "Well, clearly, what goes together is the log of wood and the hatchet and the saw because you use the hatchet and the saw to cut the wood for firewood." And Vygotsky said—and this was his regular strategem—"I have a friend who says that the saw, the hammer and the hatchet go together because they are tools." And the peasant answered, "Then your friend must have a lot of firewood!" (Schon, 1987, para. 4).

With this story in mind, we came up with the idea for a device which would indicate the right or wrong combination of items.  We programmed the servo to stop on five items, and react to each item with a red or green light as follows:

1. A hammer / 30 degrees/ opposite colour cyan/ green LED
2. A saw/ 60 degrees/ opposite colour magenta/ red LED
3. The hatchet/ 90 degrees/opposite colour yellow/ green LED
4. Log of Wood/ 120 degrees/ opposite colour black/ red LED
5. Saw going through Wood/ 150 degrees/opposite colour white/ green LED

Our intention was to show the moral dilemma of society’s privileging of some opinions as “right” while others are considered “wrong”. If this device was to be used as a teaching tool, it would privilege the ideas those whom “have a lot of firewood” over those who must group the items in such a way to keep themselves warm. 
 
Bruno Latour views technology as delegated human activity.  As creators of technology we remove humanity from a task and replace it, in the case of our project, with a computerized device that can only indicate right or wrong answers: “If, in our societies, there are thousands of such lieutenants to which we have delegated competences, it means that what defines our social relations is, for the most part, prescribed back to us by nonhumans” (Latour, 1988, p. 310). The device we created allows us to sit back and be told the right answer.  It removes the thought process behind the question: which of these objects belong together?

Tuesday, February 1, 2011

Profiling Machine: Second Attempt

This is the second attempt at controlling an arduino with a physical analog input.
After searching for some code to hack on the interweb I found this one by Professor Nashid Nabian in an Interactive Architecture course slide.  It controls a standard servo (180 degrees) with a potentiometer (also 180 degrees).  I find the 1:1 relationship between control and output very satisfying.

The code was adapted to show 'right' and 'wrong' at discreet angles.

The next step is to build a physical setup around it (images on the dial) that correspond to the type of moral machine we're interested in.

Code:

 /*A Moral technology by Breadboards are us
this code is a modified version of
Nabian's Responsive System Input Potentiometer- Output Standard Servo-
After a failed attempt to use push buttons to send exact angles to the
servo I found this code in an old Interactive Architecture course archive,
I really enjoy the direct relationship of turning a potentiometer and turning
a servo, moreover this code by N.Nabian has the analogRead (reading from
potentiometer) and servo control in two separate pieces of code, making it
very easy to do something extra with the reading from the potentiometer. 
AL */

//connect the potentiometer as follow:
//left from ground to left pin, Center to analog input pin number 0 , right to V5
//connect the motor as follows:
//black to ground, Red to V5, yellow to digital output pin number 13
//potentiometer range is 0-1024

void setup(){
  Serial.begin(9600);
  pinMode(13,OUTPUT);  //sets servo output on pin 13
  pinMode(5,OUTPUT);  //sets a green led output to pin 5
  pinMode(6,OUTPUT);  //sets a red led output to pin 6
  pinMode(7,OUTPUT);  //sets a green led output to pin 7
  pinMode(8,OUTPUT);  //sets a red led output to pin 8
  pinMode(9,OUTPUT);  //sets a green led output to pin 9 
}
void loop(){
  int val = analogRead(0); //this part of the code reads the signal from pot
  servoPulse(13,val);
  Serial.println(val);
 
  if (val > 160 && val < 180) // if the pulse is at about 30 degrees
{digitalWrite(5,HIGH);} //turn a green led on
 else  // if it is not
 {digitalWrite(5,LOW);} //turn a green led off

  if (val > 335 && val < 347) // if the pulse is at about 60 degrees
{digitalWrite(6,HIGH);} //turn a red led on
 else  // if it is not
 {digitalWrite(6,LOW);} //turn a red led off

  if (val > 504 && val < 518) // if the pulse is at about 90 degrees
{digitalWrite(7,HIGH);} //turn a green led on
 else  // if it is not
 {digitalWrite(7,LOW);} //turn a green led off

  if (val > 675 && val < 690) // if the pulse is at about 120 degrees
{digitalWrite(8,HIGH);} //turn a red led on
 else  // if it is not
 {digitalWrite(8,LOW);} //turn a red led off

   if (val > 845 && val < 860) // if the pulse is at about 90 degrees
{digitalWrite(9,HIGH);} //turn a green led on
 else  // if it is not
 {digitalWrite(9,LOW);} //turn a green led off

 }


void servoPulse(int pin, int angle){  // this part of the code by N.Nabian
  int pulseWidth = (angle*2)+500;  //controls the servo position
  digitalWrite(13,HIGH);  //based on the pot
  delayMicroseconds(pulseWidth);
  digitalWrite(13,LOW);
  delay(20);
}


Images:

 

Profiling Machine: First Attempt

In our first discussion/brainstorm our team centered on the idea of a profiling machine.  The machine would take the form of a dial controlled by a servo that points to right or wrong answers.

The first idea was to control the servo angles using discrete push buttons.
This failed miserably.

Code:

/*A Moral technology by Breadboards are us
this code combines an Alternating switch program with a servo
position program to create an (im)moral profiling machine*/

#include <Servo.h>

Servo myservo;  // create servo object to control a servo
int pos = 0;  //variable to store the servo position

int switchPin1 = 1;  //switch is connected to pin 1
int vaLone;  //variable for reading the pin status
int buttonState1;  //variable to hold the last buttonState

int switchPin2 = 2;  //switch is connected to pin 2
int vaLtwo;  //variable for reading the pin status
int buttonState2;  //variable to hold the last buttonState


void setup()
{
 myservo.attach(9);  // attaches servo on pin 9 to the servo object
  pinMode(switchPin1,INPUT); //Set the switch pin as input
  pinMode(switchPin2,INPUT); //Set the switch pin as input
  Serial.begin(9600); // Set up serial communication at 9600bps
 buttonState1 = digitalRead(switchPin1);  // read the initial state
buttonState2 = digitalRead(switchPin2);  // read the initial state

}

void loop()
{
  vaLone = digitalRead(switchPin1);  //read input value and store it in val
  //if (vaLone != buttonState1)  {  //the button state has changed!
  if (vaLone == HIGH)  {  // check if the button is pressed
  pos = 10;
  myservo.write(pos);  //if it's pressed send it to angle 20
  }
  else  {  //the button is not pressed
    pos = 0;
  myservo.write(pos);
  }
 
buttonState1 = vaLone;  // save the new state in button's variable

  vaLtwo = digitalRead(switchPin2);  //read input value and store it in val
  //if (vaLtwo != buttonState2)  {  //the button state has changed!
  if (vaLtwo == HIGH)  {  // check if the button is pressed
  pos = 180;
  myservo.write(pos);  //if it's pressed send it to angle 20
  }
  else  {  //the button is not pressed
    pos = 0;
  myservo.write(pos);
  }
 
buttonState2 = vaLtwo; //save the new state in button's variable


}


Images:

Wednesday, January 19, 2011

ADVENTURES WITH A PUSH BUTTON AND Serial.read







/*
 * Switch test program
 */

int switchPin = 2;              // Switch connected to digital pin 2

void setup()                    // run once, when the sketch starts
{
  Serial.begin(9600);           // set up Serial library at 9600 bps
  pinMode(switchPin, INPUT);    // sets the digital pin as input to read switch
}


void loop()                     // run over and over again
{
  Serial.print("Read switch input: ");
  Serial.println(digitalRead(switchPin));    // Read the pin and display the value
  delay(100);
}

Reflections on Bill and Phil's papers

On Bill Gaver's Designing for Homo Ludens, still...

This paper is very much oriented to object design. As an architecture student I would add that these objects can also be seen as part of an overall 'environment'. Thus the critical approach to design presented by Gaver can also be extended to design at larger scales i.e. the room, the house, and surely the city.

What is interesting about the projects presented by Gaver is that they seem to be the result of a design process that has one foot in theory and the other one in 'making'. During the class discussion the question of whether these projects are art or design came up. It is probably better to think of them as being in both design and art, as they seem to be engaged in both critiquing and making a statement about what technology should do, but in the end they end up constituting a design artifact in their own right.

The lesson I would take from these objects as a designer is that they allow for a feedback loop between the critical ideas informing the project and the unexpected ways the object's intended audience or users finally engage with it.
This relates to one of Agre's concluding ideas:
A critical technical practice will, at least for the foreseeable future, require a split identity -- one foot planted in the craft work of design and the other foot planted in the reflexive work of critique.”

I would add that both papers argue for a blurry line between theory and practice. It is very difficult if not impossible to make a design or technical artifact that is a direct representation or embodiment of a critical idea or theory.

AL

Arduino Code for Two blinklights

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.

  This example code is in the public domain.
 */

void setup() {               
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(13, OUTPUT);    
  pinMode(12, OUTPUT);
}

void loop() {
  digitalWrite(13, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(12, HIGH);   // set the LED on
  delay(2000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED off
  delay(1000);              // wait for a second
  digitalWrite(12, LOW);    // set the LED off
  delay(1000);              // wait for a second

}

Wednesday, January 12, 2011

Week 2

1. The resistor can be located anywhere along the circuit!!  It is better to put it close to ground.
2. "Your friend must have a lot of firewood, " is a great quote to illustrate the difference between theoretical knowledge and practical knowledge.