Archive for July 2nd, 2008

Beacon Pendants: Code

Posted in Uncategorized on July 2nd, 2008

//Beacon Locator Thing V 1.0  A slamming together of Rob Faludi’s RSSI Reader, and Tom Igoes Analog Duplex Sender Code
//by Chris Cerrito

//FOR XBEE2
//******************************************************************************int
int RSSI = 0; // holds the Recieved Signal Strength Value, the value used to range find the Xbees
int address = 0; //holds the 16 bit address of the incoming signal
int lastSender = 0; // last address we received an API packet from

//******************************************************************************#define

#define txLed 2 //indicates outgoing data
#define rxLed 3 //indicates incoming data
#define RedChannel 11 //red pwm pin
#define GreenChannel 9 //green pwm pin
#define BlueChannel 10 //blue pwm pin

int RedChanVal = 0;
int GreenChanVal = 0;
int BlueChanVal = 0;

unsigned long RedTimeOut = 0;
unsigned long GreenTimeOut = 0;
unsigned long StartTime = 0;

//*********************************************************************************

void setup() {
Serial.begin(9600); //Lets talk.
pinMode(txLed, OUTPUT);
pinMode(rxLed, OUTPUT);
pinMode(RedChannel, OUTPUT);
pinMode(GreenChannel, OUTPUT);
pinMode(BlueChannel, OUTPUT);
setDestination();
}

//***********************************************************************************WORKS?

void setDestination(){
blink(2);               //blink to indicate that the destination code is about to run
delay(1200);
Serial.print(”+++”); //throw Xbee into command mode
delay(500);
char thisByte = 0;
while (thisByte != ‘\r’) {           //Xbee will reply with an OK/r…wait for the ?r before printing
if (Serial.available() > 0) {      //if theres something in the serial, read it.
thisByte = Serial.read();
}
}
Serial.print(”ATDH0, DLFFFF\r”); //sets the address. Puts in the Xbee in Broadcast Mode—Anyone can listen
delay(10);
Serial.print(”ATMY0001\r”); //gives the Xbee an Address of 1. Use single digit addresses. CHANGE TO A DIFFERENT address fr each UNIT.
delay(10);
Serial.print(”ATID1124\r”); //set the PAN ID
delay(10);
Serial.print(”ATAP1\r”); //put the Xbee into API mode
delay(10);
Serial.print(”ATCN\r”); //take the Xbee out of command mode.
delay(1200);
blink(2);

}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++works

void blink(int howManyTimes) {
for (int i=0; i< howManyTimes; i++) {
digitalWrite(txLed, HIGH);
delay(200);
digitalWrite(txLed, LOW);
delay(1200);
}
}

//********************************************//Reads an API string

void APIread() {
if (Serial.available() > 13) {   //checks to make sure that we have received at least one frame worth of bytes
int inByte = Serial.read();    //reads the incoming API string
if (inByte == 0×7E) {          // (first byte)looks for tilda (ox7E) place holder…marks the beginning of the string
for (int i=0;i<4;i++) {
int junk = Serial.read();  // (next four bytes)  reads and discards the next four bytes that we’re not going to use
}

address = Serial.read();       // the sixth byte is the low part of the address (ONLY USE ONE BYTE ADDRESSES!)
RSSI = Serial.read();          // the seventh byte is the RSSI value

for (int i=0;i<7;i++) {
int junk = Serial.read();     //reads and discards the last six bytes of the API string. We dont need them. Whats in them? beats the crap outta me.
}

AssignValues();                 //if there are values to assign from a successful serial read, assign them.
}
}

}

//*******************************************//

