Sensor Networks For Dummies
A new Sun initiative aims to make the programming of sensor networks easy – ushering in an era of widespread adoption.
Sun Microsystems has announced a project that could put easy-to-manage sensor networks in the hands of average computer programmers worldwide – helping to make networked sensors more prevalent. A world full of sensors is a world in which, for instance, building climates are micro-controlled, rooms come alive with lights and music when people enter them, and the health of elderly family members is monitored from a distance.
In May, the company will begin selling its own sensor hardware – gadgets the size of a small deck of cards that can be configured to sense temperature, light, and motion – as well an operating system that uses the common computer language Java, which already has a programmer “base” of over four million people. According to the company, this sensor development kit, called Sun SPOT (Small Programmable Object Technology), could create innovative sensor applications and accelerate solutions some of the lingering challenges –- such as developing and debugging sensor programs – that so far have kept the technology from being ubiquitous.
[Click here for images of a Sun SPOT sensor and its components.]
Sensor networks are collections of nodes, sometimes as small as millimeters in length or diameter, that consist of small computer processors, memory devices, and radios that transmit and receive information between devices. These networks hold much promise for performing tasks such as monitoring and regulating the harsh environments in industrial plants, controlling home and office climates (see Where Sensors Make Sense), and tracking the condition of packages.
Much research in this field has been conducted over the past few years (see 10 Emerging Technologies That Will Change the World), from companies including Sun, Intel, and Siemens, to academic programs at the University of California at Berkeley and Los Angeles and Harvard University, to name a few. And startups, such as Ember and Crossbow Technology, sell the technology for applications ranging from automobile diagnostics to battlefield monitoring.
Even with so much attention, though, present-day sensors remain notoriously difficult to develop and debug, says Roger Meike, senior director at Sun Labs. For the most part, fiddling around with a sensor’s functionality remains a specialized task, left to computer science experts.
Programming sensors is so hard partly because many of them use an operating system called TinyOS. Although it’s the software foundation for thousands of sensor research projects, it requires knowledge of the relatively complex programming language C. Worse, once a TinyOS program is established for a sensor network, it’s more or less permanent, explains Mani Srivastava, an electrical engineer at UCLA. If you want to modify a small part of the network’s function, he says, you have to start over. Additionally, each detail of the sensor must be painstakingly considered when programming, from when power should be conserved to how many calculations to do before the data is sent over the network.
Java – a programming language developed at Sun in 1990 – presents some clear advantages, says Roger Meike, senior director at Sun Labs. For one, it’s well known to a huge community of programmers, and it has already been successful in applications for other small devices such as cell phones.
But unlike in cell phones, Java for Sun SPOT sensors, called Java 2 Micro Edition, runs directly on the hardware and acts as an operating system. This means that Java programmers can write a program, load it onto the device, run it, and debug it, with basic programming knowledge of Java, Meike says. The hardware and software are designed to work together, he says, which allows the Java sensors to be easily reconfigured to different tasks, unlike TinyOS. Java also manages power resources well, according to Meike, an important feature, since some sensors need to be on at all times. “Java is in control over a small battery and it can be very smart about when to put the system to sleep,” he says.
Sun SPOT’s Java runs directly out of flash memory, a type of storage that doesn’t use as much power as RAM memory. This reduces the need for vigilance about how to best allocate resources. Moreover, the Java platform allows applications to be halted in mid-operation and relocated to another device, explains Meike, “So you can imagine if the battery dies on one device, you can move your application to another.”
This mobility feature is especially important for debugging the sensor hardware and software, which “is very much a nightmare,” says Srivastava, who has developed a sensor operating system at UCLA called SOS. “Bugs can really bring something down,” he adds. Therefore, it’s useful to be able to transfer a malfunctioning application to a computer where it can be fixed, something Sun SPOT is capable of doing.
But Srivastava also notes that Java is a “heavy” programming language, meaning it requires more memory than TinyOS or SOS. Indeed, Sun’s new sensors require a 32-bit central processing unit, as opposed to the 8-bit sensor processors that can run TinyOS. In addition, Sun’s sensors have 512 kilobytes of RAM, 4 megabytes of flash memory, a 2.4 gigahertz radio, and a USB interface -– making them veritable goliaths compared to most sensors.
But large sensors could be useful, says Matt Welsh, computer science professor at Harvard. “It’s clear that in any real application, you’re going to end up with a diverse population of devices,” he says. “You might have a large number of very low power wireless sensors, but you also need devices that can collect information, do processing, and aggregate data. The Sun SPOT device looks like it could be a nice candidate for that wireless device.” However, it is unlikely, he says, that Java will replace TinyOS or SOS for the smallest sensors.
Sun’s Meike expects that processors, memory devices, and radios will continue to shrink and Sun’s sensors won’t be so large in a couple of years. “The trends are telling us that these devices are going to get more capable,” he notes. In the meantime, Meike says, the clever applications that Java programmers will devise will be ready for future generations of smaller sensors.
Meike believes that playing around with sensors will offer a compelling experience for Java hobbyists and students. “This means that Java programmers can have a device that fits in the palm of their hands,” he says. “Instead of programming desktop computers, they can program the whole world.”
Learn from the humans leading the way in intelligent machines at EmTech Next. Register Today!
June 11-12, 2019