다음을 통해 공유


Windows 7: Building your own sensors

Windows 7 has a built in sensor and location platform, the key feature of this is any sensor devices connected to it become operating system level resources which any number of applications can utilise the data from. Up until now, sensor devices (like GPS) were ‘owned’ by the first application to grab them, and prevented any other application from accessing the device while running. That has all changed in Windows 7, but we are still waiting for sensor manufactures to update their drivers to fit with the new world of Windows 7.

So while they ponder, lets get on and do some cool stuff ourselves!

The MS Press book ‘Introducing Windows 7 for developers’ has a great couple of chapters on the new sensor and location platform – chpr 9 and 10. These make excellent reading to help you understand just how everything works. Luckily for us, just before Christmas, Donn Morse posted a create article and sample on Coding4fun – so we can utilise Donn’s excellent work to make our custom sensors.

In the article, Donn uses the veritable Parallax Basic Stamp 2 as the intermediary between sensors and the Windows 7 machine. The Basic Stamp is well suited to utilising the range of cheap I2C based sensor devices that have been the main stay of homebrew and professional robotics development for decades.

The sample project includes Windows application, Windows 7 sensor driver and Basic Stamp firmware for linking up a motion detector, but also supports a compass sensor, a 2 axis accelerometer, and a ultra-sonic distance sensor. These devices are all inexpensively available from my good friends at Devantech – who also have USB to I2C interface modules including wireless versions. Using these interface modules obviously cuts out the need for a Basic Stamp 2 but requires the Sensor driver to do all the direct sensor work. I shall explore these options over the next few weeks and let you know how I get on!

I know many of you will think the Basic Stamp 2 is somewhat old hat and have been enjoying the more modern delights of the Arduino devices. As the Arduino development boards use USB rather than RS232 to communicate with the PC. Donn comments in his post that he is working with Brian Jepson to create a driver that works with the Arduino – so we can eagerly await this update.

Donn’s Windows application uses the Windows7.SensorAndLocation DLL from the Windows 7 Code Pack which is also available as a free download and includes the source.

Donn explains the detail of the implementation in his article included with the sample download. Based on the Sensor and Location SDK Skeleton driver example, Donn upgrades this hardware emulating driver to use real hardware based on RS232 communications.

The whole project is an interesting read if only to educate yourself more on the capabilities of Windows 7 – but for all of us tinkerers it facilitates another fun project and adds a bucket load of ideas to the task list. I really recommend it to you!

Comments

  • Anonymous
    March 08, 2011
  1. The article requires a clear intorduction that provides the reader with a clear overview on what the article is going to address.
  2. The terms used are quiet technical, for a person without a technology background, it will be difficut for them to read and understand the objective of the article.
  • Anonymous
    March 08, 2011
    1.The article is very technical
  1. it needs a better introduction paragraph
  2. It doesn't grab the readers attention
  • Anonymous
    March 12, 2011
    First, the title of this article is not appealing. The writer assumes a certain level of technical knowledge (level 200+) of the reader which is dangerous. Too many technical jargons. The writer does not provide enough differentiation on different sensory devices. The way this article is written one of the major improvement of Win 7 from a developer's point of view is not exciting even for a developer to read further this article.

  • Anonymous
    March 14, 2011
    Very technical articles, looks very boring to a large audience even those who are technical! here are some feedbacks :

  • Bad introduction or even no introduction in the article.
  • Very technical and does not animate the reader,
  • Luck of simplicity, dense sentences with non semantic
  • Non structured paragraphs
  • Anonymous
    September 25, 2011
  • complete lacking introduction
  • very focussed on a technical audience