Measuring IoT pulse widths with new GPIO APIs

Download this episode

Download Video

Download captions

Download Captions


The Windows 10 Creators Update comes with new GPIO APIs which enable accurate and efficient measurement of pulse widths. Some devices that benefit are the DHT11/DHT22 temperature and humidity sensors, and certain sonar/distance sensors. We added the Windows.Devices.Gpio.GpioChangeReader class which lets you capture timestamps when a GPIO pin changes state, which you can then use to determine the time between change events.



Available formats for this video:

Actual format may change based on video formats available and browser capability.

    The Discussion

    • User profile image

      Hi Windows IoT team,


      I'm developing UWP IoT apps and using Windows 10 IoT for almost its inception and has saw its progress these past years. Early this year, I started commercializing my hardware builds and its apps but recently I am in having hard time with what I can say "a critical" bug relating to date/time drifting with Windows 10 IoT. I am maintaining 43 RPi's so you can imagine fixing them all - all the time. I am aware Rpi's doesn't have built in RTC and I don't really as much as possible to put every single Rpi's an RTC modules as its not practical and expensive. What I don't accept is that these drifts happen as frequent as less than an hour. From Anniversary update, Creators update till my 3 Insider build Rpi's.

      I sent numerous feedback both via the feedback hub app and in the website but no one really answer me. I hope you guys had time to respond and just check out these issue.

      One of my apps control lights and these both relies to the time of sunset and sunrise (which work together with a light sensor for extra validation). Imagine how these apps relies heavily on time. It's ok to have drifts of less than 10 mins for me or drifts that occur after 3-6 months of 24/7 operation but please not as less as an hour! not to mention these drifts starts at 1 hour delay to more than 24 hours if I don't manually set the date/time in ps console.

      Thank You.



    • User profile image

      Nice work streamlining your code and process :)

    • User profile image


      When connected, an IOTCore device will sync the time periodically, using Windows Time NT service and a time server. You can configure the time server via w32tm if needed.
      There's a similar question/response here.
      However, I suspect your scenario is different. Can you send me your previous feedback post and any additional details to my email: msaleh (*at)
      Mahmoud Saleh
      Windows IoT Team

    Add Your 2 Cents