Skip to Content

Node-RED Low-Code Programming

Node-RED is a flow-based low-code programming platform for event-driven applications (such as IoT solutions that trigger actions based on sensor data or events). Node-RED allows you to exchange data between hardware devices, microcontroller circuits, components, APIs and online services to create an Internet of Things (IoT) solution with minimal programming. Some common tasks like connecting to MQTT brokers can be achieved without needing to write any code.

Node-RED provides a web browser-based flow editor, which can be used to create functions that coordinate this communication.

In addition to its core value that it allows you to build solutions with minimum programming, Node-RED offers other possibilities that can add value to your solution. We will specifically demonstrate the following:

  • Simplified no-code (configuration only) connections to MQTT Brokers on the cloud for both publishing data from sensors for display on the app and subscribing to control signals from the app and sending them to the circuits.

  • Values received from one circuit will be processed by the Node-RED flow and if they meet any programmed condition a control signal will be sent to the other circuit without requiring any human intervention and creating an autonomous self-decisioning system.

  • Values from multiple circuits and sensors will be read and a contextual decision will be taken considering all the data before sending an update to the mobile app.

  • A formatted display text will be sent back to the sending circuit once its data is processed to add the required text (such as parameter units) to make the displayed text more user friendly.

Nodes and Flow-based Programming

Flow-based programming is a way of defining the functionality of an application as a series of tasks (or nodes as they are called in Node-RED). Each node has a similar process - it receives some data, performs some operations on the data and passes it to the next node.

This style of programming lends itself very well to a visual representation and GUI-based programming.

Low-code programming is a simpler alternative to writing microcontroller programs. To be clear, it is low-code and not no-code. That means you do have to use an IDE, connect the board, write some code, and upload it to the board. But the programming can be limited to simple tasks such as reading sensor data and sending the data to the serial communication port while the low-code platform handles the rest of the processing.

You can write code in the low-code platform to process the data received from the connected board, including handling complex tasks like connecting to a WiFi network and uploading data to IoT platforms over MQTT or API, which would otherwise need a lot of programming.

This means you don’t need a board that supports WiFi. It also means you don’t need to download libraries and programming the board for WiFi connections and MQTT communication.

The overhead to using a low-code platform is that it needs a computer to run on and the boards have to be connected to this computer. This does not allow for standalone circuits and limits their portability.

The low-code platform best suited for Physical Computing and IoT solutions is Node-RED.

Here is an example of how Node-RED can be used:

Data received from IoT devices can have a high volume and velocity where you can receive many data values (if you have multiple sensors) and very rapidly (each sending a reading every second, for example). We may want to store every data value for subsequent analysis, but we wouldn’t want to read every single data value in real-time rather than that we want to be notified if a value meets certain criteria (for example, the temperature goes above or below a certain value, if motion is detected, if gas or smoke is detected, a door is opened, etc.).

Node-RED is the perfect solution for such a requirement. It can receive every data value and write every data value to the database, but it can program a function that will only send notifications if the conditions programmed in the function are satisfied.