« March 2008 | Main | May 2008 »

April 2008

April 29, 2008

Imote2.Builder Kit featured in InfoWorld

Infoworld InfoWorld has reviewed and featured Crossbow's Imote2.Builder kit in an article last week. The kit was reviewed by Strategic Developer Martin Heller who stated that, "The Imote2.Builder Kit makes creating wireless sensor networks a snap." From his article:

Imote2hardwareconfig_5 I spent several hours today exploring the Crossbow Imote2.Builder Kit, a "complete development environment for high performance wireless sensor networking (WSN) applications leveraging the Microsoft .NET Framework," as the company describes it.

(I'd never say "leveraging" and "Microsoft" in the same sentence myself if I could avoid it, because of Microsoft's rather checkered legal history of "leveraging" its near-monopoly -- but oops, I did it again. Back to Crossbow.)

The Imote2 .Builder Kit sells for $990 in the U.S. in small quantities. It includes three Imote2 processor boards, two Imote2 sensor boards, two battery boards, batteries, a USB cable, and software on CD-ROM. Obviously, individual boards are cheaper, especially in quantity.

Why so many boards? The processor boards also have radios, and can talk to each other using the 802.15.4 protocol. The Imote2 has an XScale CPU @ [13–416] MHz and a DSP, 256kB SRAM, 32 MB of SDRAM and 32 MB of FLASH, and baker's dozen of I/O ports of various stripes in addition to the radio and antenna. It has two pairs of connectors for sensor boards, a set for a "basic sensor board" on one side and an "advanced sensor board" on the other side. The flash image includes the .NET Micro Framework.

The sensor boards that come with the kit are of the basic variety, but I guess that refers to the connector they use: they actually have a 3d Accelerometer, an advanced temp/humidity sensor, a light sensor and 4 channel A/D.

The Imote2 software is an add-on to Microsoft Visual Studio 2005 (yes, 2005, not 2008) and .NET Micro Framework 2.0 (yes, 2.0, not 2.5). A 90-day trial version of Visual Studio 2005 Professional is provided with the kit.

I found the programming model for the Imote2 easy to understand, as I was already fluent in C# and familiar with Visual Studio 2005 and the .NET Micro Framework. I think I could build wireless sensor network applications with this kit very quickly: in days to weeks, depending on the complexity of the application.

The processors seem plenty fast. Debugging is trivially easy. The only trouble I had with the kit was a minor but annoying deployment issue: sometimes a board would stop taking downloads, and code deployment from Visual Studio would fail. I was always able to recover from this by stopping all the software on the PC that talked to the board, disconnecting the board from the USB bus, reconnecting and resetting the board, and restarting the software.

MotePlotAccording to the company, this is most likely a problem with the Microsoft USBSPOT driver. Once I had a board programmed, it would be fine.

The picture at the top of this article is the hardware configuration for the most advanced demo in the kit, a star network in which two battery-powered CPU/sensor stacks transmit accelerometer data, one CPU board receives the signals and sends them over the USB cable, and the PC plots the live output, as shown at left. Overall, this is a very impressive kit.

Martin Heller is a Web and Windows programming consultant, is a Contributing Editor for InfoWorld. He develops databases, software and sites, and writes, edits and consults from his office in Andover, Massachusetts, as he has for over 20 years. For more information on Crossbow's Imote2.Builder kit, please contact sales or visit our website here.

April 24, 2008

Intelligent Transportation Systems

Itsjetsons When I think about the future of transportation, the image that pops into my mind is the world of the Jetsons - a world of automation and intelligent transportation systems. A place where machines have the ability to sense and understand their surroundings to allow for a safer more efficient transportation environment. With major innovations slowly taking place all around us, we do not realize how quickly Intelligent Transportation Systems (ITS) are becoming part of our every day life. Implementations such as FastTrack to stop delays at bridge tolls, new technology in vehicles such as the Lexus LS 460 with advanced parking guidance so the car can park itself, Land Rover with adjustable suspension TerrainResponse™, or the Infiniti with wireless connectivity...all these innovations lend themselves to creating more intelligence in the transportation sector.

