In the previous post I outlined connecting our temperature/humidity sensor to a Raspberry Pi and taking a reading from it. The next step is to send that data to the cloud and make use of it in Power BI.
Here’s a basic outline of the process
Of course, Power BI isn’t the only thing you could use this data for, though our goal is to add this temperature reading to the Power BI dashboard in our office.
His temperature sensor setup is a lot more complicated than mine – it looks like he’s taking the binary values from the sensor and working out the temperature value. In our case, we had a great library from Adafruit that did all of that for us.
Compared to other IoT projects, this one is extremely simple. We’re not making use of Event Hubs or Stream Analytics or any of the high scale, high performance tools in Azure. We’re just sending a temperature and humidity value to Azure Table Storage once a minute, then connecting to that data via Power BI Desktop.
Firstly, you’ll need to install the Azure SDK on the Raspberry Pi to make use of the Azure services, check the linuxruninstructions.txt in Rakesh’s Python source file download for instructions on this.
Most of the code relevant to Azure is located in the azuremodule.py file. I learnt a lot about the Azure Python SDK by reading and modifying this script file.
If you’re setting this up yourself, you’ll need to sign up for Microsoft Azure (free trials are available), create a storage account, and add the storage account name and primary key into the sample code.
After a little bit of tweaking, I was able to get it to work using the Adafruit library to retrieve the values from my sensor and upload it to my Azure Table Storage account every 60 seconds.
Once you’re collecting data, you can use the Power BI Desktop App to pull this data into your dashboards for reporting. As I’m testing it, I created a new dashboard for these temperature/humidity values.
//gcits.com.au/wp-content/uploads/GCITSlogowordpress.png00Elliot Munro//gcits.com.au/wp-content/uploads/GCITSlogowordpress.pngElliot Munro2015-09-13 23:34:462015-09-13 23:57:00Sending our Temperature data to the cloud for Power BI