This experiment is my first foray into the “internet of things” space using the Galileo Gen 1 board I got back in September. I decided to read the temperature in the room with a TMP36 thermometer sensor and then ultimately feed those readings into Azure. This is the first blog post outlining the steps to build a thermometer sensor out of your Galileo. There will be subsequent posts outlining the connection into Azure, so stay tuned!
If you’re interested in learning more about Windows for Devices, you can visit the portal here. From there, you can sign up for the preview program and learn more about it.
- A Galileo Gen 1/Gen 2 board running the latest Windows for Devices image(as of this writing is 141114-1440)
- TMP36 Thermometer component – link
- 5 breadboard jumper wires
- A LAN cable for connecting to the Galileo from your PC for debugging remotely from Visual Studio
- Visual Studio 2013 Community Edition with the latest Windows for Devices SDK
First things first, if you have a Galileo board and haven’t set anything up yet, I recommend the setup tutorials on the portal before you get started here – http://ms-iot.github.io/content/. Make sure you install the latest Windows image!
Take a look at the diagrams below to learn how to wire up the temperature sensor.
Now that you have that all wired up, it’s time to write some code to read from the sensor.
There are three steps that are critical to getting an accurate temperature reading –
- Reading the analog signal from the TMP36 Vout pin, which in my case, is connected to A0, or analog pin zero, on my Galileo – the raw signal has a resolution of 10 mV / degree centigrade and a 500 mV offset for negative temperatures – source
- Converting the analog reading to a voltage value – it is critical to know the operating voltage of the sensor. For this example, I am using 5.0 V.
- Converting that voltage to Celsius
Code for these steps
We’ll use these methods in our sketch loop to read and convert the values.
The code for the project is part of an overall solution to hook into Azure Event Hubs – you can get the complete solution from GitHub – https://github.com/Foxman13/AzureEventHubsDemo