Professional Documents
Culture Documents
Building An Active RFID People - Asset Tracking System With Mesh Networking - Nicholas Skinner's Blog
Building An Active RFID People - Asset Tracking System With Mesh Networking - Nicholas Skinner's Blog
Building An Active RFID People / Asset Tracking System With Mesh Networking - Nicholas Skinners Blog
Building An Active RFID People / Asset Tracking System With Mesh Networking
Introduction
I was initially looking into off the shelf hardware, however was unable to find any readily available equipment (to the hobbyist market in low quantities) that was reasonably priced, and fit the requirements. Therefore partly as a personal project, and partly in preparation for a possible commercial product I decided to put together a prototype active RFID tracking System. The solution I came up with is based on 3 main hardware components, and 5 software components. It utilises mesh networking meaning that only a single reader needs to be physically connected to a PC, all other readers just require power.
Hardware:
Tags Carried around / placed on assets to be tracked. Reader Nodes Placed around the area where the assets need to be tracked in. PC Reader Connected to the PC, receives data from reader nodes and sends it to the PC. The main hardware component used is the Synapse RF Engine, a 2.4 GHz transceiver module with built in support for running Python scripts, 2 UARTs, a number of GPIOs, and a 2.5uA low power mode.
Software:
Tags Software running on the tag to send out a ping at a defined interval, then put the tag to sleep before sending another ping. Reader Nodes Software running on the reader node hardware to listen for tag pings, and after receiving a ping, send the tag ID, reader node ID, and received signal strength to the PC Reader. PC Reader Software running on the reader hardware to receive data over the air from the many reader nodes and forward it to the serial / USB interface. PC Serial to HTTP data forwarder Software running on the PC that listens for data from the serial / USB connected PC Reader, and forwards that data via HTTP to a server. Location tracking processing / display GUI Web based software to process the tag data into a location, and display it on a map. The software consists of Python used by the Tags, Reader Nodes, PC Reader. C# used by the PC Serial to HTTP data forwarder, and PHP, HTML, JavaScript, SVG used by the Location tracking processing / display GUI.
www.ns-tech.co.uk/blog/2010/02/active-rfid-tracking-system/
1/9
11/15/13
Building An Active RFID People / Asset Tracking System With Mesh Networking - Nicholas Skinners Blog
Video showing simulation of tracking between 8 rooms, using 5 tags. For real life demo showing a single tag moving between 3 rooms see below.
System Design
The system was originally designed around the principle of Trilateration. Reader Nodes are placed at fixed known positions around the room / rooms containing tags that need to be located. As long as a tag is within range of at least 3 reader nodes the tags position can be calculated by using the signal strength of the tag to each of the 3 nearest readers. However this approach turned out not to be very feasible since past around 2 meters thesignal strength started fluctuating in a seemingly unpredictable way. It may be possible to predict / error correct for the fluctuations however I opted to go for a simpler approach of just plotting tags next to the reader with the highest signal strength (the one they are nearest to). This now means that readers need to be placed in each room (ideally centrally) where tags need to be tracked and it is only possible to determine a tag is in a room, and not its position in that room (although it is not used the original trilateration code has been left in the download). Using a two part system of sending the tag data to a web server (via a locally run data forwarding application) then displaying it back to clients in the browser has a number of advantages: Main application processing / display logic can be maintained in a single central location for one or more deployments. Location display / viewing GUI is cross platform (can be accessed via most modern browsers the have support for SVG excluding Internet Explorer). No software to install on client PCs viewing the map. Multiple users can logon and view the map at the same time. The use of mesh networking means that only a single device needs to be directly connected to a PC, all the others just need to be within range of any other unit that itself is either close to the PC, or close to another reader that is close to the PC. The makes setting up the system much easier as there is no
www.ns-tech.co.uk/blog/2010/02/active-rfid-tracking-system/ 2/9
11/15/13
Building An Active RFID People / Asset Tracking System With Mesh Networking - Nicholas Skinners Blog
need to wire each node to the PC / the network or have a PC next to each node. The nodes just require 3V power.
Tag Hardware
Parts List
Per individual tag
Qty Name x1 x1 x1 x1 x1 x1 Pocket Card Enclosure RF100P86 Synapse RF Engine VBH2032-1-LF Battery Holder CR2032 Battery
Small Stick On Feed (sold in packs of 4) Maplin FE32K Large Stick On Feed (sold in packs of 4) Maplin FW38R
Note: I used a CR2032 battery from Rapid however both Farnel, and Future also have a selection available from various manufacturers.
11/15/13
Building An Active RFID People / Asset Tracking System With Mesh Networking - Nicholas Skinners Blog
solder does not leak into the socket, otherwise it will not be possible to plug it in to the evaluation board.
Qty Name x1 x1 x1 x1 50mm x 50mm x 20mm ABS Box RF100P86 Synapse RF Engine 2.1mm DC Socket Regulated 3V DC 400mA Power Adapter
PC Reader Hardware
Parts List
www.ns-tech.co.uk/blog/2010/02/active-rfid-tracking-system/
11/15/13
Building An Active RFID People / Asset Tracking System With Mesh Networking - Nicholas Skinners Blog
x1 x1 x2 x1 x1
RF100P86 Synapse RF Engine TTL-232R-3V3 USB to Serial (3.3v level) Cable LP2950ACZ-3.0 Voltage Regulator 6 Way 2.54mm Molex Header Cable Tie
Tag Software
The Python tag software is fairly straight forward, it performs 5 main functions: 1. Set transmit power level for the tags. 2. Initialise GPIOs to optimise current consumption in sleep mode. 3. Turn off relaying of messages for other devices in the mesh network (it will only be powered up for a small amount of time every specified interval therefore this would not be very useful, also it may use up extra current). 4. Send out a ping (via multicast RPC) to any reader nodes in range with the tag id, and a TTL of 1. 5. Go to sleep for e.g. 10 seconds. Specifying a TTL of 1 on the multicast RPC call causes only readers that are directly in range of the tag to receive the ping, otherwise by default any nodes not in direct range of the tag would be forwarded the call from readers that were. This would mean it would not be possible to work out which reader actually communicated with the tag directly and which communicated 2nd hand. The software is loaded onto the tag via the Synapse Portal application available for Windows, Mac, and Linux, also included with the evaluation kit. When programming the tag you should plug it into the evaluation board rather than run it on battery
www.ns-tech.co.uk/blog/2010/02/active-rfid-tracking-system/ 5/9
11/15/13
Building An Active RFID People / Asset Tracking System With Mesh Networking - Nicholas Skinners Blog
and program it over the air because leaving the module on the workbench un-programmed, even for just a few minutes will quickly drain the small battery (15mA when idle according to the datasheet) and 40mA / 110mA when receiving / transmitting. [Download: Python Source]
PC Reader Software
The PC Reader Python software handles receiving data from the reader nodes (which themselves receive data from tags). It initialises the serial port, connects UART 1 (itself connected to the FTDI cable, which appears as a virtual serial port on the PC side) to STDIN/STDOUT (i.e. meaning that any Python print statements cause that data to be sent over the UART to the PC), and then initialises it to 9600 baud. The software prints the tag ping data to the serial port (after decoding the hex values to plain text). Example: 003c02,001a06,57 (i.e. [tag id],[reader id],[signal strength] If the tag that sent the ping is in range of e.g. 4 reader nodes at that time, 4 lines will be received with the same tag id, but different reader ids, and varying signal strengths depending on which reader nodes the tag is closer to. Note: There is not a command / function to send data to the UART, Python access to it is available only by e.g. cross connecting the UART with STDIN/STDOUT. [Download: Python Source]
www.ns-tech.co.uk/blog/2010/02/active-rfid-tracking-system/
6/9
11/15/13
Building An Active RFID People / Asset Tracking System With Mesh Networking - Nicholas Skinners Blog
The application includes an Auto Connect checkbox which will cause it to automatically open the connection to the serial port when the software is loaded. Note: One of the selling points of using the Synapse module (Python / high level language / RPC) based solution is the ease of use of it, everything is very much simplified for the programmer over other options such as perhaps using a Nordik nRF24LU1, and controlling it over I2C with an AVR in C. However this does bring with it additional licensing costs if you use over 6 modules on a network at a time using Portal. Therefore I coded a custom client side data forwarding application, rather than loading a Python script into Portal to do this and using RPC calls which would have been a simpler solution. In terms of deployments using the C# application also simplifies things avoiding the need for Portal to be installed / configured, the C# application just requires setting the COM port and URL. The .net framework is required to run this application, it is available from Microsoft Update or as a download from microsoft.com. C# Express Edition is available for free from Microsoft for viewing / editing the source code. [Download: C# Source | Application Executable]
www.ns-tech.co.uk/blog/2010/02/active-rfid-tracking-system/
7/9
11/15/13
Building An Active RFID People / Asset Tracking System With Mesh Networking - Nicholas Skinners Blog
Video showing a single tag moving around the map plan diagram corresponding to its real world location in one of 3 rooms. The tag ping interval was set to 3 seconds.
Video showing failed attempt to use trilateration to determine the unknown position of tag using the known position of 3 readers, and signal strengths to them.
General Notes
I would suggest purchasing the Synapse Starter Kit (Future Electronics), since although modules are programmable over the air, a serial connection is required in some situations such as deleting running scripts that are in an infinite loop, or have disabled the RF interface used by the Portal software for
www.ns-tech.co.uk/blog/2010/02/active-rfid-tracking-system/ 8/9
11/15/13
Building An Active RFID People / Asset Tracking System With Mesh Networking - Nicholas Skinners Blog
uploading new software. Synapse Wireless software, and documentation is available from the Synapse forum.
Download All
Includes all project files as linked individually above (Tag Python, Reader Node Python, PC Reader Python, C# Data Forwarder Source, Data Forwarder Binary, PHP Processing / Display application). [Download: All Code]
Issues
With the non trilateration approach of placing tags nearest to the highest signal strength reader, readers need to be carefully situated, particularly if they are in different sized rooms adjacent to each other in order to avoid false readings. If building the readers again I would use a different type of DC socket, as the one chosen was fairly loose when used with the 3V adapter plugs. I was expecting to achieve a longer battery life, as it stands battery life is around 1 week for a 10 second ping interval, and around 2 days for a 3 second interval on the CR2032. In terms of increasing battery life the main options would be decreasing the ping rate (therefore increasing the sleep time), or going for a different battery however this would likely require a larger form factor enclosure.
OpenBeacon Suitability
At first glance OpenBeacon hardware (as used at conferences such as the CCCs 24C3) would appear to be an ideal choice, their website even mentions it is meant to be used as a reference platform by hardware and software developers, however the more I looked into it the more it did not seem suitable for my particular requirements: Form factor of 20 EUR white tags is not particularly ideal (open circuit board / battery). Keyring tags are available however they cost 25 EUR each + 5 EUR for the case, i.e. 30 EUR in total per tag. USB readers are available for 85 EUR however require a PC by each reader, not particularly suitable for even a small deployment with e.g. 4 or 5 readers. Ethernet readers are available but at a cost of 340 EURs they are somewhat expensive and still require a network cable to each, not ideal. Readers are not able to provide received signal strength but rather rely on the tags broadcasting at a set (limited) number of power levels meaning a position can not be calculated as accurately as it may otherwise. Update: Reader Tip on setting up Reader Nodes.
Other Projects
If you are interested in this project you may find these others also of interest: Parallel Track, a free (for personal non commercial use) server side vehicle tracking application coded in PHP designed to be used with Python supporting Telit hardware modules running the embedded TModSoft software (firmware). Track Any Mobile, a web application for mobile phone tracking using available using an SS7 API provider.
This e ntry was poste d
www.ns-tech.co.uk/blog/2010/02/active-rfid-tracking-system/
9/9