Moteiris What is an intelligent transportation system? The term refers to efforts to add information and communications technology to transport infrastructure and vehicles in an effort to manage factors that typically are at odds with each other, such as vehicles, loads, and routes to improve safety and reduce vehicle wear, transportation times and fuel consumption. The last few years have seen the emergence of many new technologies that can potentially have major impacts on Intelligent Transportation Systems. A recent study by the UK Governments Office of Science and Innovation, which examined how future intelligent infrastructure would evolve to support transportation over the next 50 years looked at a range of new technologies, systems and services that may emerge over that period. One key class of technology that was identified as having a significant role in delivering future intelligence to the transport sector were wireless sensor networks (Motes) and in particular the fusion of fixed and mobile networks to help deliver a safe, sustainable and robust future transport system based on the better collection of data, its processing and dissemination and the intelligent use of the data in a fully connected environment. Motes can also be augmented with additional sensors – such as those for detecting light, temperature and acceleration – hence enhancing their features and making their application areas virtually limitless. It is generally perceived that Motes will become the low-cost, ubiquitous sensor of the future, especially once its size shrinks dramatically to merit its name.

Itsnulogo_2Researchers at Newcastle University have been at the forefront of looking into the technology challenges of using these small, low-cost and smart wireless sensors in transport and the application areas where they could be employed. It is clear to the ITS community that the emergence of low cost sensors will open up new paradigms in how we can pervasively collect data from sensors, convey information along fixed and mobile low cost wireless networks (partly or fully formed or ad-hoc) and provide a ‘connected environment’ where individuals, vehicles and infrastructure can co-exist and cooperate, thus delivering more knowledge about the transport environment, the state of the network and who indeed is traveling or wishes to travel. This may offer benefits in terms of real-time management, optimization of transport systems, intelligent design and the use of such systems for innovative road charging and possibly carbon trading schemes as well as through the Cooperative Vehicle and Highway Systems for safety and control applications. See the research and potential use of a Mote based wireless sensor network in the video below:


Initial studies suggest vehicle to vehicle, vehicle to infrastructure, and infrastructure to infrastructure communication and in-vehicle monitoring and environmental monitoring may exist for Motes in the transport domain. Over the last few years, many different versions of 'smartdust devices' have been designed and built by various companies and institutions. Such devices can be used to sense a wide range of environmental parameters as well as vehicle speed, vehicle direction and vehicle presence in the infrastructure. Even though there are several platforms available on the market, Newcastle University chose Crossbow's MICA family motes for the EMMA and TRACKSS projects due to its commercial success in many wireless sensor network applications. Also, Newcastle University has successfully used MICA family motes in its other research projects such as the ASTRA project. Low power wireless communication and low power sensing capabilities are essential for sensor network applications which are supported by Crossbow's Mote family.

Itsdiagram_3 The ASTRA project investigated the use of mobile ad-hoc networks, and more specifically, Motes for transport applications. The project examined the current state-of-the-art using MICA motes. A trial using Motes technology was hosted in Newcastle with a pervasive intelligent corridor established by a network of fixed Motes on roads near Newcastle Central Station. Mobile Motes were also placed in several buses. Communication between a static node and a moving node on-board a vehicle was achieved, showing that communication can take place between road side and vehicles using a network of Motes. Evaluation of the system revealed that the main limitation of the technology at the present time is battery life. The experiments have demonstrated that Motes can be used for communication between a fixed infrastructure and a moving vehicle up to a speed of 50 mph. Further testing of the devices at higher speeds (60 and 70 mph) to asses the suitability of smartdust/Motes in applications alongside fast moving roads such as a motorway will be conducted.

Itstrackss_3The focus of the EU funded TRACKSS project is to research advanced communications concepts, open inter operable and scalable system architectures that allow easy upgrading, advanced sensor infrastructure, dependable software, robust positioning technologies and their integration into intelligent co-operative systems to support a range of core functions in the areas of road and vehicle safety and traffic management and control. The overall aim is to develop new systems for cooperative sensing and predict flows, infrastructure and environmental conditions surrounding traffic, with a view to improving road transport safety and efficiency. To support the demonstration phase of the project, Newcastle University will develop a new technology for ‘smart’ detection on vehicles and infrastructure and a common framework for data collection and access from the entire array of sensors being deployed and tested in the TRACKSS project.

