ultrabook + sensorsAPI (ie 3d compass)

ultrabook + sensorsAPI (ie 3d compass)


(I hope this is a good place to ask this kind of support question)

I've fully implemented an asynchronous sensors api testing app.  currently i'm trying to read the compass: aka


and I find I'm getting erroneous data.  I orient the laptop in various cardinal directions.  I do not seem to get a reliable 360 degrees of bearing. mostly I get 60-180 (always positive, but I can get almost all 360 values if I twist it around quickly).  If I tilt the UB upright (keyboard perpendicular to the floor)  then for a moment, with the key's facing north, I get a correct bearing..however with a small amount of yawing back and forth, there is an obvious drift such that after a few seconds, north is now 5% to the west.  If I continue yaw'ing back and forth, the drift persists until 0 degrees (ergo the keyboard) is fully facing west.   I don't seem to ever get correct bearing results when the UB is sitting flat.

Is the UB compass truly this unreliable? Or perhaps the UB Intel sent me is faulty? Is there some kind of ongoing calibration I'm supposed to do?  I haven't found anything online or in intel/microsoft sensor API docs that cover this kind of drift error.  I would expect the compass to "just work"(tm).

Thank you for any info, suggested reading, or direction you offer. 



6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Ken,

Compass reading is not very accurate. Knowing this problem, Windows 8 came up with other alternatives thorugh Sensor Fusion. You might need to use Gyroscope in combination with compass. Refer this nice blog on this topic.


can these compas incorporatable in embedded applications?

Thank you for the comments.  Further research resulted in me discovering that my reference intel UB only seems to output two axises of magnometer readings.  X & Y.  Z is always zero.  I haven't had time to look further lately so kind of shelved it. Now that actual consumers are buying UBs I was going to try out my software on a friends machine to see if his 'just works'. 

I like the sensor fusion idea.  I'll dive into that when I get the chance.  It makes sense. I'm not using any MS libs. I'm accessing the sensors directly using COM.

And to Ponram, not quite sure what you mean.. I have worked on an embedded (PIC32) device/application using a compass+aceelerometer communicating over I2C but that's not for this forum.  My problems here relate to NOT getting my ultrabook's sensors to output anything other than garbage data. My goal is to have my own .LIB to use in windows 7/8 apps.   I code everything in native c++. 

so, I'm still unresolved. not sure if the laptop is not functioning correctly because I dont have a test app to confirm the hardware does work properly, or if it's my code.  very frustrating.

I am having fun with the video camera and image analysis however in the mean time :) but that's another story :)

Hi, the ultrabook have an accelerometer incorporated

Hi JudLup,

Are you spending your day adding single line comments to every thread?  Please add something helpful if you post.


Leave a Comment

Please sign in to add a comment. Not a member? Join today