TinyOS: Operating System Design for Wireless Sensor Networks
May 1, 2006 By: PhD , David E. Culler, PhD, Arch Rock Corp. SensorsMeet the OS designed to ease development of robust software applications for wireless sensor networks.
TinyOS has been adopted by thousands of developers worldwide, on many platforms, for a broad range of wireless sensor networks. Its communication-centric design and modular software model are tailored to the unique requirements of these networks, where applications and services are distributed over collections of resource-constrained, unattended application-specific devices streaming data to and from the physical world. From its roots in the academic research community, it is emerging as an important vehicle for commercial deployments.
The role of any operating system (OS) is to promote development of reliable application software by providing a convenient and safe abstraction of hardware resources. In PCs and servers, the OS allocates application processing threads to processors, maps virtual addresses to locations in memory, and manipulates disks, networks, and peripherals on the application's behalf.
![]() |
This OS/application division—essential in conventional computing—is less common in the embedded world of sensing and control, where applications are tightly bound to particular hardware and weave in high-level logic with manipulation of the physical apparatus. This is due to very limited hardware resources; highly specialized applications; and long, stringent, development cycles often dominated by mechanical and other factors.
Wireless sensor networks (WSNs) are embedded but general-purpose, supporting a variety of applications, incorporating heterogeneous components, and capable of rapid deployment in new environments. Wireless networking requires greater concurrent processing than wired protocols; while a WSN node is carrying out its normal data acquisition and processing steps, it also needs to service protocol events and packet transfers that arise asynchronously from the network. However, hardware resources remain diverse and constrained, especially in terms of memory and power. A sample of WSN platforms is shown in Figure 1. A typical TinyOS 'mote' platform has 10 KB of RAM, 100 KB of ROM, and consumes 10 μA to 25 mA, depending on which components are active.
![]() Figure 1. Comparison of TinyOS platforms |
TinyOS was designed specifically for WSNs. It introduces a structured event-driven execution model and a component-based software design that supports a high degree of concurrency in a small footprint, enhances robustness, and minimizes power consumption while facilitating implementation of sophisticated protocols and algorithms. The system and its services comprise components connected with well-defined interfaces, much as a schematic wires hardware blocks together. The diversity of hardware platforms, protocols, and applications is addressed by plugging together the necessary components from a catalog of candidates.
TinyOS Design
Resource Constrained Concurrency. Concurrency is a key system software challenge. The system manages several devices, e.g., ADCs, sensors, Flash memory, and radio. Typically, an operation is started on a device, which then runs concurrently with the main processor until generating a response. Meanwhile, other devices may also need service, requiring the system to juggle several event streams. A conventional OS uses multiple threads, each with its own stack. The thread dedicated to a device issues a command and then sleeps or polls until the operation completes. The OS switches among threads by saving and restoring their registers, and threads coordinate with others by using shared variables as flags and semaphores. This works for complex software on powerful machines but is problematic for embedded designs because multiple stacks must be kept in memory and each thread can potentially interact with any other whenever it accesses a shared variable. This can lead to subtle race conditions and deadlocks, requiring complex schedulers to meet real-time requirements and deadlines.
Event-driven execution is common in embedded systems because it permits a small footprint and more control over scheduling. A single stack supports many concurrent activities. The system is organized around a dispatcher that calls specific event-handlers, depending on the event type and the state of the system. Each handler takes immediate action (e.g., accessing a device) and updates the system state. Later events trigger subsequent operations. The drawback is that even small changes may require the developer to understand and possibly modify the overall structure, making code reuse, customization, and incremental evolution difficult.
1 2 3 4 5
| sensorsonline: Do you subscribe to Sensors Weekly? If not, you might have missed these articles today http://t.co/YrbicBsi #sensorsweekly | |
| sensorsonline: Do you subscribe to Sensors Weekly? If not, you might have missed these articles today http://t.co/YrbicBsi #sensorsweekly | |
|
|
|
| sensorsonline: February R&D Round Up: This month's examples of clever and useful sensor research includes smart paint to monito... http://t.co/oTsU3EBx | |
| sensorsonline: February R&D Round Up: This month's examples of clever and useful sensor research includes smart paint to monito... http://t.co/oTsU3EBx | |
|
|
|
| sensorsonline: Will Tu: http://t.co/77KHZndE | |
| sensorsonline: Will Tu: http://t.co/77KHZndE | |
|
|
|
| sensorsonline: Quake Global Receives Certification for Q4000 Modem: The Q4000 is the first fully integrated, dual-mode modem fo... http://t.co/YzLgOtjg | |
| sensorsonline: Quake Global Receives Certification for Q4000 Modem: The Q4000 is the first fully integrated, dual-mode modem fo... http://t.co/YzLgOtjg | |
|
|
|
| sensorsonline: Tiny Black Box Detects Electric Power Crashes: New tiny electronic instrument detects and records power glitches... http://t.co/Pe6sbivL | |
| sensorsonline: Tiny Black Box Detects Electric Power Crashes: New tiny electronic instrument detects and records power glitches... http://t.co/Pe6sbivL | |
|
|
|
| sensorsonline: Libelium Offers e-Learning Platform for Sensor Networks: New e-Learning platform enables system integrators worl... http://t.co/TOCQclaS | |
| sensorsonline: Libelium Offers e-Learning Platform for Sensor Networks: New e-Learning platform enables system integrators worl... http://t.co/TOCQclaS | |
|
|
|
| sensorsonline: Schneider Electric To Expand Collaboration With Cisco: Introduces new solutions for comprehensive building and d... http://t.co/GoZvqLRT | |
| sensorsonline: Schneider Electric To Expand Collaboration With Cisco: Introduces new solutions for comprehensive building and d... http://t.co/GoZvqLRT | |
|
|
|
| sensorsonline: RT @SensorsExpo: #sensors12 digital brochure is here! download it at http://t.co/LFe7twTj OR register w/code 602K for the lowest rates h ... | |
| sensorsonline: RT @SensorsExpo: #sensors12 digital brochure is here! download it at http://t.co/LFe7twTj OR register w/code 602K for the lowest rates h ... | |
|
|
|
| sensorsonline: Seen and Heard: Articles and postings about Sensors Expo & Conference in blogs, news sites and publications read more http://t.co/rZCFxDoS | |
| sensorsonline: Seen and Heard: Articles and postings about Sensors Expo & Conference in blogs, news sites and publications read more http://t.co/rZCFxDoS | |
|
|
|
| sensorsonline: Sensor and System Design Track: Sensor and System Design Track read more http://t.co/Sz29WxXv | |
| sensorsonline: Sensor and System Design Track: Sensor and System Design Track read more http://t.co/Sz29WxXv | |
|
|
|
| sensorsonline: Soitec and Sumitomo Electric Announce GaN Milestone: The strategic joint developed program has successfully demo... http://t.co/DH4MFCBG | |
| sensorsonline: Soitec and Sumitomo Electric Announce GaN Milestone: The strategic joint developed program has successfully demo... http://t.co/DH4MFCBG | |
|
|
|
| sensorsonline: Imec, Genalyte Report Disposable Silicon Biosensor Chips: The disposable silicon photonics biosensor chips will ... http://t.co/Y22O3Bwf | |
| sensorsonline: Imec, Genalyte Report Disposable Silicon Biosensor Chips: The disposable silicon photonics biosensor chips will ... http://t.co/Y22O3Bwf | |
|
|
|
| sensorsonline: Peter Himes: Peter Himes has over 25 years' experience in helping startups and public companies establish their ... http://t.co/483WVNWS | |
| sensorsonline: Peter Himes: Peter Himes has over 25 years' experience in helping startups and public companies establish their ... http://t.co/483WVNWS | |
|
|
|
| sensorsonline: RT @MDT_Sensor_News: Announcement to our new magnetic switch #sensors reposted at @sensorsonline, http://t.co/0QoriRIo | |
| sensorsonline: RT @MDT_Sensor_News: Announcement to our new magnetic switch #sensors reposted at @sensorsonline, http://t.co/0QoriRIo | |
|
|
|
| sensorsonline: Catch the latest Sensors Prod Picks featuring @Kionix @BoschSensortec @Dynasonics @InvenSense http://t.co/vGQvTtyh #sensorsmag | |
| sensorsonline: Catch the latest Sensors Prod Picks featuring @Kionix @BoschSensortec @Dynasonics @InvenSense http://t.co/vGQvTtyh #sensorsmag | |
|
|
|
| sensorsonline: RT @SensorsExpo: #sensors12 welcomes these exhibitors @KamanIndustrial @Sika @InfinitePower @Xeno @MEDERelectronic @Interplex @HBM @Sens ... | |
| sensorsonline: RT @SensorsExpo: #sensors12 welcomes these exhibitors @KamanIndustrial @Sika @InfinitePower @Xeno @MEDERelectronic @Interplex @HBM @Sens ... | |
|
|
|
| sensorsonline: You Can’t Manage What You Can’t Measure: Turning Sensor Data into ROI: read more http://t.co/dPKhTgLZ | |
| sensorsonline: You Can’t Manage What You Can’t Measure: Turning Sensor Data into ROI: read more http://t.co/dPKhTgLZ | |
|
|
|
| sensorsonline: Speaker Marketing Tool Kit: Marketing Tool Kit for speakers selected to present at the 2012 event. read more http://t.co/TST8jMpA | |
| sensorsonline: Speaker Marketing Tool Kit: Marketing Tool Kit for speakers selected to present at the 2012 event. read more http://t.co/TST8jMpA | |
|
|
|
| sensorsonline: Pondering Parking: One of the promises of wireless sensor networking is its ability to add a level of sensing an... http://t.co/s12IH4Ha | |
| sensorsonline: Pondering Parking: One of the promises of wireless sensor networking is its ability to add a level of sensing an... http://t.co/s12IH4Ha | |
|
|
|
| sensorsonline: IMUs/AHRS from YEI Technology: The 3-Space Sensor family of intelligent IMUs and AHRS from YEI Technology, Ports... http://t.co/OqklJSKs | |
| sensorsonline: IMUs/AHRS from YEI Technology: The 3-Space Sensor family of intelligent IMUs and AHRS from YEI Technology, Ports... http://t.co/OqklJSKs | |
|
|
|
| sensorsonline: Photoelectric Sensors from Pepperl+Fuchs: Pepperl+Fuchs Inc., Twinsburg, OH, has expanded its ML4.2 Series of su... http://t.co/P6fvyrKf | |
| sensorsonline: Photoelectric Sensors from Pepperl+Fuchs: Pepperl+Fuchs Inc., Twinsburg, OH, has expanded its ML4.2 Series of su... http://t.co/P6fvyrKf | |
|
|
|
| sensorsonline: Wall Shear Stress Sensors from Lenterra: RealShear sensors from Lenterra Inc, Newark, NJ, are inline sensors tha... http://t.co/i3CUF2JR | |
| sensorsonline: Wall Shear Stress Sensors from Lenterra: RealShear sensors from Lenterra Inc, Newark, NJ, are inline sensors tha... http://t.co/i3CUF2JR | |
|
|
|
| sensorsonline: 3D Metrology Software from InnovMetric: InnovMetric Software Inc., Quebec City, PQ, Canada, offers its V12.0.3 P... http://t.co/lMoTasYo | |
| sensorsonline: 3D Metrology Software from InnovMetric: InnovMetric Software Inc., Quebec City, PQ, Canada, offers its V12.0.3 P... http://t.co/lMoTasYo | |
|
|
|
| sensorsonline: RT @SensorsExpo: Registration is now live for 2012 Sensors Expo & Conf. Register w/code 602K for the lowest 2012 rates: http://t.co/q0yR ... | |
| sensorsonline: RT @SensorsExpo: Registration is now live for 2012 Sensors Expo & Conf. Register w/code 602K for the lowest 2012 rates: http://t.co/q0yR ... | |
|
|
|
| sensorsonline: January R&D Round Up: Welcome to 2012! As we start the new year, how about some intriguing research breakthroug... http://t.co/48NNA24d | |
| sensorsonline: January R&D Round Up: Welcome to 2012! As we start the new year, how about some intriguing research breakthroug... http://t.co/48NNA24d | |
|
|
|
| sensorsonline: 01-Jan-2012: 01-Jan-2012 read more http://t.co/N7p9u6Fc | |
| sensorsonline: 01-Jan-2012: 01-Jan-2012 read more http://t.co/N7p9u6Fc | |
|
|
|
| sensorsonline: Molly Bakewell Chamberlin: Molly Bakewell Chamberlin is President of Embassy Global LLC. http://t.co/23PIOzFU | |
| sensorsonline: Molly Bakewell Chamberlin: Molly Bakewell Chamberlin is President of Embassy Global LLC. http://t.co/23PIOzFU | |
|
|
|
| sensorsonline: Happy New Years! Make one of your resolutions to stay on top of industry news w/ @sensorsonline - sign up today at http://t.co/LFI8n1zU | |
| sensorsonline: Happy New Years! Make one of your resolutions to stay on top of industry news w/ @sensorsonline - sign up today at http://t.co/LFI8n1zU | |
|
|
|
| sensorsonline: What's New at Sensors...System Solutions for Industrial Sensors/Field Transmitters...and more http://t.co/n7speoxH | |
| sensorsonline: What's New at Sensors...System Solutions for Industrial Sensors/Field Transmitters...and more http://t.co/n7speoxH | |
|
|
|
| sensorsonline: Happy Holidays from the Sensors Team to Yours http://t.co/taoAX06L #happyholidays #sensorsmag #sensorsexpo #sensors12 | |
| sensorsonline: Happy Holidays from the Sensors Team to Yours http://t.co/taoAX06L #happyholidays #sensorsmag #sensorsexpo #sensors12 | |
|
|
|
| sensorsonline: December Product Picks avail now at http://t.co/09v3hVAT. See New Sensors, Components, and Data Acquisition & Control Products #sensorsmag | |
| sensorsonline: December Product Picks avail now at http://t.co/09v3hVAT. See New Sensors, Components, and Data Acquisition & Control Products #sensorsmag | |
|
|
|
| sensorsonline: RT @sherbornesensor: Great article in @sensorsonline 'MEMS: The Future Looks Bright' http://t.co/x0fjxBhz | |
| sensorsonline: RT @sherbornesensor: Great article in @sensorsonline 'MEMS: The Future Looks Bright' http://t.co/x0fjxBhz | |
|
|
|
| sensorsonline: Sensors Weekly is available here: http://t.co/cZSkJcxr. Catch the latest R&D Round Up and sensors news #sensorsnews #sensorsmag | |
| sensorsonline: Sensors Weekly is available here: http://t.co/cZSkJcxr. Catch the latest R&D Round Up and sensors news #sensorsnews #sensorsmag | |
|
|
|
| sensorsonline: triaxial accelerometers, chlorine sensors, thermal imagers & more products can be found in this week's Product Picks http://t.co/WS50rlEX | |
| sensorsonline: triaxial accelerometers, chlorine sensors, thermal imagers & more products can be found in this week's Product Picks http://t.co/WS50rlEX | |
|
|
|
| sensorsonline: Oct issue of What's New at Sensors is now live at http://t.co/z89lKgKU #potentiometers #positionsensing #sensorsmag | |
| sensorsonline: Oct issue of What's New at Sensors is now live at http://t.co/z89lKgKU #potentiometers #positionsensing #sensorsmag | |
|
|
|




