Deja Vu

by heidiqc

by Heidi and Nicole

Ladies, have you ever left the house without your cell phone? Locked yourself out without your keys? Paused mid step to hurriedly search your bag for items you thought you may have forgotten?

Deja Vu is here to help. The newly developed intelligent bag boasts an RFID system that helps you to remember to take important items like your wallet, keys, and cell phone with you. Just attach our custom RFID tags to your things, turn on the bag, and you’re all set. The bag will automatically scan items as they enter and leave, keeping track of what’s in the bag.  A simple squeeze of the soft button and the LED display will light up to show which items are accounted for, so that you never have to frantically search the bag to check if your items are there.  The bag can take up to 5 tags for important items.

Process:

Roll over each picture for more details.

Download the presentation slides here:
NewTextilesFinalProjectPresentation-DejaVu
It contains more details about the project, including: inspirations, process, circuitry, challenges encountered and future improvements.

Many thanks to:
http://bildr.org/2011/02/rfid-arduino/ – for the RFID- Arduino interfacing and code
http://machenmachen.files.wordpress.com/2007/08/machen-machen-wasp-bag.pdf – for the bag pattern

Arduino Code:

// set pin numbers
int RFIDResetPin = 3;
int RFIDLedPin = 13;
int led1 = 8;
int led2 = 9;
int led3 = 10;
int led4 = 11;
int led5 = 12;
int CheckStatusPin = A3;
int Clasp = A4;
int RFIDSwitch= A5;
//Register your RFID tags here
char tag1[13] = “4500B8ED3222″;
char tag2[13] = “4500B8DAF4D3″;
char tag3[13] = “4400E6A55453″;
char tag4[13] = “4400E6A46F69″;
char tag5[13] = “00365F8F6482″;
// initialize boolean variables
boolean item1 = false;
boolean item2 = false;
boolean item3 = false;
boolean item4 = false;
boolean item5 = false;
void setup(){
Serial.begin(9600);
pinMode(RFIDResetPin, OUTPUT);
pinMode(RFIDSwitch, OUTPUT);
pinMode(Clasp, INPUT);
digitalWrite(Clasp, HIGH);
pinMode(RFIDLedPin, OUTPUT); // flashing pin when item is read
pinMode(CheckStatusPin, INPUT);
digitalWrite(CheckStatusPin, HIGH);
//set up led pins
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
}
void loop(){
// when the bag is open, turn on RFID reader power via MOSFET
if (digitalRead(Clasp) == HIGH) {
digitalWrite(RFIDSwitch, HIGH);
//Serial.println(500); for debugging
} else {
digitalWrite(RFIDSwitch, LOW);
Serial.println(550); // for debugging
}
char tagString[13];
int index = 0;
boolean reading = false;
//Serial.println(12); for debugging
// when a card is passed over the RFID reader, get tag code
while(Serial.available()){
Serial.println(10);
int readByte = Serial.read(); //read next available byte
if(readByte == 2) reading = true; //begining of tag
if(readByte == 3) reading = false; //end of tag
if(reading && readByte != 2 && readByte != 10 && readByte != 13){
//store the tag
tagString[index] = readByte;
index ++;
}
}
//Serial.println(13); for debugging
checkTag(tagString); //Check if it is a match
clearTag(tagString); //Clear the char of all value
resetReader(); //reset the RFID reader
// if button is pressed, light up led corresponding to tag read
if (digitalRead(CheckStatusPin) == LOW) {
Serial.println(300);
if (item1== true) {
digitalWrite(led1,HIGH);
} if (item2 == true) {
digitalWrite(led2, HIGH);
} if (item3 == true) {
digitalWrite(led3, HIGH);
} if (item4 == true) {
digitalWrite(led4, HIGH);
} if (item5 == true) {
digitalWrite(led5, HIGH);
}
} else {
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
}
}
void checkTag(char tag[]){
///////////////////////////////////
//Check the read tag against known tags, toggle boolean variable
///////////////////////////////////
if(strlen(tag) == 0) return; //empty, no need to contunue
if(compareTag(tag, tag1)){ // if matched tag1, do this
lightLED(RFIDLedPin);
item1 = !item1;
}else if(compareTag(tag, tag2)){ //if matched tag2, do this
lightLED(RFIDLedPin);
item2 = !item2;
}else if(compareTag(tag, tag3)){ //if matched tag3, do this
lightLED(RFIDLedPin);
item3 = !item3;
}else if(compareTag(tag, tag4)){ //if matched tag4, do this
lightLED(RFIDLedPin);
item4 = !item4;
}else if(compareTag(tag, tag5)){ //if matched tag5, do this
lightLED(RFIDLedPin);
item5 = !item5;
}else{
Serial.println(tag); //read out any unknown tag
}
}
void lightLED(int pin){
///////////////////////////////////
//Turn on LED on pin “pin” for 250ms
///////////////////////////////////
Serial.println(pin);
digitalWrite(pin, HIGH);
delay(250);
digitalWrite(pin, LOW);
}
void resetReader(){
///////////////////////////////////
//Reset the RFID reader to read again.
///////////////////////////////////
digitalWrite(RFIDResetPin, LOW);
digitalWrite(RFIDResetPin, HIGH);
delay(150);
}
void clearTag(char one[]){
///////////////////////////////////
//clear the char array by filling with null – ASCII 0
//Will think same tag has been read otherwise
///////////////////////////////////
for(int i = 0; i < strlen(one); i++){
one[i] = 0;
}
}
boolean compareTag(char one[], char two[]){
///////////////////////////////////
//compare two value to see if same,
//strcmp not working 100% so we do this
///////////////////////////////////
if(strlen(one) == 0) return false; //empty
for(int i = 0; i < 12; i++){
if(one[i] != two[i]) return false;
}
return true; //no mismatches
}