Tank Level Sensor Ultrasonic Node-RED Dashboard

Table of Contents

Introduction

Effectively managing liquid resources is a crucial challenge, especially in sectors where precise liquid level measurement is essential for not only efficiency but also safety and environmental regulations.

Ultrasonic IoT sensors bring precision and automation to tank level monitoring. Mounted on the tank, they emit sound waves that bounce back from the contents. By measuring the echo’s return time, the sensor calculates fill level. This data is then wirelessly transmitted to a central system for real-time monitoring. These wireless sensors shine in situations where traditional methods struggle. Battery-powered, they eliminate the need for power lines, making them ideal for tall or remote tanks where cable installation is expensive and time-consuming. Across industries, tanks store everything from water to chemicals. Traditional monitoring methods, manual or electronic, often lack accuracy. Ultrasonic IoT sensors offer a reliable solution.

Tank Level Sensor Ultrasonic Long Range Wireless

NCD’s Tank Level Sensor Ultrasonic Long Range Wireless offers exceptional features for reliable and efficient tank monitoring:

Unmatched Range: This sensor boasts an impressive 2-mile range thanks to its wireless mesh networking architecture, ideal for large-scale applications.

High Accuracy and Resolution: Featuring 1mm resolution, the sensor delivers precise tank level or distance measurements, ensuring dependable data for critical operations.

Open Communication & Configurability: The open communication protocol allows seamless integration with various control systems, gateways, and platforms like Azure, Prescient, Datacake, Ubidots, FlowFuse, Qubitro, TagoIO, Machinechat, AWS, Losant or MQTT/OPC-UA servers. Additionally, open communication allows for maximum configurability to suit specific needs.

Long Battery Life: The sensor is designed for extended operation, minimizing maintenance and downtime.

To explore all the features of this fascinating sensor, click ‘show more’.

This post aims to introduce the key features of our Tank Level Ultrasonic NCD-Dashboard and provide instructions for setting it up (import, configuration, and connection) within your Node-RED instance. This solution offers a visual tool, making it easy and intuitive to begin working with the sensor.

Overview

The next image is a visual representation of the Tank Level Sensor Ultrasonic Dashboard Architecture. The sensor(s) collect the data of interest from the field elements, and then send the signal via Digi-Mesh to the Enterprise IIoT Gateway or Industrial IoT Wireless Modem, where it is processed by Node-RED and then sent to the NCD-Dashboard for storage and intuitive visualization. 

ncd-dashboard-tank-level-sensor-ultrasonic-overview

Features

Real-Time Data Display

Real-time display of the variables emitted by the sensor:

  • Tank Level / Distance (%).
  • Battery Percent.
Historical Data Display

Historical data visualization of the values of the variables emitted by the sensor:

  • Tank Level / Distance (mm).
  • Battery Percent.
Data Scaling

For example, if your sensor readings range from 500 to 9999mm, but you want to convert them to a 0-100% scale, you can use the ‘Max and Min Input Range’ block for this transformation (This scale is used by default).

Device Detection by Type

Tank Level Sensor Ultrasonic Long Range Wireless (Type 34).

Dynamic Data Update by MAC Address

It identifies the MAC Addresses of the devices connected to the node, they are listed in a Dropdown and by selecting the device (MAC) the data is loaded to the Dashboard.

Data Inspection (Object)

Function to inspect from the dashboard the object data coming from the sensor(s).

Local Datalogger

Generation and storage in local (or user-defined) path of CSV file with data from the sensor(s).

Dynamic Data Loading

Dynamic loading of data to graphs and gauges from local CSV files.

CSV Download

Function to download CSV files from web browser by user-defined date.

ncd-dashboard-tank-level-sensor-ultrasonic

IMPORTANT

This NCD Dashboard is designed to work exclusively with sensors of type 34, which corresponds to the Tank Level Sensor Ultrasonic Long Range Wireless.

Requirements

To import this NCD-Dashboard it is necessary to have previously installed:

  1. Node-RED

  2. NCD Library.

  3. FlowFuse Dashboard 2

Node-RED
Node-RED Logo

Node-RED is a programming tool for wiring together hardware devices, APIs and online services, created by IBM’s Emerging Technology Services group. Contrary to what it may seem, it is quite simple to use software.

Every ncd-sensor packet creates a message (object) which flows down the connected nodes which can alter that message to suit your application, package it into a new protocol such as MQTTModbus or OPC-UA, or send it directly to your Cloud (AzureAWSUbidotsLosant, direct injection into an SQL or NoSQL database, Ignition SCADA and many other options).

 

Node-Red is pre-installed and running as a service in Enterprise IIoT Gateway and Enterprise IIoT Gateway Lite. Here you can find a complete getting started guide for accessing Node-RED from the Enterprise IIoT Gateway:

Note: To perform the installation process of Node-RED on Windows operating system, you can follow the steps in this article:

Enterprise Sensor Library

This library handles communication to, and configuration of, the NCD Wireless Sensor Line. It can be used in conjunction with Node-RED to create and manage a Wireless Sensor Network using the Node-RED flow-based development tool on any platform.

