When we think about the word “industry”, we often envision factories bustling with robotic arms and conveyors. However, there are several other use cases within the industry where technology, the Internet of Things (IoT) and Edge Computing can play critical roles in enhancing efficiency and productivity. Some of these use cases include manufacturing, supply chain, mining, city management, telecommunications, and energy and utilities, among others.
In this blogpost, we will explore how the principles of Industry 4.0 and Industrial IoT (IIoT) can be applied to a Solar Farm using IIoT edge gateways. The energy and utilities sector presents unique challenges and opportunities for the introduction of the edge technologies. These technologies allow companies to keep innovating and creating value.
The IIoT edge gateway, running N3uron
on balena, is an out-of-the-box industrial IoT software solution for data management at the edge. It allows the creation of bidirectional data pipelines between industrial systems and business applications, converting diverse streams of industrial data from protocols such as OPC UA and Modbus into homogeneous data streams. This is done through the N3uron local user interface. Balena enables remote device management of N3uron nodes running on edge devices deployed in geographically spread locations like factory floors or photovoltaic plants. Utilizing containers, balena facilitates remote device management, empowering companies to perform Over-The-Air (OTA) and security updates from a centralized location, thereby enhancing productivity and operational security in the industrial sector.
What is a PV plant
A photovoltaic (PV) plant, also known as a solar power plant or solar farm, is a facility that harnesses solar energy to generate electricity. The PV plant is equipped with solar panels that convert sunlight directly into electrical energy using the photovoltaic effect. To optimize sunlight exposure and energy generation, the solar panels are typically mounted on support structures, such as solar trackers or fixed tilt structures.
Remote monitoring of PV plants through edge IIoT gateways offer several benefits, mainly contributing to the plant's operational efficiency and maintenance. Besides solar panels, other sensorized elements in a photovoltaic plant include high and low voltage with power meters, inverters, transformers, solar panel trackers and weather stations that measure temperature, humidity, sunlight irradiance and wind speed.
Through remote monitoring, operators can access collected data such as irradiance, power output, performance ratio, voltage and the generated energy, among others. The operators with all of this information can identify anomalies and take immediate actions to improve the solar power plant's performance. These measures save time in fault detection or underperformance and prevent the need for manual inspections. Moreover, data can be sent to the gateways to change the behavior of the elements in the solar plant (e.g. moving solar panels to a defensive position in case of strong wind, or transitioning the panels to the cleaning position), modify setpoints and receive power curtailment instructions from the remorse automatic dispatching system. allowing for remote control.
Predictive maintenance is another crucial aspect of managing solar farms. It allows potential issues or performance deviations to be detected early, thereby minimizing the downtime of the solar plant, reducing repair costs, and more.
With multiple types of sensors, there are multiple different protocols to monitor. By incorporating a balena-managed IIoT edge gateway, running N3uron as an IIoT software, PV plant operators can seamlessly unify the diverse industrial protocols employed within their installations. In this tutorial, protocols such as Modbus, DNP3, the widely adopted IEC61850 for electrical substation communication, OPC UA, and many others will be converted into MQTT Sparkplug to be visualized on a SCADA Ignition tool running on another balena machine available on the utilities’ control room.
Industrial Protocols for Solar Farms
The most popular industrial protocols used on energy and utilities installations are:
- Modbus which is one of the most popular industrial automation protocols, including in solar farms. It is a serial communication protocol and it is used to control and monitor inverters, string boxes, power meters and other devices from a PV plant.
- DNP3 (Distributed Network Protocol 3) is a protocol used in PV plants for the real-time data exchange among different devices, including SCADA systems. DNP3 is mostly used in the United States.
- IEC 61850 is an international standard for communication in PV plants. It defines the data models for exchanging information between devices and systems inside the power distribution infrastructure. The IEC61850 has been created to facilitate the interoperability between different vendors of devices for electrical substations such as the electricity counters.
- OPC UA (OPC Unified Architecture) is also a popular industrial automation protocol and it has been designed to enable data modelization, interoperability and secure communications.
Following the Industry 4.0 philosophy, this data-driven approach enables PV plant operators to make informed decisions related to maintenance and operational adjustments to maximize energy generation, increase the plant efficiency and ultimately improve the return on investment of the installation.
A real world example, a Solar Farm in Italy
By following the configuration steps outlined in the next sections, you will have a fully functional proof of concept with real-time data streaming from a 6.4 MW photovoltaic solar power plant located in southern Italy. This plant comprises six cabins, each equipped with two 500 kW inverters and a transformer that steps up the voltage to 13 kV for integration into the grid. Additionally, there are six weather stations that enable more accurate calculation of the performance ratio for each cabin as well as the entire plant.
Inside the PV plant there is an IIoT Edge gateway managed by N3uron running on balena which is able to consolidate all the data coming from the multiple sensors, PPC (Power Plant Controllers), power meters, inverters, weather stations described before. The consolidated data will be sent over OPC UA and converted to MQTT Sparkplug using a Mosquitto MQTT local edge broker. To encapsulate the PV plant data we will use Sparkplug B through Mosquitto and the SCADA system managed by Ignition on another balena machine will visualize the data and generate advanced analytics of the PV plant. Using MQTT and Sparkplug enables a seamless plug-and-play solution to a lot of different IIoT systems. This solution is able to scale to multiple PV plants around the world and get unified into the same Ignition in the cloud or in a data-center of the company.
Below there is the architectural diagram showing PV plants, the IIoT Edge gateways deployed within each solar power plant for edge monitoring and sending data from the Edge level to the Cloud Level with an Ignition SCADA through MQTT Sparkplug B.
Deploy N3uron on balena
Now, it’s time to deploy N3uron on balena using containers. We will be deploying the N3uron service along with MongoDB, which will act as a local Historian database, and Mosquitto as the MQTT local broker. The PV plant edge application is available in the balena marketplace balenaHub here
Once you have completed the steps outlined in the following sections, you will have a fully functional proof of concept with real-time data streaming from a Photovoltaic Plant located in southern Italy. This data, received through a remote OPC UA Server on N3uron, will seamlessly convert the OPC UA data into MQTT Sparkplug B packages, published using Mosquitto MQTT broker and then pushed to a remote Ignition SCADA machine also running on balena.
This project requires two different devices. A device in the edge of the PV plant where we will use the newest Industrial Edge Controller from Seeed Studio EdgeBox RPI200
and a second device running on the cloud infrastructure of the utility using an Intel NUC (i5) by Seeed Studio.
- Seed StudioEdgeBox RPI 200
- CM4 IO board to flash the CM4 from the EdgeBox RPI200
- Din rail power supply 24V (DC) in my case I used the
Mean Well HDR-100-24 AC-DC from Amazon.
- Some cables to plug to the power supply.
- Intel NUC i5
- USB stick to flash the balenaOS image on the Intel device
For both devices you will need:
- A balenaCloud account (sign up here) and get the first 10 devices free.
- N3uron license or just use the trial demo which is free for 2 hours. After that you will need to restart the running Modules from the N3uron interface.
- Ignition SCADA license or just use the trial demo which is free for 2 hours. After that you will need to restart the service running on the device.
In this blogpost we are going to focus on the Edge part of the PV plant, check the blogpost where we explain step-by-step how to deploy the Ignition SCADA service on a balena device to learn how to configure it.
Deploy N3uron in the PV plant
As usual, you have three options here. Use balenaHub, go to the github repository or below and click the deploy with balena button or use the balena CLI.
Find the application on the balena marketplace balenaHub
as it’s an application running N3uron as an IIoT gateway, MongoDB as a Historian to backup the local data and the MQTT Mosquitto broker. We will cover the Historian part of the N3uron application in a future blogpost to explain how Historians are needed in IIoT edge installations.
Deploy with balena button
Alternatively, use this
Deploy with balena button directly.
Use the balena CLI
Or, you can create a fleet in your balenaCloud dashboard and then use
in the source code of your repository. This is the traditional way to deploy applications via the balena CLI
- Sign up on balena.io
- Create a new fleet on balenaCloud.
- Add a new device and download the image of the balenaOS it creates.
- Burn an SD card (if using a Pi), connect it to the device and boot it up.
- While the device boots (it will eventually show up shortly in the balena dashboard) we will prepare the services:
git clone https://github.com/N3uron/balena-historian-mqtt
- Using balena CLI, push the code with balena push
One way or another, you will see the magic happening, your device is getting updated 🌟Over-The-Air🌟 with balena!
Configure the Seeed Studio EdgeBox RPI200 GPIO
The Seeed Studio EdgeBox RPI200 belongs to the
Raspberry Pi CM4 IO Board Device type on balena.
In case you would like to use the Phoenix Connector GPIO from the EdgeBox RPI200 you will need to update the Device Tree overlays that by default are defined from the Raspberry Pi CM4. The device tree is defined on Define DT overlays as
Define DT parameters for the default overlay I also added the parameter
Finally, this is the balenaCloud dashboard with the Seeed Studio EdgeBox RPI 200 running the edge application with N3uron, MongoDB and Mosquitto MQTT.
Configure the Photovoltaic Plant on N3uron
Access to N3uron using your local IP address and the port
The default credentials to access the N3uron interface are
n3uron as password.
Create the OPCUA Client on N3uron
First of all create a new Module on N3uron, call it
OpcUaClient of the OPC UA Client type.
Once the module is created, create a new Channel on Modules called
DataSimN3 and use the
Endpoint URL the address
opc.tcp://datasim.N3uron.com:4840. As this project is for educational purposes, we are going to simplify this using none Security mode or Security policy. On the other hand, enable the Authentication using the username
sunn3rgy and the password
Once the Modules have been successfully created, you can see all the OPC UA hierarchy available from the OPC UA model on the OPC Browser menu.
Once loaded the Tags, you will be able to see all the Photovoltaic Model and data coming from the OPC UA Module in the Real-Time menu navigating through the hierarchical structure of the solar farm and the machinery installed there such as inverters, weather stations, meters and more.
Configure the MQTT Sparkplug Transmitter on N3uron
Once we are collecting the data properly, we are going to define the transmitter to publish the data using the MQTT broker. Specifically we are going to use Sparkplug B.
The Sparkplug specification was created by Cirrus Link in 2016. Sparkplug is built on top of the MQTT protocol and it does not change the MQTT specification. The Sparkplug specification provides an open source and standardized way of structuring MQTT topics and representing payloads that are sent among devices in an industrial environment to try to reduce the friction on industrial interoperability.
N3uron is going to encode the payload using the Sparkplug specification and publish it to the local Mosquitto MQTT broker. Finally Ignition will get subscribed, and Ignition as it understands the Sparkplug payload specification it will represent the payload automatically on the interface as you are going to see below.
Once the Sparkplug Module is created, add the Edge Node pointing to the broker on the edge gateway. Remember, the Mosquitto broker is running on a container called
mqtt therefore you can use
mqtt as a Broker URL. Then create a device with Tag path
/ and a Tag filter with the default filters to send everything.
In case you need to check if any Module is working properly on N3uron, go to the Diagnostics menu and check the
Enabled checkbox to see traces or debug logs of specific modules selected. In the case below we were checking that the MQTT Sparkplug module was sending MQTT data to the broker.
Test the MQTT connection
To test that the N3uron service is publishing the MQTT data using the local broker I just subscribed the MQTT Explorer
application to the edge broker local ip address to check that the data was being published properly.
Actually as the data is encoded using the Sparkplug specification, the payload will be compressed and hard to read. However it is possible to see the Sparkplug hierarchy that you have defined on N3uron when you created the Sparkplug module.
Visualize the Solar Farm data on Ignition SCADA from another balena device
To visualize the data coming from the IIoT Edge gateways installed on the Solar Farms in a centralized system, we are going to use the SCADA software from Inductive Automation called Ignition. Find in this blogpost more information on how to deploy Ignition or Ignition Edge on a balena device.
Deploy the Ignition application
on balenaHub. Once deployed on your x86 device, access to your local ip address and the port
Install Ignition and once installed, log in using the credentials you created during the installation process.
To receive the data from the edge IIoT gateway running N3uron and balena you will need to install 3rd party packages made by Cirrus Link to install the MQTT modules. For this project we will only need to install the
modules. Download the MQTT Cirrus Link modules for Ignition
Go to the Config Menu, into the System section and click
Modules. Select the files and click install for both.
Once the modules are successfully installed, you can go to the left menu on MQTT and create the servers (Engine and Transmission). Remember that the URL starts with
tcp:// and add the port
1883 or your MQTT port from the edge machine MQTT broker.
Once the MQTT Engine and MQTT Transmitter servers are set up and Ignition says
, install the Ignition designer
software and start designing your SCADA interface with Ignition Designer.
Here we started to design the SCADA with some of the aggregated data coming from the PV plant.
Now, it’s your time to start playing with Ignition and prepare your SCADA interface that helps your business.
Wrapping up, the integration of N3uron, Ignition and balena reduces the friction for Industrial IoT applications in the edge taking the advantage of N3uron gathering data from multiple industrial protocols. In this blogpost, we shared how to monitor in real-time a Solar Farm on the edge and consolidate the data in a SCADA system in another machine running balena.
Throughout this guide, we've outlined the process of deploying N3uron on balena, from setting up your development environment to configuring your N3uron nodes and enabling remote management of edge devices.
The balena platform is all about reducing friction to address the challenges of our times for device managers. As always, let us know if you run into any issues when following this guide. Feel free to contact us at the balena forums
and share any logs with errors you have encountered!
We hope that by following these steps, you can accelerate your company's digitalization journey. Let's shape the future of industrial IoT together with balena.