Click here to Skip to main content
13,732,335 members
Click here to Skip to main content
Add your own
alternative version


6 bookmarked
Posted 6 Nov 2012
Licenced CPOL

Reading Ultrabook Sensor Data with the Windows 8 Sensor API

, 6 Nov 2012
Rate this:
Please Sign up or sign in to vote.
A head start for App Innovation contestants


Note: This is not a complete article. It is shared for the purpose of helping App Innovation contestants get started with Ultrabook sensor manipulation. As my schedule allows, I will add detail to the article.

The Windows 8 Sensor API makes communication with the Ultrabook's sensors a snap.


The Ultrabook includes several physical solid-state sensors as well as a few virtual sensors that are abstracted through the API.

How It Works

The application consists of a single-form Windows Forms application that updates the user interface in real-time with current sensor data. A background thread subscribes to sensor class events and collects sensor data. The UI thread updates the UI periodically with the data collected by the sensor thread.

To obtain sensor data, call the static GetDefault() method of the appropriate class, set properties as necessary, and subscribe to available events (ReadingChanged is typically available).

The user interface uses a custom Metro-style-style group-box control.

Points of Interest

  1. I have been unable to get GPS sensor data from the Intel Ultrabook. From what I can tell, it either:
    1. doesn't have GPS or it's not enabled
    2. doesn't have an antenna
    3. doesn't include working drivers
  2. I have been unable to get near-field communication (NFC) working. I have only tried to sense NFC tags (containing the Mifare Ultralight chip).
  3. Use of the API in desktop applications requires a reference to the Windows 8 runtime. This requires a bit of mucking about in Visual Studio.
  4. If Windows 8 is not present, the application will fail with a TypeLoadException before even reaching Main().
  5. The location API appears to use some standard accuracy values, from which we can infer the sensor being used:
    1. 1000m == IP address geolocation
    2. 100m == WiFi database geolocation
    3. < 85m == GPS geolocation
  6. I don't know if all of my units of measurement are correct.
  7. 1G is equal to an acceleration of 9.81m/s² or a force of 9.81N/kg.

If you have additional information to share, please contact me. If you found this useful, please cast a vote.


  • 2012-11-06 – Original article


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Yvan Rodrigues
Systems Engineer Clearpath Robotics
Canada Canada
Yvan Rodrigues has 25 years of experience in information systems and software development for the industry. He is Senior Systems Developer at Clearpath Robotics

He is a Certified Technician (C.Tech.), a professional designation granted by the Institute of Engineering Technology of Ontario (IETO).

Yvan draws on experience as owner of Red Cell Innovation Inc., Mabel's Labels Inc. as Manager of Systems and Development, and the University of Waterloo as Information Systems Manager.

Yvan supports open-source software. He is a committer for SharpKit (C# to Javascript cross-compiler) and WebIssues (Issue/Ticket Management System), TinyMCE (JavaScript editor), and contributes to MySQL, Ghostscript, iTextSharp, Bacula, FreeBSD, and Xamarin.

You may also be interested in...


Comments and Discussions

QuestionUsing an external GPS as a location sensor Pin
John Mechalas8-Feb-13 10:13
memberJohn Mechalas8-Feb-13 10:13 
QuestionMY VOTE OF 5 Pin
Abhishek Nandy7-Nov-12 16:58
memberAbhishek Nandy7-Nov-12 16:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web05-2016 | 2.8.180920.1 | Last Updated 6 Nov 2012
Article Copyright 2012 by Yvan Rodrigues
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid