Followers

Setup




The Arduino Sensor Shield is inserted into the Arduino Dueminalove board via the connectors on the bottom of the sheild. This is what it is designed to do so it is fairly easily to assemble.

Once on the board the additional apparatus is connected to the shield instead of the board. Focussing on the board the RFID reader is connected to the digital pin 2 on the board. However coming from the RFID reader are four different cables, these all need to be connected and have different uses. Two of the wires feed power into the additional add-ons while the reference for the pin is inserted into the pin number that is being used, in this case number 2. The transmitter from the board must be connected to the reciever of the arduino board in order for the outputs to be processed.
  • Arduino RX to RFID TX
  • Arduino GND to RFID GND
  • Arduino Digital pin 2 to RFID enable
  • Arduino +5V to RFID Vcc pin.

Last but not least, remember to attach the power cable via usb or the power adapter socket available. External batteries are available if needed. In this case the USB connection to the laptop powers the device.

Hardware

Arduino Duemilanove (ATMega328)


The Duemilanove "2009" is a microcontroller boad with a ATmega328 (datasheet). There are 14 digital IO pins avaiable and 6 analogue pins. There is also a 16 MHz crystal oscillator which I won't be using, a USB connection and a power button amongst others. It is powered via the USB when connected to the laptop.

"Duemilanove" means 2009 in Italian and is named after the year of its release. The Duemilanove is the latest in a series of USB Arduino boards.

http://www.arduino.cc/en/Main/ArduinoBoardDuemilanove


Parralax RFID Reader

The Parallax Radio Frequency Identification (RFID) Reader Module is the first low-cost solution to read passive RFID transponder tags. The RFID Reader Module can be used in a wide variety of hobbyist and commercial applications, including access control, automatic identification, robotics, navigation, inventory tracking, payment systems, and car immobilization.

http://www.parallax.com/tabid/768/ProductID/114/Default.aspx



RFID Tags






Tag Codes:
  • 360073D274
  • 3600A9C9F8
  • 21009B440E
  • 0800DE1B47
  • 0800E3CA33
  • 2500705409


Arduino Sensor Shield V4.0


By using electronic bricks, you may connect Arduino compatible boards easily with various digital, analog and I2C/Uart interfaces. These the breadboard-less firm connection are prepared to extensive modules like poteniometers, sensors, relays, servos...even buttons, just plug and play.

Each terminal module has buckled port with VCC, GND and Output, which has corresponding port on the sensing board, with a plain 2.54mm dual-female cable you may start playing already. Buckled brick cables are like cement for bricks, make the connections easier, secure and more professional looking.



http://www.emartee.com/product/41798/Arduino-Sensor-Shield-V4.0

Software

Two programs are used in the construction of the software.
  • Arduino
  • Processing
Arduino

The arduino software has been used to upload the program into the arduino board's internal memory, the program runs internally in the board and outputs through the serial connection to the laptop to the daemon file in Processing.

The code:

// RFID reader for Arduino 
// Wiring version by BARRAGAN <http://people.interaction-ivrea.it/h.barragan> 
// Modified for Arudino by djmatic


int  val = 0; 
char code[10]; 
int bytesread = 0; 

void setup() { 

Serial.begin(2400); // RFID reader SOUT pin connected to Serial RX pin at 2400bps 
pinMode(2,OUTPUT);   // Set digital pin 2 as OUTPUT to connect it to the RFID /ENABLE pin 
digitalWrite(2, LOW);                  // Activate the RFID reader
}  


 void loop() { 

  if(Serial.available() > 0) {          // if data available from reader 
    if((val = Serial.read()) == 10) {   // check for header 
      bytesread = 0; 
      while(bytesread<10) {              // read 10 digit code 
        if( Serial.available() > 0) { 
          val = Serial.read(); 
          if((val == 10)||(val == 13)) { // if header or stop bytes before the 10 digit reading 
            break;                       // stop reading 
          } 
          code[bytesread] = val;         // add the digit           
          bytesread++;                   // ready to read next digit  
        } 
      } 
      if(bytesread == 10) {              // if 10 digit read is complete 
        Serial.print("TAG code is: ");   // possibly a good TAG 
        Serial.println(code);            // print the TAG code 
      } 
      bytesread = 0; 
      digitalWrite(2, HIGH);                  // deactivate the RFID reader for a moment so it will not flood
           delay(1500);                       // wait for a bit 
           digitalWrite(2, LOW);                  // Activate the RFID reader
    } 
  } 
} 

