TWiki
> Experimental
> Sensors >
RfidTags
Using RFID Tags to Trigger Mediascape Actions
The
RfidTags object allows authors to use RFID tags as part of their mediascape experiences.
RFID (Radio-Frequency IDentification) tags consist of a chip and a radio aerial, and are small enough to be incorporated into mobile devices or clothing, or stuck onto signs, packaging, or documents. Each tag transmits a code (which we call the ID) that can be used to identify that particular tag without needing physical contact between reader and tag. The tag itself requires no power, as it harvests the radio frequency power of a nearby reader.
|
| Image showing two different types of RFID tag |
In mscape, reading a tag will trigger an events that allow you to play media or trigger other interactions as a result of reading the tag.
Characteristics
Interaction Model
Reading an RFID tag using the system is a deliberate action by the user, as they must place the reader device close to the tag for it to be read. For this reason it is a good idea to try and draw the user's attention to where the tag devices are placed.
Range
The reader needs to be held around 1-2cms from the tag to ensure a successful read.
Latency
The time between the reader being in the correct place relative to the tag, and the action taking place is very short, under half a second.
Hardware
mscape supports a tag reader manufactured by
ACG, which connects to the Compact Flash (or CF for short) port on compatible mobile devices.
If you would like to buy this device, please contact ACG directly.

The
HP iPAQ 210 is an example of a currently-available device that this reader works with .
Using RfidTags in mscape maker
To add the
RfidTags object to your mediascape:
- Start mscape maker
- Right-click on 'Sensors' in the list of mediascape objects.
- Select 'Add Rfid Tags'
The
RfidTags object has a single event, OnTagRead, which carries a single parameter TagID - the identifier of the tag that has just been read. This event is useful when you do not know in advance the IDs of the tags that may be read during the execution of your mediascape.
Example
This example will play one sound when a tag is read that has an id number that is
even, and plays another when the id number is
odd.
This code should go in the RfidTag's OnTagRead event, and requires that audio objects called
audio01 and
audio02 exist in the mediascape.
int id;
int.TryParse(TagID, out id); // convert TagID to an integer
if ( (id/2)*2 == id) // its even
{
audio01.Play();
}
else
{
audio02.Play();
}
Using RfidTag Object in mscape maker
If you do know in advance the IDs of RFID tags that will be used in your mediascape, for example if you are deploying a set of known tags in the vicinity, you may find it useful to use the RfidTag object. This object is a child of
RfidTags and essentially allows you to associate an OnRead event with a known RFID Tag ID.
- To add an RfidTag object, ensure your mediascape contains a RfidTags object. If not, follow the instructions under RfidTags Object to add it.
- Right-click RfidTags and choose 'Add Rfid Tag'. The new object will be added as a child of RfidTags
- To set the ID of this tag, consult your RFID tag suppliers documentation to find the ID of the tag and enter it in the ID field of the properties box.
- Now when an RFID tag is read, the OnRead event will fire on the RfidTag object with the matching ID property.
The RfidTag object will have no effect if you do not enter a correct ID. Do not make the mistake of renaming the RfidTag to the ID, or entering the ID into the Name property of the tag. The Name property of the tag should be used to remind the designer where the tag is located or what it represents. |
Setting up mscape player to use RfidTags
RfidTags does not require any specific setup inside mscape player, though you should follow the manufacturer's instructions to correctly set up the reader hardware on your mobile device.