Wind farms are great contributors to our sustainability agenda as generators of a green renewable energy. They are typically located in some remote onshore / offshore locations, which makes it crucial to monitor their health and provide timely support.
In a linked GitHub repo, you will find detailed step-by-step guide on how to enable ingestion of remote telemetry in Azure, update of wind farm's Azure Digital Twins (ADT) and real-time health monitoring in ADT's 3D scene.
Step 1 - Setup Azure Digital Twins- In Azure portal provision new instance of Azure Digital Twins (ADT);
- Create new Azure Storage account and enable access to it from ADT with the following AZ command:
az storage cors add --services b --methods GET OPTIONS POST PUT --origins https://explorer.digitaltwins.azure.net --allowed-headers Authorization x-ms-version x-ms-blob-type --account-name <YOUR_STORAGE_ACCOUNT>
- Use provided JSON models from ADT_Models folder to setup relevant Organisation -> Wind Farm -> Win Turbine hierarchy, similar to what is shown on the screenshot below.
- In Azure portal provision new instance of Azure IoT Hub;
- If you plan to use Python simulator (Step 5 below), you need to register your IoT device and copy one of its Connection String as shown below:
- If you plan to use Seeed Studio's LoRaWAN Dev Kit (Step 6 below), you need to create a new Shared Access Policy with "Registry Read", "Registry Write" and "Device Connect" permissions and then copy one of its keys as shown below:
Note: Once you register your Seeed device with the Helium network, Shared Access Policy's key from the Step 2.3 above will be used to auto-register your device with the Azure IoT Hub.Step 3 - Deploy Azure Function
- Create a new Azure Function in your IDE of choice. Next sub-steps assume that you are using provided C# sample;
- Ensure that your Azure Function is of an Azure Event Trigger type;
- Target ADT device ID will be extracted from the message's system properties as shown in row 42 below. Adjust other variables to your sensor's telemetry values:
- Create ADT_SERVICE_URL variable that points to your ADT instance;
- Publish your function in Azure.
Note: Use of the provided C# sample requires installation of "Azure.DigitalTwins.Core", "Azure.Identity" and "Microsoft.Azure.WebJobs.Extensions.EventGrid" packages.Step 4 - Configure ADT 3D scene
- Open 3D Studio and configure 3D scenes environment by linking your ADT instance and Storage account from Step 1:
- Create your first 3D scene by uploading 3D model and proving meaningful description:
- Use meshes from your 3D model to add required elements to 3D scene:
- Configure and assign relevant behaviour to your 3D elements from the earlier steps. Behaviour can enable Status, Alerts or Widgets functionality as shown below:
- Provided Python sample code shows how to establish connectivity with IoT Hub and submit your message. You can enhance it to the specifics of your data payload;
- There is a dependency on Azure IoT Device SDK for Python. You can install it with pip as shown below:
pip install azure-iot-device
- In row 7, replace placeholder with Connection String from Step 2.2.
- If you are using Seed Studio's LoRaWAN Dev Kit, you can follow this Device Registration guide from the Seeed Wiki to register your kit with the Helium platform. If successful, you should get it listed under the Devices section:
Note: Please, make a note of Dev EUI, App EUI and App Key as you will re-use them later in Step 6.5 below;
- Next follow this IoT Hub Registration guide from the Seeed Wiki to register your Azure IoT Hub. You will re-use here Shared Access Policy key from Step 2.3:
- Telemetry received by the Helium platform needs to be decoded before its transfer to IoT Hub. Create new "custom" function as shown below. You can adapt provided Helium function (that decodes temperature and humidity readings) to the specifics of your telemetry:
- Next, use the Flows section to link our Device, Function and IoT Hub nodes as shown below:
- Provided Arduino sample can send temperature and humidity telemetry from the Grove SHT40 digital sensor. Don't forget to set frequency band in row 12 to the value specific for your geography. You will also re-use Dev EUI, App EUI and App Key from the earlier Step 6.1:
- If correctly setup, you should be able to see in Arduino IDE's Serial Monitor that your telemetry values are successfully submitted to the LoRaWAN network:
- Debugging mode of the Helium console can help you verify that decoded telemetry values are re-routed further up to the Azure IoT Hub:
- Azure IoT Explorer can be used to monitor ingested device telemetry in real time:
- Telemetry values will be updated in Azure Digital Twins:
- And, eventually, reflected in ADT's 3D scene:
With this, you can verify end to end connectivity between physical device and its 3D digital twin.
Appendix: Working prototype - YouTube videoDemo of the working end-to-end solution can be found here on YouTube.
Comments