This repository is for implementing the IoT simulation for measuring the growth of mint by different environmental conditions such as temperature and humidity. Technologies used for implementation include Python, Azure Cloud (IoT Hub and Streaming Analytics Jobs) and Power BI. Also, this repository is used for Azure & Cloud Fundamentals (tech stream) in the Microsoft Student Accelerator (MSA) Project - Australia 2020.
In this project, there is an IoT simuluator for measuring the growth of mint via generated data of different environemental conditions such as temperature and humidity. The range of randomly generated data depends on different growth state of a particular plan. The following image shows the ideal environment rewarded system for a particular plant.
Note that the information to sketch the image above is listed out in the Refereces section below. With the use of Azure Cloud as well as PowerBI, we can set up the simulated IoT devices for testing and draw the analytic report for streaming data from different devices. The project used only 1 device for testing, but the code can be customised to adapt the demand on sending messages from multiple devices.
- Introduction to Azure IoT MSLearn
- Create and analytics reports with Power BI MSLearn
- Send telemetrty from device to an IoT Hub using Python MSLearn
- Find resources about the growth of mint and sketch the plan
- Implementation for generating random humidity and temperature values automatically
- Set up devices in Azure IoT Hub and Streaming Analytics Jobs
- Implementation for generating and sending messages to IoT Hub automatically
- Testing connection between local machine and Azure server
- Perform analytics for streaming dataset in PowerBI
- MintGrowthReport - In order to view the report, you need to register an account in PowerBI website.
- Python version: 3.7.3
- Cloning the project
git clone https://github.com/peterdu98/mint-iot-simulation.git
- Set up dependencies
pip install -r requirements.txt
- To sucessfully run the code, you need to set up Azure IoT Hub and customise the
.env
file with your connection string and the device's id. - To run Stream Analytics Job, you need to set up Stream Analytics Job and run the following query
SELECT
CAST(deviceId AS nvarchar(max)) AS PartitionKey,
CAST(iothub.EnqueuedTime AS datetime) AS RowKey,
CAST(plant_id AS bigint) AS PlantID,
CAST(temperature AS float) AS Temperature,
CAST(humidity AS float) AS Humidity,
CAST(growth_state AS nvarchar(max)) AS State,
CAST(reward AS float) AS Reward
INTO
[Your alias storage]
FROM
[Your alias IoT Hub]