Parallax RFID -> Flash

Parallax RFID and tags

Parallax USB RFID

Watch the video demo here.

This tutorial assumes that you’ve got Processing and the Parallax RFID reader running as per the Parallax -> Arduino document here: http://docs.google.com/View?id=dg895rd7_534c58v2g7

Things you need

Download drivers from http://www.ftdichip.com/Drivers/VCP.htm

1 x Parallax RFID Reader – USB version

6 x RFID tags (hopefully you know the unique ID for each of these)

Get Processing from here: http://processing.org/download/

The compiled flash code from this zip file: http://www.jaymatter.com/ecuad/rfid_2_flash.zip

IF you want to look at the Flash source code, get it here: http://www.jaymatter.com/ecuad/rfid_2_flash_src.zip

The Flash source code is written in Actionscript 3 in Flex Builder 3.

If you want Flex Builder 3 it is free to students but you have to send a scan of your student ID: https://freeriatools.adobe.com/flex/

Alternatively, you can use Eclipse with the Flex or Actionscript 3 plugin (all free but setup is outside the scope of this document for now).

Setup your hardware

Plug your Parallax RFID into your computer with the usb cable.

Setup Processing

Paste this code into a new Processing document:

import processing.serial.*;  
import processing.net.*;  
// The serial port:  
Serial rfidPort;  
// The socket server
Server server;
int port = 8080;  

void setup()
{      
// List all the available serial ports:      
println(Serial.list());      

/*   Open whatever port is the one you're using. */        

rfidPort = new Serial(this, Serial.list()[0], 2400);      
rfidPort.setDTR(true);      
server = new Server(this, port);  
}  

void draw() {      
while (rfidPort.available() > 0) {        
int inByte = rfidPort.read();        
println(inByte);        
server.write(inByte);    
}
}

Setup the xml

Unzip the Flash zip file.  In the folder called ‘xml’ open the file called data.xml.  This file creates relationships between the photos in the ‘images’ folder, and your tags. This piece of code describes one image, with a description (it’s called a ‘node’):

<image url="./images/5.jpg" rfid="01068DD013">
    Donec ornare fringilla libero.
</image>

The ‘url’ attribute is the location of an image.  The ‘rfid’ attribute is the unique tag that you want to associate to the image in the same ‘image’ node. The text between the two ‘image’ tags is the description text associated to the same image. It appears with the associated image in the Flash.

Put your tag and image data into the xml structure.

Run the Flash file

Run the html file called RFID2Flash.html. Your browser should open with a black screen.  If the connection to your RFID is successful, you will see a confirmation in your browser window. If you get an error, make sure your RFID reader is connected properly and that the Processing sketch is running.

Test the setup

Take one of your tags and hold it up to the reader.  The image and text that you associated to that tag in the xml file should appear in your browser.  Try the different tags and make sure they all work.  You’re done!

7 comments

  1. The flash for this has been updated – Oct 7, 2009

  2. Here’s some Processing code to report the unique IDs for RFID tags using the Parallax RFID reader:

    // start processing code
    // this snippet will write rfid tag IDs to Processing’s output screen
    import processing.serial.*;

    // The serial port:
    Serial rfidPort;

    void setup() {

    // List all the available serial ports:
    println(Serial.list());

    rfidPort = new Serial(this, Serial.list()[0], 2400);
    rfidPort.setDTR(true);
    }

    void draw() {
    while (rfidPort.available() > 0) {
    String inString = rfidPort.readString();
    print(inString);

    }
    }

    // end processing code

  3. hey Jay,

    thanks for running this tutorial in our class last semester. i have a relatively complicated question regarding this code and translating it into something that could run an audio clip. would it be okay if i emailed you with a better explanation of my question?

    cheers!

  4. For sure Stephanie!

  5. hie jay,

    im doing this rfid application using the actionscript too.
    unfortunately, im not using the parallax rfid reader.
    is it the same as other rfid readers? im using this reader where it is connected to the pc using a serial communication port.

    right now i i think i have got the rfid data to get onto this proxy through tinkerproxy. could your as3 coding relate to that?

    what does that Processing and arduino board do? can my rfid reader application with as3 work well without them?

  6. First of all , thanks for the bridge between a Rfid reader and flash. But i have an important question. Namely is there a way to set a certain picture to a rfid tag without the XML file , in flash itself i mean ? Because i want to use the rfid input to let an arduino ( also in flash) create output.

    Thanks,

    Michiel