ItsarchitectureIn the case of EMMA, the focus is automobiles and their constituent parts, and the infrastructure they utilize (both physical in the sense of roads and the ICT embedded in them for monitoring and control purposes). If we think more widely at present, most of the world’s computing power is already embedded invisibly into the things around us. The personal computers, music players and other gadgets are just the tip of the iceberg. They probably represent no more than 1% of the computing power we have deployed around us. A typical car today will have at least 20 microprocessors and a host of other electronics contributing to the general functionality required by a modern car as well as the ‘value added services’ which may be the unique selling point of a particular vehicle – whether the application, be: better information on how the vehicle is running; safety applications; or infotainment in the vehicle. The Embedded Middleware in Mobility Applications project (EMMA) application domain of transport will be taken as a pilot example where EMMA will foster cost-efficient ambient intelligence systems with optimal performance, high confidence and faster deployment. The MICAz Mote will be the best suitable platform for the EMMA project since it features sensing and networking capabilities with low power consumption.

The EMMA and TRACKSS projects being pursued by Newcastle University are committed to play a major role in creating new possibilities in the future ITS by using Mote technology. For more information on Crossbow's Mote platforms, contact sales or visit our website.

April 07, 2008

Programming with the .Builder Jedi

by Martin Turon, Director of Wireless Software, Crossbow Technology, Inc.

Martinturon_2 Today we are lucky enough to have a quick lesson in programming using Crossbow's Imote2.Builder kit with Crossbow's Director of Wireless Software and our resident Programming Jedi - Martin Turon. Not only an expert in the field of wireless sensor networks, Martin has been instrumental in simplifying the WSN user experience with advancements in interface and server tools using his background in video game design, mobile phone software and operating systems. He is the current Chair of the ZigBee WSN group which is working to establish the standard for low-power routing while leading the Wireless software development team at Crossbow for future product enhancement. Martin obtained degrees from University of California, Berkeley in Electrical Engineering and Computer Science. He has also studied Artificial Intelligence at University of California, Los Angeles and received a certificate in Math for Financial Engineering from Haas Business School. Martin is an avid lover of indie rock and performs with various ad-hoc musical projects.

Builderimote2 Embedded programming has historically involved pulling out your C compile, and writing detailed code that needs to carefully manage limited memory resources, hardware interrupts, and low-level bus interfaces. The benefits brought by newer high-level languages such as Java and C# have lagged entry into this space by about 5-10 years. The delay can be attributed to limits to memory and processing speeds within the space due to aggressive cost requirements, and a lack of tools and software support for embedded platforms compared to PC/server platforms. More recently, the J2ME and Windows CE platforms have made Java and C# respectively available to smart phone and PDA application developers. But both of these environments continue to limit the amount of control the developer has over low-level interrupts and hardware resources. The Microsoft .NET Micro environment that powers the Crossbow Imote2 .Builder kit allows programming an embedded device with C#, while providing native control over hardware resources such as the I2C, SPI, and UART buses. Programming a native IEEE 802.15.4 radio driver for example is possible in this environment, and the full source code for such an implementation is provided.

There are it seems endless sites that compare C# against Java. They can in many ways be considered the same language fundamentally, with C# being largely derived from its Java parent adding a few new keywords and constructs. The biggest difference comes with the libraries that the developer links to, which can be very different depending on the version and underlying platform that is chosen. C# does have one essential advantage however for the embedded developer, and that is native handling of unsigned types. In Java all variables are signed, so in order to manipulate a 16-bit ADC value for example one needs to jump through hoops:

// Java code to read little-endian unsigned 16-bit data: complex.
public short readShortLE() throws IOException {
     int w, wlo, whi;
     wlo = (0x000000FF & (int)super.readByte());
     whi = (0x000000FF & (int)super.readByte()) << 8;
     w = whi | wlo;
     return (short)w;
}

// C# code to read little-endian unsigned 16-bit data: simple.
public ushort readShortLE() {
    return super.readByte() | (super.readByte() << 8);
}

This example shows how much more intuitive and readable the embedded C# code is over Java due to the simple addition of ushort and uint types. Writing Java code that correctly handles unsigned types is actually fairly difficult to do, and the initial implementation of such code tends to have hidden bugs for certain portions of the data range.

