BL118 Node-RED Gateway: Full-Cycle Implementation of Municipal Sewage Treatment Smart Monitoring Project
Categories

BL118 Node-RED Gateway: Full-Cycle Implementation of Municipal Sewage Treatment Smart Monitoring Project

Centered on the BL118 Node-RED gateway, this intelligent monitoring system for municipal sewage treatment integrates water quality/process sensors and PLC devices, enabling real-time data collection, automatic linkage control, and remote operation and maintenance. It addresses the pain points of scattered devices, discontinuous data, and high maintenance costs.
 Sewage Treatment
Case Details

Project Overview

A municipal sewage treatment plant with a daily processing capacity of 50,000 cubic meters faced critical pain points: scattered water quality sensors (pH, DO, turbidity) and process equipment, discontinuous data collection leading to delayed response to water quality fluctuations, high on-site maintenance costs, and difficulty in compliance tracking for effluent indicators. To address these issues, the project aimed to build a "perception - edge computing - control - cloud management" integrated smart monitoring system. The BL118 Node-RED Edge Gateway was selected as the core to unify device connectivity, realize real-time data collection, automatic process control, and remote operation and maintenance—ensuring clear topology node hierarchy and logical consistency for seamless diagram generation.

Core Project Configuration

Terminal Perception Layer

This layer serves as the data collection source, including water quality sensors and process sensors. Water quality sensors cover 2 pH sensors (Modbus RTU, 4~20mA), 2 DO (dissolved oxygen) sensors (Modbus RTU, 4~20mA), 1 turbidity sensor (Modbus RTU, RS485), and 1 sludge concentration sensor (Modbus RTU, RS485). Process sensors include 1 chemical dosing level sensor (AI 4~20mA) and 1 inlet water level sensor (DI dry contact).

Gateway Core Layer

The core of the entire system, configured with BL118L-SOM335-X4-Y31-Y24. Hardware parameters include a dual-core Cortex-A7 processor (1.2GHz), 1G DDR3 RAM, and 8G eMMC storage. Expansion modules consist of X4 (2 RS485 + 2 CAN), Y31 (4-channel AI 4~20mA), and Y24 (4-channel relay DO). It also has a built-in 4G module with dual antennas, responsible for data integration, protocol conversion, and edge computing.

Terminal Execution Layer

This layer undertakes process control execution, including a control unit and execution devices. The control unit is a Siemens S7-1200 PLC, which controls the inlet pump, aeration valve, and chemical dosing pump. Execution devices include 2 electric valves (driven by Y24 relays), 1 chemical dosing pump, and 1 inlet pump.

Network Transmission Layer

Acting as a data transmission bridge, it includes a 100M industrial switch, STP Cat 5 Ethernet cable, and a NANO SIM 4G data card to provide uninterrupted network backup.

Upper Management Layer

Responsible for data visualization and command issuance, it has two parts: local and cloud. The local part is a SCADA system (supporting OPC UA, with real-time monitoring and alarm functions), and the cloud part is a commercial IoT platform (supporting MQTT, with historical data storage and trend analysis functions).

Operation & Maintenance Layer

Used for remote debugging and fault handling, including a maintenance PC, BLRAT remote access tool, pre-installed Node-RED V4.0.0, and Ubuntu 20.04 system.

Detailed Implementation Process

1. Hardware Deployment & Wiring (Physical Foundation of Topology)

1.1 Gateway Installation & Power Supply

Mount the BL118 gateway on a DIN35 rail in the on-site control cabinet, reserving ≥5cm spacing for heat dissipation. Connect a 24VDC power supply (compatible with 12-36VDC wide voltage) to the gateway’s "DC IN" terminals (positive to +, negative to -), leveraging built-in reverse polarity and overcurrent protection. Ground the gateway’s enclosure to the cabinet ground bar to enhance EMI resistance. Insert the 4G data card into the NANO SIM slot and fix dual antennas outside the cabinet for stable wireless signal.

1.2 Terminal Perception Layer → Gateway Wiring

  • RS485 Sensors: Connect pH, DO, turbidity, and sludge concentration sensors to the X4 board’s RS485-1 port (A-A, B-B, GND-GND). Configure each sensor’s Modbus slave address (pH1: 0x01, pH2: 0x02, DO1: 0x03, DO2: 0x04, turbidity: 0x05, sludge: 0x06) and communication parameters (9600bps, 8N1).
  • AI Sensor: Wire the chemical dosing level sensor’s 4~20mA signal to Y31’s AI1 channel (sensor + → AI+, sensor - → AI-). Use AWG18 shielded cable (length ≤15m) and ground the shield layer at the gateway end to reduce interference.
  • DI Sensor: Connect the inlet water level sensor’s dry contact to X4’s DI1 channel (normally open contact → DI terminal, common terminal → X4 COM terminal) to trigger a high-level signal when water level exceeds the threshold (1.8m).

1.3 Gateway → Terminal Execution Layer Wiring

  • PLC Communication: Link Siemens S7-1200 PLC’s CAN port to X4’s CAN1 port (CAN_H → H, CAN_L → L, GND → GND) for two-way data exchange (gateway collects PLC status, PLC receives control commands).
  • DO Execution Devices: Connect the inlet pump relay to Y24’s DO1 channel and chemical dosing pump relay to DO2 channel (DO terminal → relay coil +, relay coil - → Y24 COM terminal), matching the 24VDC power supply.