1.- To install this library, the first thing to do is to access Node-RED which runs as a service on the Enterprise IIoT Gateway. Then, inside the Node-RED flow editor you must go to the main menu (top right) and select the “Manage Palette” Option as shown in the following Image:

Node Red Manage Palette

2.- The “User Settings” window will be displayed, inside “Palette” you must select click on the “Install” tab.

3.- In Search Field enter “@ncd-io/node-red-enterprise-sensors”, you will see the following:

Nodered NCD Library

4.- Click the “Install” button to start the installation process, a window will appear at the top of the screen, asking you to confirm the installation:

5.- Once the process is completed you will see the following window:

Node RED installation complete

Note: you can find the Enterprise Sensor Library Documentation here:

FlowFuse Dashboard 2.0

An easy to use collection of nodes for Node-RED that allows you to create data-driven dashboards & data visualisations. Installation procedure is similar to the previous one, FlowFuse’s Node-RED Dashboard 2.0 is also available in the Node-RED Palette Manager.

Source: https://dashboard.flowfuse.com/

FlowFuse Dashboard 2 Logo
Node Red Manage Palette

1.- Open the menu in the top-right of Node-RED, then Click “Manage Palette”:

2.- Switch to the “Install” tab, Search “@flowfuse/node-red-dashboard”, Install the  package:

FlowFuse Dashboard 2 Library Installing
FlowFuse Dashboard 2 Installing Library

3.- You must confirm the installation by clicking on the Install button in the pop-up window.

4.- You will see a list of the dashboard 2 nodes that have been installed.

FlowFuse Dashboard 2 installation completed
FlowFuse Dashboard 2 Nodes

5.- In workspace you can see the available nodes in the nodes palette, as shown in the following image:

Import NCD-Dashboard

Copy JSON from GitHub
Go to the Dashboard repository in the following link, once opened, select the button to copy the RAW code of the dashboar, as shown in the following image:
Import NCD-Dashboard

(Optional) –  You could add a new flow in the node editor of Node-RED, click on Add Flow icon, upper right corner of the workspace.

1.- Go to the Main Menu (amburger icon in the upper right corner) then click on “Import” option, as shown in picture.

Node RED pasting json code

2.- A text-box will be opened. Right click and paste the JSON code you just copied from GitHub, as shown in picture:

3.- You should see the JSON code in text-box, now you can press the red “Import” button at the bottom right (by default the “current flow” option is selected):

Import nodes in current workspace Node-RED

4.- In the top of the Node-RED editor, you will see information of the NCD-Dashboard you just imported, and automatically you will have the node available inside the node editor, now you can position it inside the editor or workspace by left clicking:

5.- You may also notice that the NCD-Dashboard node has been added to the NCD node group in nodes palette.

NCD Node configuration

The next step is to configure your ncd nodes (you may have already configured your nodes), but it is important to remember that this NCD-Dashboard only works for the  Tank Level Sensor Ultrasonic Long Range Wireless type:

Once you have the Tank Level Sensor Ultrasonic Long Range Wireless node configured, the next step is to connect the sensor output (node) to the NCD-Dashboard node input:

NCD Dashboard properties

If you double left click on the dashboard node (Ultrasonic Tank Level) you can open the Properties.

Name: You can assign an identifier to the NCD-Dashboard node. This name only helps distinguish your specific node within the node editor (from other nodes).

Custom Path: By default, this property is set to a fixed location. The NCD-Dashboard retrieves data from your sensor and stores it locally within Node-RED.

Data Storage: The NCD-Dashboard automatically saves the generated CSV files from the sensor(s) within the Node-RED folder.

Linux: $HOME/.node-red/log
Windows: $HOMEPATH/.node-red/log

Note: By default, it is not necessary to assign a value to this property. However, if you need the sensor data stored in another local location, you can assign this property to that new location. The NCD-Dashboard will then use that path to store the data.

Nodered dashboard node path property

1) For Windows/PC

Nodered dashboard node path property

2) For Linux

Click on the Deploy button, located in the top right corner of the Node-RED Flow editor, to apply the changes to your Flow.

Nodered Deploy Button

Node Status

1.- If the path you enter is correct, or if you leave the property field blank (using the default path), you should see a “Saving data” status when new sensor data arrives at the node input, indicating successful storage.

2.- It’s important to assign a valid route. If the NCD-Dashboard detects an invalid route, it will display a “Path error” message.

3.- If you connect a different type of NCD sensor, you will see the “Type error message.”

Access Dashboard

Node RED Dashboard 2.0

1.- The next step is to go to your NCD-Dashboard to see the real-time data coming from the sensor by clicking on the “Dashboard 2.0” option in the sidebar:

2.- Then click on the “Open Dashboard” option:

Open button nodered Dashboard 2

Note: In case you have deployed and cannot see the “Dashboard 2.0” content, you should reload the current page of the web browser with the “F5” key or “Reload page”.

NCD nodered dashboard 2 empty

3.- Your NCD-Dashboard will automatically open in a new window, where you can see the following:

ncd-dashboard-tank-level-sensor-ultrasonic-dashboard

NCD Dashboard

