Showing posts with label RFID. Show all posts
Showing posts with label RFID. Show all posts

Sunday, 22 April 2012

The Immigrant's Suitcase: The Finished Project

This post has been cross posted to Adriana Ayers' blog  History and such.


The following is a collaborative blog post that Adriana and I have written to discuss our trials and tribulations of designing and implementing an interactive suitcase and immigration exhibit.

Adriana: Beginning back in January, Lindsay came up with a fantastic idea to create an interactive exhibit situated around an immigrant's suitcase, which we chatted about here, here, here, and here.

Google Sketch Up Visualization

Lindsay: Immigrant history has always interested me and it was important to both of us to use real immigrant stories in creating this exhibit.  Just like more traditional historical projects, our first step was to explore the archives for some material on immigration - specifically immigration to Alberta between the years 1890-1914.  Living in Ontario is a distinct disadvantage when studying Alberta history, but thanks to the online archives of the Glenbow Museum and Peel's Prarie Provinces, we found great pictures and newspaper articles.

Adriana: Of all the things we have learned throughout this project is the ability to scale back our designs and accept all victories, no matter how miniscule. Wide-eyed and full of wonder, our initial plans included an entire room of digital and interactive opportunities. A suitcase that could open by a motion sensor, poster-size touch screen advertisements from the late 19th century, and an immigrant child's toys that could somehow communicate through Bluetooth and RFID technologies.

We quickly determined these illusions of grandeur were unrealistic and stuck to what we do best: crafting.

                              RFID tags concealed inside the passports               
                    
Lindsay: Once we were satisfied with our artistic endeavours, we needed to get back to business and focus on the interactive component of the course.

Our biggest obstacle and the source of all frustration was figuring out how to write the code to make our little project work. Coding made me slam my fists on my computer many times.  I think almost cried once too. As I wrote previously, we were attempting to use the RFID tags to open movie files stored on our computer.  We started with a base code provided by our professor Bill Turkel that set up the RFID tags and scanner.  We hacked this code to successfully make the audio of the movies start up, but the videos were just a blank black screen. Processing is not really suited to play large video files and it wouldn’t work no matter what we tried.  We were at a loss as to where to go next.  But then….a stroke of genius.  Ok, not really, but Adriana suggested we try to make the code open YouTube videos rather than video files from our computer.  Processing is much better at opening URL’s so this seemed like a viable option. 

We started in this new direction with our code, and miraculously, we scanned a tag and a YouTube video popped up!  Shouting and screaming ensued, with high fives all around.  That is, until we realized the video opened in 103 different tabs.  Apparently the code will loop continuously, opening the URL until you to tell it to stop.  We didn’t tell it to stop.  When your browser opens 103 tabs simultaneously, chaos ensues and your computer is no longer functional.  Fixing this problem took a few solid hours of trial and error in manipulating the code, but we finally succeeded in our new goal. An RFID tag is scanned and a video opens.  Sounds so much easier than it is!


 For any curious coders out there – here is our magical Processing sketch.

import processing.serial.*;

Serial myPort;
String tagID = "";

void setup() {
   size(screen.width, screen.height); //sets display to fit screen 
   // set serial port to first on list and initialize it
   println(Serial.list());
   String portnum = Serial.list()[0];
   myPort = new Serial(this, portnum, 9600);
   myPort.buffer(16);
   // use third font available
   PFont myFont = createFont(PFont.list()[140], 82); //sets font
   textFont(myFont);
}
void draw() {
   background(0); //sets background as black
   text("The Immigrant's Suitcase", width/2, height/2); //formats the text
   textAlign(CENTER);
     if (tagID.equals("0E008E880A")) { //sets specific RFID tag to open a specific URL
      link("http://www.youtube.com/watch?v=XFZRiojnsJ8", "_self"); //sets specific URL
      noLoop(); //stops the video after it plays once
     }
      if (tagID.equals("0E008E9525")) { //sets specific RFID tag to open a specific URL
      link("http://www.youtube.com/watch?v=rx1tNYC8fnE", "_self"); //sets specific URL 
      noLoop(); //stops the video after it plays once
      }
        if (tagID.equals("0E008E8657")) { //ets specific RFID tag to open a specific URL
      link("http://www.youtube.com/watch?v=smeISuxLbVk", "_self"); // sets specfic URL 
      noLoop(); //stops the video after it plays once
        }
      } 