1.4 Gateway → Upper System Network Connection

  • Wired Connection: Connect BL118’s ETH0 port to the industrial switch via STP Cat 5 cable. The switch links to the SCADA server (static IP: 192.168.10.20). Set the gateway’s static IP to 192.168.10.100 (subnet mask: 255.255.255.0, gateway: 192.168.10.1) for LAN communication.
  • Wireless Backup: Enable the 4G module via the gateway’s Web management interface, configure APN parameters according to the selected telecom operator, and set "wired priority + 4G backup" mode to avoid data interruption.

2. Software Configuration & System Initialization

2.1 Gateway Basic Setup

Connect the maintenance PC to the same LAN as the gateway, access the gateway’s Web management interface via its static IP, and log in with the default account (configured as per project specifications). Verify pre-installed components: Node-RED V4.0.0, BLRAT, and Ubuntu 20.04.

2.2 Protocol & Data Flow Configuration (via Node-RED)

Open Node-RED via the gateway’s IP and designated port, then build workflows with drag-and-drop nodes:
  • Sensor Data Collection: Add "Modbus RTU Client" nodes for RS485 sensors, select X4’s RS485-1 port, and map sensors to corresponding registers (e.g., pH1 value → 0x0001). Set polling interval to 500ms.
  • AI Signal Processing: Add "Analog Input" nodes for Y31’s AI1 channel, set input type to 4~20mA (range: 0~5m for dosing level), and convert raw signals to actual values via "Function" nodes.
  • PLC & Upper System Integration:
    • Add "CAN Bus" nodes to X4’s CAN1 port (baud rate: 500kbps) to map PLC registers (e.g., aeration valve opening → 0x0101).
    • Add "OPC UA Client" nodes to connect SCADA (OPC UA address: opc.tcp://[SCADA Server IP]:4840), mapping gateway data to SCADA tags (e.g., "Inlet/PH", "Effluent/Turbidity").
    • Add "MQTT Out" nodes to link the commercial IoT platform (MQTT broker address configured per platform requirements), uploading timestamped data for historical analysis via the topic "sewage/plant1/data".

2.3 Automatic Linkage Logic Setup

Configure conditional logic in Node-RED using "Switch" and "Change" nodes:
  1. If pH < 6.5 or > 8.5 → Activate Y24 DO2 (chemical dosing pump) and send an alarm to SCADA.
  2. If biochemical pool DO < 2mg/L → Send command to PLC via CAN bus to increase aeration valve opening by 20%.
  3. If inlet water level sensor (DI1) is triggered → Deactivate Y24 DO1 (inlet pump) to prevent overflow.

3. Data Flow & System Linkage

  1. Data Collection: Sensors and PLC transmit raw data to BL118 via RS485/CAN; AI sensors send analog signals to Y31.
  2. Edge Processing: Gateway converts raw signals to standardized data, filters noise, and executes linkage logic via Node-RED.
  3. Data Upload: Processed data is pushed to SCADA (real-time monitoring) and the commercial IoT platform (historical storage) via OPC UA/MQTT.
  4. Command Execution: SCADA/cloud platform issues control commands (e.g., manual dosing adjustment) → Gateway forwards to PLC or directly controls devices via Y24.
  5. Alarm Feedback: Abnormal indicators (e.g., turbidity > 20 NTU) trigger local sound-light alarms and push notifications to SCADA/cloud/maintenance mobile phones.

4. Remote Maintenance & Fault Handling

4.1 Remote Access Establishment

Install BLRAT on the off-site maintenance PC, enter the BL118’s unique device ID (generated in the gateway’s Web management interface), and establish a remote connection via 4G—no on-site presence required.

4.2 Status Monitoring & Debugging

  • Remotely log in to Node-RED to view real-time data flows, check device connectivity, and modify logic (e.g., adjust pH thresholds) without system restart.
  • Use the gateway’s Web management interface to monitor 4G signal strength, Ethernet status, and module health (X4/Y31/Y24); export logs for fault analysis.

4.3 Fault Resolution Scenarios

  • Missing Sensor Data: Remote check RS485 wiring via the gateway’s diagnostic tool or reconfigure Modbus addresses in Node-RED.
  • 4G Communication Failure: Switch to wired network remotely, verify APN parameters, or restart the 4G module.
  • Logic Malfunction: Roll back to the last stable Node-RED flow via the "Backup/Restore" function.

5. Project Effectiveness

  • Operational Efficiency: On-site maintenance trips reduced by 70% via remote access; water quality fluctuation response time shortened from 30 minutes to 5 minutes.
  • Resource Optimization: Chemical dosing accuracy improved by 25%, reducing chemical waste by 20%; energy consumption of pumps/valves reduced by 15% through automatic control.
  • Compliance Assurance: 24/7 real-time monitoring of effluent indicators (pH, turbidity, sludge concentration) with complete data records for regulatory audits.

Key Tips for Topology Diagram Generation

  1. Node Labeling: Clearly mark each device’s name, model, and role (e.g., "BL118: Core Gateway", "S7-1200: Process Control PLC", "pH Sensor: Water Quality Perception").
  2. Connection Details: Annotate port mappings (e.g., "pH1 → X4 RS485-1 A/B/GND") and signal types (RS485/CAN/AI/DO) for physical links.
  3. Data Direction: Use arrows to indicate "sensor → gateway → upper system" and "upper system → gateway → execution device" data flows.
  4. Layer Division: Distinguish layers (perception, gateway, execution, network, upper management, O&M) with different colors or borders to reflect topology hierarchy.
Leave a message
FirstName*
LastName*
Email*
Message*
Code*
Verification Code
We use Cookie to improve your online experience. By continuing browsing this website, we assume you agree our use of Cookie.