eZ430-RF2500 Group Page
1. Team Members
2. Getting Started
Be sure to get the latest install files from http://focus.ti.com/docs/toolsw/folders/print/ez430-rf2500.html#What%27s%20Included instead of using the software included in the CD. This is useful because the newest version of the software includes 64-bit drivers and complete support for Windows Vista and Windows 7. IAR Embedded Workbench KickStart is the IDE you'll want to download, and Sensor Monitor Demo is the demo which reports temperatures and voltages for the end points..
2.2. Setting Up and Running the Demo
Install the Sensor Monitor Demo. This can be acquired either from the supplied CD or from http://focus.ti.com/docs/toolsw/folders/print/ez430-rf2500.html#What%27s%20Included.
- Flip the jumper on the battery-powered sensor. You'll see the LEDs on the battery-powered sensor begin to flash.
- Plug in the USB-powered sensor into a USB port on your computer. The drivers will be installed.
Open the Sensor Monitor Demo, and the temperature of each sensor and voltage of the battery-powered sensor will be shown. You may need to go to Connect under Menu to get the demo to run. If something isn't shown right away, try toggling the jumper again or swapping USB ports. I found it to be somewhat finicky.
Remember to flip the jumper on the battery-powered sensor when you are done. If you don't do this, the batteries will die!
3. Project Ideas
3.1. Home Security Motes
- We will use the motes to put around a door (presumably an entrance to an important room).
- Each mote will have some sensor(s) attached to it to help detect when the door opens.
- Accelerometer for mote on door.
Passive infrared sensor for motion detection.
We will have a keypad similar to http://www.arduino.cc/playground/Code/Keypad which will allow the user to input a password.
- When a user opens the door, 1 or more sensors should be triggered. If a designated sensor is within range (the user presumably has it in his pocket, for example), the system will detect the presence of another wifi signal, and entrance is OK.
- If no designated sensor is within range, the system will expect the password to be entered within X number of seconds.
- If the password is not entered correctly within X seconds given Y number of tries, the user will be deemed an intruder. The sensors will inform the USB-powered sensor, and the computer will take appropriate actions.
- Sound an alarm through the speakers.
- Send an e-mail to an address specified to alert that there is an intruder.
3.2. Ambitious Project
This one may be difficult. The project would be to get the TinyOS operating system running on the eZ430-RF2500 platform. Some people claim to have done this, with limited success. Pieces of the process have been done, including a cross compiler under Linux (msp430 gcc with the eZ430's processor correctly targeted) and the basic port and pin mapping found for TinyOS. Also, using a somewhat different platform, the CC2500 (or similar) radio has been shown to work in TinyOS. As the semester proceeds, we will look at TinyOS and see if there is interest in getting it to work on this platform.
(3/20/10) -- turns out that we cannot program the eZ430-RF2500 under Linux, but these devices can be programmed using a slightly different USB attachment, the EZ430-F2013, which is apparently supported by the mspgcc project.
There are some places to wire sensors or other communication on the sides of the circuit boards. These are documented in datasheets for the eZ430-RF2500. For ideas about sensors, see notes on the Sentilla Group.
A lesson on the MSP430 family and programming.
There are forums where people using TI processors and parts (like the MSP430 and the CC2500) ask and answer questions; possibly worth searching through, when you have a very specific question or issue. Here are some of them:
Try some code examples, via TI's website. From there, you can download such things as
slaa325a.pdf - example of ez430 and the cc2500 (pdf)
slaa325a.zip - code for the example, suited to the IAR workbench
6. Developing under Linux
The machine nopal in the lab has been set up to compile for the ez430-rf2500, but using an ez430-f2013 programming tool. Setting up the environment is not so easy, as explained here: MSP430 Linux.
As for using the environment on nopal, stay tuned.
7.1. Final Product
Our final product, as (partially) demoed in class, is a proof-of-concept home security system. The system is comprised of two parts: a network of sensors for detecting potential intrusions and front-end software for interpreting sensor feedback and alerting the user of suspected security breaches. A mote serving as an access point bridges the two.
7.1.1. Sensor Network
Currently our system uses two types of sensors, accelerometers and IR motion detectors. The accelerometers are used primarily to detect a door opening while the motion detectors are more general-purpose and can monitor an entire room. Both types of sensors are attached to motes flashed with software that repeatedly (about once per second) checks the value of the ADC; if it is above (or below, depending on the sensor) a certain threshold, a value of one is reported to the access point. A value of zero is reported otherwise. Each sensor mote is flashed with a unique ID number so that the front-end software knows the mote's type and location. (This information obviously has to be provided to the software by the user.) A third type of mote, called a "key mote," is used to disarm the system. A key mote has no sensor and simply transmits a value of one every second. (The front-end software knows which motes are key motes based on ID numbers.)
7.1.2. Front-End Software
The front-end software, written in Python, connects to the access point mote over a virtual COM interface (the mote is physically attached to the PC via USB). It is up to this program to use feedback from the sensor motes to decide if an actual intrusion has occurred and the user should be alerted. We currently do this by simply storing the ten most recently received values. If, at any time, 3 or more of these values are one (remember, a sensor mote reports a one when it detects motion) and a key mote has not been detected in the last 20 seconds, an alarm event is triggered. When an alarm is triggered, an alert email is sent to any number of email addresses specified by the user. To avoid spamming inboxes, no more alert emails are sent for a user-specified period of time regardless of the values reported by the sensors.
7.2. Final Thoughts
Overall, I think everyone in the group enjoyed working on this project. It was refreshing to be turned loose for an entire semester with enough guidance that we didn't feel lost or helpless, but with enough freedom that we could plan our own project and learn on our own. We miraculously got everything working within days of our final presentation; the timing could not have been better. Here are a few final thoughts on our project and on the TI platform.
7.2.1. On The Technology
- Programming the motes in C was both unbelievably frustrating and incredibly educational. We fought for a long time to figure out how to do relatively simple things, like read values from the ADC and send messages to another mote. Lots of these tasks required setting the values of many obscure registers. At the same time, by paying attention to details like how to enable/disable the watchdog timer and how to use timer interrupts, we learned a lot more about how the motes really work than we likely would have if we had been using something like the Java-based Sentilla motes.
- TI's support for the platform leaves much to be desired. Their "free" IDE, IAR Workbench, is clunky to use and is prone to crashing. We also came to find out that the version of IAR Workbench available for download on TI's website is only the "lite" version; it only allows you to compile a maximum of 4K of machine code. The full version, without this ridiculous restriction, costs around $2,000. We also found their documentation for the platform as a whole to be quite lacking. Requiring programmers to set obscure registers in order to do simple tasks is bad enough; expecting them to do it with no documentation is absurd.
- We ran into a problem with our accelerometers. It turns out that the value output by the accelerometer is dependent upon the voltage supplied to it. This means that as the batteries powering the mote and the accelerometer begin to die, the threshold for what constitutes motion needs to change.
The solution, of course, is for the mote to measure batter voltage as well and dynamically set this threshold, but this requires using multiple ADC channels, something we didn't have time to figure out.
7.2.2. On The Project
We're quite pleased with what we managed to accomplish in the time we had. If we were to continue working on it, we discussed turning our security system into a more powerful "home monitoring" system. For instance, particle and temperature sensors could potentially detect fires. Soil moisture sensors could be used to monitor houseplants. For more specific future goals, see this post.