// read bytes from the serial port and put them into tag string
void serialEvent(Serial myPort) { //sets up the RFID scanner
  loop();// keeps the sketch running continuously 
   String inputString = myPort.readString();
   tagID = parseString(inputString);
}

// read string and look for 10-byte tag ID
// assumes string begins with STX byte (0x02) and ends with ETX byte (0x03)
String parseString(String thisString) {
   String tagString = "";
   char firstChar = thisString.charAt(0);
   char lastChar = thisString.charAt(thisString.length() - 1);
   if ((firstChar == 0x02) && (lastChar == 0x03)) {
     tagString = thisString.substring(1, 11);
   }
   return tagString;   
}

      
After Adriana put together a few short videos in iMovie using the archival material and uploaded them to YouTube, our project was ready for display.


And now the moment you’ve all been waiting for….seeing this exhibit in action!
Thanks to Sushima Naraine for video taping 

If you are interested in seeing the videos we used in the exhibit, please visit Adriana's YouTube Channel.


Adriana: Perpetual over achievers, we weren’t satisfied to leave our project there. We called upon previous Public History grad and tech-genius, Devon Elliott, to help us create something with the 3D printer. The result was six Matryoshka dolls, made out of PCB plastic, which I sanded to fit together.







Adriana: After spending countless hours sitting in front our computer screens hoping something would happen if we just stared at them long enough, Lindsay and I have created a finished product, and by nothing short of a miracle, we survived. All things considered we agree this has been one of the most challenging but rewarding classes we have ever taken. As a result, I'm taking Inkscape tutorials in my spare time and I can make LED lights flash likea pro. Oh! and the 3D printer we helped build has been touring around the digital humanities conference circuit. All-in-all, I'd say that makes for a pretty satisfying semester.

 To see more pictures of the process of making this exhibit, please visit our Picasa Web Album.

Tuesday, 20 March 2012

Coding and Crafting

Turning your ideas into a reality is often much more complicated than you envision.  As Adriana and I attempt to take the immigrant's suitcase from a plan to a physical fabrication, we have had moments of progress, but also many instances of staring blankly at our computers, slamming our hands on the keyboard (ok that was just me, not Adriana) and wondering aloud if we will ever figure out how to program.

We may resort to this...

The process of programming our exhibit seems straightforward enough - create a program that opens iMovie when an RFID tag is scanned - and presto! you have our exhibit.  However, we have discovered that this is quite a complicated task for programming newbies.  Learning the language of the different programs involved is difficult.  We have to create a script in Processing that connects to a script in Arduino through Firmata that will successfully start iMovie, where the content of our exhibit will reside.  So it takes these three programs, plus RFID tags, an RFID reader, and a bunch of wires to make this work.

The combination of new programs and different technology is a bit overwhelming. Nevertheless, Adriana and I spent the entire day last Thursday trying to figure out the right script to make our little exhibit run.  We took it one step at a time, focusing on a script that would open a movie using Processing.  Because we need our exhibit to open three different movies, we decided to try a script that could open three different movies, depending on the key that was pressed.  We thought that if we could figure this out, we could then move on to opening the movies using the RFID tags.

Surprisingly, we did have some moderate success.  Using the reference resources on the Processing website, we were able to create a script that could run one movie when a specific key was pressed. At this point, I think we gave each other high fives and threw out a "Hallelujah!"  However, when we added two more movies and two more keys to the script, it became a little more complicated.


Our attempt at a Processing script

When we ran the above script, we could press the specified keys and get the audio of the movies to play, but not the visual.  While we were pretty proud of ourselves for accomplishing this, it is not the result we were hoping for.  But at the very least, it does give us something to work with as we try and figure out our next steps.  We are pretty sure that the problem lies in putting the movie files in the "void draw" part of the script rather than the "void setup" section.  However, when we moved the movie files to the "void setup," all three started playing at once!

Because we are uncertain of how to fix our problems, we have diverted our attention from the programming of the exhibit and focused on its physical fabrication.  I am using "physical fabrication" as a fancy term for crafting.  Basically, Adriana and I spent all day Monday doing paper mache and painting to create an oldish looking suitcase to serve as the vehicle for showing our movies. It may resemble some of the projects you did in Kindergarten, but at least we made progress in one area of our exhibit.


We love paper mache 

Speeding up the drying process 

Channelling da Vinci

 Painting

 The finished product

It's starting to take shape

If we end up failing spectacularly in programming our exhibit, at the end of the day, we have a pretty ok suitcase to show off.  Anyone hiring crafters?