In the following example, the start of a simple SPI-based sensor driver is presented. This driver sends low level commands over a SPI bus to a digital 3-axis accelerometer. The code shows how to initiate a SPI configuration and how to read and write registers over the bus. The example also includes creating a property API for accessing a particular register on the digital sensor, in this case Accel_X. On node conversions and intelligence can be easily written right into the driver within the property code block.

using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using Crossbow.platform.imote2;     
   
public
class AccelerometerSensor
{
    internal enum Reg : byte
    {
       // Control
       CTRL_REG1 = 0x20,
       CTRL_REG2 = 0x21,
       // Accelerometer Data Registers
       OUTX_L = 0x28,
       OUTX_H = 0x29,
       // ...More commands left out for brevity..
    }; 
        SPI                _spi;

    SPI
.Configuration _spiConfig;
       

    public void Initialize(SPI.Configuration spiConfig)
    {
       if (spiConfig == null)
       {
          _spiConfig = new SPI.Configuration(
              Pins.GPIO_PORT_SSP1_SFRM, // Chip select port
              false
, // Chip select active state
              20, // Chip select setup time
              20, // Chip select hold time
              false
, // Clock idle state
              true
// Clock edge
              986, // Clock rate KHz (986KHz)
              SPI
.SPI_module.SPI1 // SPI port connected to LIS3L02DQ
              );
       }
       else
       {
          _spiConfig = spiConfig;
       }
       try
       {
          _spi = new SPI(_spiConfig);
       }
       catch (Exception ee)
       {
          Debug.Print(ee.ToString()); 
       }
            
       // Power up, no decimation, no self-test, enable x/y/z

       WriteReg(Reg.CTRL_REG1, 0xC7);
       WriteReg(Reg.CTRL_REG2, 0x04);
       // Normal, continuous, little-endian, 4-wire,
       // right justified, enable data-ready
       
    } 


    internal
void WriteReg(Reg reg, ushort data)
    {
       byte[] write = new byte[] { (byte)reg, (byte)(data) };
       try {
          _spi.Write(write);
       }
       catch (Exception ee)
       {
          Debug.Print(ee.ToString());
       }
    }

    internal byte ReadReg(Reg reg)
    {
       byte[] read  = new byte[1];
       byte[] write = new byte[] { (byte)((int)reg | 0x80), 0 };
       try
       {
          _spi.WriteRead(write, read, 1);
       }
       catch (Exception ee)
       {
         Debug.Print(ee.ToString());
       }
       return read[0];
    } 

   
    public
ushort Accel_X
    {
       get {
          ushort accel_x = (ushort)ReadReg(Reg.OUTX_H) <<8;   
          accel_x |= (ushort)ReadReg(Reg.OUTX_L);
          return accel_x;
       }
    }
}

Moteplatformcomparison_7

The Imote2 hardware provides arguably the highest performance mote platform while retaining good power characteristics, dwarfing other platforms with regard to processing speed, and memory and flash size (click on the table for more details).

This capable hardware coupled with the simple C# environment of Visual Studio and the Microsoft .NET Micro framework results in higher developer productivity. Creating advanced WSN (wireless sensor network) applications and test beds that involve in-network processing, high-speed sampling, and logging has never been easier.

Buildermotepong The kit CD includes full C# source code for an Imote2 application that streams accelerometer data over the IEEE 802.15.4 radio. Two sample PC applications receive this data from an Imote2 base station and interpret it: MotePlot and MotePong. The former plots the real-time accelerometer data as a chart, and the later interprets the readings as control information to play a simple and familiar game.

To purchase a WSN-IMOTE2.Builder kit or receive further information on this platform, feel free to email Crossbow directly at sales@xbow.com. Additional details such as datasheets, manuals are available here on Crossbow's website. The Imote2.Builder simplifies and accelerates the design of wireless sensor applications. The level of performance and capability that the Imote2 brings to wireless sensor networks breaks the computational and memory limitations of current platforms by orders of magnitude for applications involving data-rich computations where there is a need for both high performance and high bandwidth.

Crossbow Technology. Copyright 2008. All Rights Reserved. Company | Wireless | Inertial Systems | ēKo | Contact Us | Privacy | Terms of Use