John Johnston
Published © GPL3+

Temperature and Humidity from Pi to Power BI

In this POC (proof of concept) we will collect humidity and temperature information and perform analytics using Power BI.

IntermediateShowcase (no instructions)2 hours5,131
Temperature and Humidity from Pi to Power BI

Things used in this project

Hardware components

Raspberry Pi 2 Model B
Raspberry Pi 2 Model B
×1
DHT11 Temperature & Humidity Sensor (4 pins)
DHT11 Temperature & Humidity Sensor (4 pins)
×1

Software apps and online services

Microsoft Azure
Microsoft Azure

Story

Read more

Schematics

From Pi to Power Bi

Instruction and tutorial for building entire POC environment

Pinout

Code

Python send to Azure

Python
#!/usr/bin/python

from azure.servicebus import ServiceBusService
import datetime
from datetime import datetime
import random
import sys
import Adafruit_DHT
import time


key_name ="RootManageSharedAccessKey"
key_value="-yourkeyhere-"
sbs = ServiceBusService("proarchiottest", shared_access_key_name=key_name, shared_access_key_value=key_value)
sbs.create_event_hub('proarchiot2')
print 'Press Ctrl-C to quit.'
while True:
	humidity, temperature = Adafruit_DHT.read_retry(11, 4)
	temp = {"Temperature":float(temperature * 9/5.0 + 32),'Humidity':float(humidity)}
	print(temp)
	sbs.send_event('proarchiot2', {'DeviceID':'UAV1','Temperature':float(temperature * 9/5.0 + 32),'Humidity':float(humidity)})
	time.sleep(5)

Credits

John Johnston
1 project • 7 followers
Thanks to John Johnston, Robert Hosea, and Sowrirajan Narayanan .

Comments