This project demostrates how to connect Arduino UNO R3 to Azure IoT Central app using python bridge script. Arduino gathers data like temperature, humidity and soil moisture. Then the data are beeing send via bridge to Azure IoT Central app where they are displayed. The data is displayed in real-time with a delay interval that can be adjusted based on user preferences. This setup provides a scalable and flexible solution for IoT applications, making it ideal for environmental monitoring, smart farming, and other similar use cases. Additionally, the project leverages Azure IoT Central's advanced features for device management, telemetry visualization, and cloud integration.
Before you begin, ensure you have installed Arduino IDE and made Azure account:
-Arduino IDE
-Azure
- Navigate to the place where you want the app to be downloaded in Command Prompt.
- Clone the repository:
git clone https://github.com/StudentTraineeCenter/IoT-measurement-device
- Install dependecies:
pip install -r requirements.txt
- Upload the sketch to Arduino UNO R3 using Arduino IDE
- Connect these sensors/motor to arduino board. Set it up based on the sketch:
-DHT11
-soil moisture sensor
-servo motor
-3 different coloured LEDs
If you don't have these sensors/motors or you want to use some other the scetch must be changed.
- Create a resource group
- Create an IoT Central Application
- In the project details select Custom application template and hit create
- Open the application. On the left tab go to Devices and add new.
- Now go to Device templates and create new IoT device template. Check the This is a gateway device box. Hit Create.
- Add capability to the device template. You can ad as much as you would like. Those will display the data that are beeing collected by your device:
You must fill out Relationship before saving and dont forget the View. This will determine how your data will be displayed(pine chart, bar chart....)
- Now go back to Devices and assing this template to your device
- Whe you have setted up your AZ IoT app go to Devices and open your device.
- Click connect.
- There you can see ID scope, Device ID, auth type, Device key
- Select SAS authentication acces type.
- Copy and paste these properties - ID scope, Device ID, Device key into their respective locations in the bridge script.
If there is still problem, double-check registered device properties or re-register device completely. The problem can be also in firewall or network restrictions. Test connectivity to Azure IoT service:
ping global.azure-devices-provisioning.net