Raspberry Pi Sensor IoT Project

Raspberry Pi Sensor Data Stream to Azure IoT Hub with Python

I started this project because it was always hot in my apartment room and I always wondered what the temperature was. The project consists of a DHT11 temperature and humidity sensor connected to a Raspberry Pi. Using a basic program, it can read and output the room’s temperature and humidity. I wanted to incorporate my project with what I am learning and passionate about so I extended the project where I could stream the temperature to Azure IoT Hub and visualize the real-time data using Stream Analytics and Power BI.

1.) Setup Raspberry Pi 3B / DHT11 Sensor
Using Pin GPIO pin 17 to read data from the sensor
2.) Create IoT Hub and IoT device in Azure
Create an IoT Hub and navigate to IoT device to add a new device (RaspberryPi).
Navigate to Built-in endpoints and create a new consumer group which will be used for Stream Analytics.
3.) Create and Setup Stream Analytics Input & Output
Navigate to Inputs within Stream Analytics and provide the required information. (Add the consumer group that was created from the previous step).
Navigate to Outputs within Stream Analytics and provide the required information. Authorization of a Power BI account is required.
4.) Run Python program and send telemetry using MQTT protocol
Import modules and define the connection string for IoT Hub
5.) Stream Analytics Query
Once the program is running, configure Stream Analytics Query. Use Input & Output alias from previous step.
6.) Power BI Dashboard
Log on to Power BI and create a new Dashboard and customize it to your liking.
7.) View Data from Mobile Device
View Power BI dashboard from mobile device by downloading the Power BI app.