void AssignValues() {

if (address == 0003) {                              //if Xbee 3 is detected, give the red channel a value
GreenChanVal=(100-RSSI)*2;
GreenTimeOut=  millis();
}

if (address == 0002) {                         //if Xbee2 is detected, give the green channel a value
RedChanVal=(100-RSSI)*2;
RedTimeOut = millis();
}

if (address > 0) {                         //if an address is recieved (Showing that the Xbee has
digitalWrite(rxLed, HIGH);               //received and processed info.
}
else
{digitalWrite(rxLed, LOW);
}
}
//********************************************

void Lightup() {
analogWrite(GreenChannel, GreenChanVal);
analogWrite(RedChannel, RedChanVal);
}

//**********************************************

void Timeout() {

if ((millis() - GreenTimeOut) > 1000) {
GreenChanVal=0;
}

if ((millis() - RedTimeOut) > 1000) {
RedChanVal=0;
}
}

//*********************************************

void Sendjunk() {
digitalWrite(txLed, HIGH);
sendData(”X”,0xFFFF);    //SETS ADDRESS IS REDUNDANT
delay(50);
digitalWrite(txLed, LOW);
}

//*******************************************

void loop () {
StartTime = millis();
APIread();
Lightup();
Sendjunk();
Timeout();
Serial.print(”GreenChanVal”);
Serial.print(GreenChanVal);
Serial.print(”RedChanVal”);
Serial.print(RedChanVal);
}

The Beacon Pendants

Posted in sociable objects, Uncategorized on July 2nd, 2008

Beacon Pendants

For my sociable objects final I decided to work on a project thats been the in back of my mind for quite some time. I’ve always wanted to make “social” jewelry; small wearable objects that have the ability to know if there are others of their kind in the area. For instance, say you were wearing, oh, i dunno, a pendant, and your friend had on a similar piece. Perhaps each pendant would glow, the closer the two of you are together, the brighter the response, the further apart, the dimmer. Say maybe there were three pendants, and each pendant had a specific color assigned to it; You were wearing the blue necklace, your friend the green, and your other friend the red. When the three of you were together, the pendants would flash brightly between all three colors, indicating social cohesion among the group. If one friend left early, the color show would be reduced to just two tones, and finally, when everyone parts ways, you would be left with a necklace dimly glowing it’s assigned color.

Another interesting idea: say the pendants were somewhat directional…Remember rabbit ears? Back in the day of braodcast TV (a world I’m afraid I still live in) you would have to adjust your antennae in order to pick up a station clearly. Say you were wearing one of these objects, and you suddenly noticed a flash of red, indicating that your friend was somewhere in the crowd. Using the pendant like a divining rod of sorts, you maneuver through the crowd, watching the light grow dimmer or stronger based the relative locations of both parties. Maybe you would be able to find one another?

And, finally, what if you were, say, at a huge party in the middle of the desert wearing a big furry coat, a space helmet, and stuck on sensory overload. A little help finding your way back to your camp would surely be a good thing. Perhaps there could be a beacon of sorts, broadcasting a much stronger signal then the pendants themselves, but in their range of hearing. Maybe, just maybe, you could navigate your way home using a somewhat directional antennae….

So, in a nutshell, thats pretty much what I tried to accomplish. I haven’t gotten all the way there yet, but I do feel as though I’ve made significant progress. I’m using Xbees broadcasting API packets, and giving each unit the ability to parse those packets out, seeing who they’re from, and the signal strength of each unit in the system. Right now I have three breadboarded circuits, the “pendants” themselves, up and running. Theres a ton more to do, including shrinking these things down to a wearable size, but I think it’s all doable.

Below is a video of each circuit in action. Though they’re not mobile (i was so shocked that things actually worked that I didn’t want to ruin it by moving), each unit can see wach other, as indicated by the flashing tricolor RGB LEDS.

The diagram above is basically how I envision the system working.

Take a look below:


Trash Talk

Posted in Living Art, Physical Computing, Personal, Uncategorized on July 2nd, 2008

Trash Talk is in Conflux this year….

MRS. DESI LIVES!!!!

I’ll be posting info about the rebuild as it happens. Should be pretty damn good.