// extra stuff
// digitalWrite(2, HIGH);             // deactivate RFID reader 

The code can be found on the Arduino Playground site: http://www.arduino.cc/playground/Learning/PRFID

To get the code to work properly in my program I had to edit parts of the above code. In the above code the arduino prints "The tag code is: " followed by the code and a line spacing. This is not necessary for what I want so I edited the code to only print the code of the tag it is reading. I also added a stop variable to the code array, this helps when recieving the code in processing.


if(bytesread == 10) {              // if 10 digit read is complete 
          code[10]='\0';                 //add end of string signal
          Serial.print(code);            // print the TAG code 
} 

Processing

The processing application is used to implement a daemon file which will run on the laptop and interact with the Arduino board. The program recieves the data from the arduino via the serial port and loads the necessary video depending on what tag has been used. A program that runs in the background is called a Daemon.

The code:

import processing.serial.*;
import processing.video.*;
import jmcvideo.*;
import ddf.minim.*;

AudioPlayer player;
Minim minim;

Serial myPort;  // The serial port
Movie myMovie;

void movieEvent(Movie m) {
  m.read();
}

void setup() {
    size(320,240,P3D);
     minim = new Minim(this);
  // Open whatever port is the one you're using.
  myPort = new Serial(this, Serial.list()[1], 2400);

  background(0);

}

void draw() {


  if (myMovie != null){

      image(myMovie, 0, 0);
      smooth();
     }

}

void serialEvent(Serial p){
 
  while (myPort.available() >= 10) {
   //Video Code:
  String command = "";
  for (int i=0;i<10;i++){
     command += myPort.readChar();
  }
 
      if (myMovie != null){
      myMovie.dispose();
      player.close();
      minim.stop();
    }
  
  
  println(command);
  myMovie = new Movie(this, command+".mov");
  player = minim.loadFile(command+".wav", 2048);
   myMovie.play();
  player.play();
  }
}


 The main variables used (listed below) make the program possible. The first two variables are used for the sound, the serial port is used for the communication between Processing and the arduino board, the movie is the movie being displayed.
  • AudioPlayer player;
  • Minim minim;
  • Serial myPort;  
  • Movie myMovie;
The program begins by setting up the size of the program and setting a black background. When a code is read by the arduino it is sent to processing which interprets the code and plays the corresponding audio (.wav) and video (.mov) file. The program checks which video is playing previously and cancels the audio swapping it with the file that is needed.

 If you want to find out the serial's available on the ports use the following code:

println(Serial.list());

Negotiated Site


The students union is at the base of the University of Plymouth and is a widely used place by students for a number of different reasons. Throughout the day it is possible for a thousand students to walk past the union and walk in to make some sort of interaction, whether it be with other students, bar staff, or vending machines.

The students union has lots of VDU's (visual display units) that play throughout the day and night as entertainment to the students. The students do not interact with the monitors as much as watch them, there is a monitor located at the rear entrance of the union, behind the bar, where students can enter to purchase things and sign up to events or just hang out. Next to the entrance of the doors there is a big monitor that display's ..................................



Alot of the time students will recieve emails from the student's union inviting them to nights out and activities that are happening throughout the week, as much as this is a good idea it still clutters and spams the students email inbox. The monitors are available all the time when people are close to them, this is a lot better than appealing to the students via email. UPSU has developed a screen saver that is a live feed to what is happening throughout the week. Video's are more entertaining than text information systems and can draw a crowd by catching attention.

If it were possible to advertise through the use of student cards, this would encourage students to watch and interact with the program and go to the events taking place. It is possible to advertise different things to different students using their individual tag codes. However, another possibility is using the same software on a network and having multiple universitys using the softare and giving the university's their individual codes.

The two video's I have used are examples of what is possible, the universities would create their own promotional video's and can change them regularly each week for example. Different events regularly happen at universitys and being able to promote the events in this way is the future.

The RFID technology is a technology with a lot of potential in this area, other than bringing more people to the monitors to interact it will also bring more people in the students unions events.




Click for a larger image