Tank Level
ncd-dashboard-tank-level-sensor-ultrasonic-tank-widget

Displays the fill level as a percentage (%) based on the sensor’s reading. This value is determined by the Max and Min fields.

  • MAX (0%): (9999 by default)
  • MIN (100%): (500 by default)

These fields allow you to scale the sensor’s signal into a percentage. For example, if your sensor readings range from 700mm to 9000mm, and you want to convert them to a 0-100% scale, you can use the ‘Max=7000 Min=800 Input Range’ block. This way, in the tank indicator, when the sensor reading is 7000mm (full tank), it will display 0%. Conversely, when the reading is 800mm (empty tank), it will be 100%.

The raw sensor data in millimeters is shown at the bottom.

The following image illustrates the above concept.

ncd-dashboard-tank-level-sensor-ultrasonic-scaling

Gauge indicating battery percentage, accompanied by a numerical display at the middle for the specific value (Range: 0 – 100%).

ncd-dashboard-tank-level-sensor-ultrasonic-battery-gauge
Charts

Chart Displaying the Last 20 Historical Level (mm).

ncd-dashboard-tank-level-sensor-ultrasonic-history-level-chart

Chart Displaying the Last 20 Historical Battery Percentage Readings (%)

ncd-dashboard-tank-level-sensor-ultrasonic-history-battery-chart
Main Menu

You can navigate between the ui-pages (this menu allows you to navigate between two or more NCD-Dashboards, in case you have configured different NCD-Dashboards).

ncd-dashboard-tank-level-sensor-ultrasonic-main-menu

Note: For example if you have configured an tank-level-ncd-dashboard and you import an ncd-Ultrasound-Vibration-ncd-dashboard  you will be able to navigate between the NCD-Dashboards from the main menu:

Date Picker & Download CSV

You can directly download the locally stored CSV files containing historical data from the Tank Level Sensor Ultrasonic Long Range Wireless through your web browser using the NCD Dashboard.

ncd-dashboard-tank-level-sensor-ultrasonic-datepicker

You can see the box at the bottom left, where we have two fields:

  • Date: Corresponds to a date entry.
  • Download CSV button: Activates the download of the corresponding CSV file from the web browser.

Format must be used:

  • mm: for month.
  • dd: for day.
  • yyyy: for year.

To download a CSV file from the NCD-Dashboard, the first thing to do is to select or enter a date of interest using the date picker, i.e. (with the current device selected using the MAC drop-down) the date of the stored data you are interested in downloading.

IMPORTANT

Verify that the date of interest entered corresponds to a valid date, i.e. that the NCD Dashboard has been storing data (that there is a CSV file corresponding to that date).

For example, assuming you have verified that the NCD-Dashboard has been storing data on the date “May 6, 2024”, and you need to download the CSV file generated on that date, then you would enter:

1.- To display the date picker you must click on the icon on the right side of the “Date:” box:

ncd-dashboard-tank-level-sensor-ultrasonic-show-datepicker

2.- Then select the date of interest:

ncd-dashboard-tank-level-sensor-ultrasonic-csv-file

3.- Then click on the “Download CSV” button. If the NCD-Dashboard finds the file for that date, you should be able to see the download begin (indicated by your web browser’s download icon) as shown in image.

4.- You can open the downloaded CSV file. The content will be similar to the following:

Note: In case you enter a date of interest, which there is no CSV file generated, and press the “Download CSV” button, you will see the following message:

IMPORTANT

CSV file download is currently only available for the default data storage option (local in the path “./node-red”).

MAC Address Dropdown

The NCD-Dashboard provides a dropdown menu that allows you to select the ncd sensor of interest for loading, displaying, and storing its variables based on its MAC address.

When you connect a new NCD sensor to the NCD-Dashboard node, a pop-up window appears indicating a new device connection. This sensor will automatically be available for selection in the MAC Address dropdown.

An example of this process is shown in the following image:

ncd-dashboard-tank-level-sensor-ultrasonic-devices-demo
Inspect

You can access the object data of each sensor using the “Inspect” button on the NCD-Dashboard. Click the button once to view the selected sensor’s inspection window, and click it again to return to the data view.

ncd-dashboard-tank-level-sensor-ultrasonic-inspect

You can see an example in the following image:

ncd-dashboard-tank-level-sensor-ultrasonic-inspect-demo
Product Info

The “Product Info” button directs you to information about the corresponding sensor on our website.”

Summary

A good quality wireless ultrasonic sensor, like the NCD Tank Level Sensor, offers features like long range, stability, and security, making it adaptable to diverse scenarios. These sensors promote real-time decision making and are easy to install and scale due to their wireless nature. As industries move towards automation and data-driven operations, the value of ultrasonic sensors will continue to grow. Their ability to improve efficiency, reduce waste, and offer scalability makes them essential tools for smart sensor installations

Our development philosophy for these dashboards prioritizes user-friendliness. We achieve this through the versatility of Node-RED. While we leverage some core JavaScript functions, we strive to build the workflow using more user-friendly nodes, allowing you to effortlessly modify or personalize the dashboard.

Thank you,

Eduardo M.

Share this on:

You might also like: