Build Your Industrial Monitoring Solutions using Open-Source Tools in Minutes

Ozanerturk
Machine Health
Published in
6 min readSep 7, 2023

The concept of “monitoring” is a term and method that has been used in the industry for a long time. Although the application forms vary, the main purpose is always to monitor critical resources and intervene when necessary.

The industry understands the importance of this concept quite well. Especially in the days when new technologies such as IoT, Cloud, and Industry 4.0 are rapidly adopted, manufacturing industry companies make a great effort to try these new technologies under strict application conditions.

In an era where open-source software is strongly endorsed and solutions are evolving rapidly, one of the primary aspirations of a digital transformation engineer is to swiftly execute PoC (Proof of Concept) or experiments. The aim is to promptly witness the impact of these technologies in action.

Node-RED

Node-RED is a powerful visual programming platform for data processing and automation projects. This open-source tool makes it easy to create and manage data flows between different data sources, devices, and services. Node-RED’s popularity is due to its easy-to-use visual interface, wide The library is growing rapidly thanks to its support and flexibility.

Likewise, inspired by the power of free software and driven by the desire to contribute to technology, we developed the “Senseway Node” component and shared this solution as open source to make IoT devices that collect high-quality vibration data easily available on the Node-RED platform. This way, industry professionals can become even more skilled at collecting and analyzing data using Node-RED.

Show me the code!

Here are the links to the library and documentation for eager developers :)

Integrate Senseway and collect vibration data with Node-RED

The following Node-RED stream is designed for a sample data collection process. This stream communicates with Senseway devices and edge vibration sensors over MQTT (Message Queuing Telemetry Transport) using the Senseway Node.

  1. Retrieval of Senseway Data: In the first step, measurement data from Senseway devices are received via MQTT using the Senseway Node. This data is usually in JSON format.
  2. Converting Data Format: The received data is converted to JSON objects. This conversion process makes the data easier to process.
  3. Storing Data: The converted data is saved to the file. This step is important for later analyzing or recording the data.
  4. Threshold Controls: The data is used to calculate the average values of vibration levels. Threshold values are determined and comparisons are made with these values. If vibration levels exceed the specified threshold, an alert is triggered.
  5. Telegram Alert: In the last step, a warning message is sent to a Telegram channel when the threshold is exceeded. This message notifies users or operators that vibration levels are excessive.
Node-RED flow of simple vibration monitoring system

Get Started

Install senseway node from node palette

If you’re already using Node-RED, adding the Senseway Node-RED component will be a breeze.

  1. Open your Node-RED application.
  2. Go to the “Manage Palette” option by clicking on the three-bar icon located in the upper left corner.
  3. Click “Manage Palette” and a window will open. In this window, you will see a list of available and installable components.
  4. Type “sensemore” into the search bar and search.
  5. Among the search results, you will find the component named “@sensemore/senseway-node”. This component is Senseway Node’s official component for Node-RED.
  6. Click the “Install” button next to the component to install it. The component is added to your Node-RED stream and is ready to be used.

In this way, you have successfully added the Senseway Node to Node-RED. Now you can use this component to receive data from Senseway devices and use it in your flow.

You can export the sample stream to the Node-RED app to get started quickly. Sample Flow

Senseway Configuration

Senseway Configuration

You can follow the steps below to start collecting data over MQTT using Senseway Node:

  1. Entering Device and Gateway Information: After adding the Senseway Node, add the Senseway Node component to your Node-RED stream by drag and drop. Enter the MAC address of the Sensemore vibration sensor in the “Device” field and the MAC address of the Senseway device in the “Gateway” field.
  2. Measurement Configuration: ”Accelerometer Range”: Select the accelerometer range. Sensemore instruments can measure vibrations with different sensitivity levels (2G, 4G, 8G, 16G).”Sampling Rate”: Specify the sampling frequency. Select this value to determine how many samples per second the Sensemore vibration sensors take. For an accurate analysis, choose the most appropriate sampling frequency for your measurements.”Sample Size”: Determine how many samples will be taken. Set this value according to the sampling frequency and the measurement time you want. The measurement time will be the SampleSize / Sampling Rate.”Interval”: Indicates how often measurement will be taken.
  3. MQTT: For data to be transmitted over MQTT, you will need to set up MQTT settings. Configure the required MQTT broker information and other settings in the MQTT panel.

By following these steps, you can start collecting data over MQTT using Senseway Node. In this way, you can easily measure the Sensemore vibration sensors and process the data as you wish.

Threshold analysis

Threshold analysis

We add a “function” node to do a simple threshold check. Let’s create a decision mechanism by comparing the incoming measurement data with a previous and threshold value.

  • If the incoming value is higher than the threshold value and the previous value, we set a warning message.
  • If the incoming value is lower than the threshold value and the previous value is higher than the threshold value, we are preparing the warning message stating that it has switched to healthy mode.

Send Telegram Notification

We can transfer these prepared messages to any channel and integrate them. In this example let’s look at how we send Telegram messages using REST API.

Telegram Send message configuration using HTTP Request

We are adding a new HTTP Request Node to our flow. We add our message to the query parameters of the URL using the messaging integration url offered by Telegram.

We will need information chatid and bottoken. You can use Telegram’s documentation for creating these parameters.https://core.telegram.org/bots/api

And done, here are the results.

Bonus: Grafana

You can also feed vibration telemetry values into a database. Of course, we picked an open-source database Postgres. Why ? Grafana, also an open-source monitoring solution, supports integrating Postgres as a data source, and its FREE :). I am not getting into detail about how to build a Grafana dashboard to keep our scope clean, there are dozens of articles showing examples. I let them explain further details. But let’s see the results!

Grafana Dashboard

I’ve added Postgres as datasource to grafana, put in credentials, and queried the table that stores telemetry values to build a dashboard dashboards with three pannel. You can also set alarm rules to manage monitoring operations in Grafana

Closing

However, rapidly advancing technologies often struggle to find their place among the stable yet complex machinery of factories. Implementing any application can take weeks, even months.

Traditional industrial monitoring solutions typically consist of PLC-SCADA systems, a control room, and sensors/systems that communicate using protocols like Modbus and Profibus. While these solutions can provide a wide range of services, integrating them with today’s technology and tools can be relatively challenging.

To overcome this challenge, turning to open-source software tools allows us to leap onto the technology bandwagon. With these tools, we can create fast and flexible solutions.

We will continue to develop technologies and share our experiences on this path. Keep following us, and let’s explore the technological advancements of the future together! :)

Ozan,

Visit Sensemore

hello@sensemore.io

--

--