In Peru’s mining regions, tailings pipelines carry a slurry of water, crushed rock, and trace chemicals from processing plants to distant storage ponds. When a pipeline leaks, production stops instantly and costs spike, often $10,000 to $15,000 lost every half hour, plus cleanup and environmental risk.
New national regulations now require continuous monitoring of these pipelines to prevent spills and document safe operation. Mines must prove they can detect leaks in real time, not just react after the damage is done.
Across the country, operators began searching for practical ways to meet the new standards without replacing their existing control systems. For one remote site, where pipelines run for kilometers through steep mountain terrain, the goal was simple but urgent: stop leaks before they stop production.

Pipelines in Peru's mining regions
Who is PK Soluciones?
The mining company turned to PK Soluciones, a Lima-based engineering and integration firm specializing in industrial automation, instrumentation, and IIoT systems. Founded in 2016, PK Soluciones has built a reputation for solving complex control and communication challenges across the mining, cement, and metals industries.
PK’s team of control engineers and data scientists are experienced in the harsh, remote conditions typical of Peru’s mining regions. That mix of expertise made PK the natural choice to design a real-time leak detection system for the company’s tailings pipelines.
The Challenge
The new regulation required continuous, verifiable monitoring of every tailings pipeline, but most mines just weren’t equipped for it. Existing systems could show pump status or flow, but not detect leaks in real time or pinpoint their location. Operators had to stop the process and inspect the line whenever they suspected a problem—an expensive and disruptive routine.
“If pressure dropped, the only option was to shut down and start walking,” says Luis Lazo, automation engineer at PK Soluciones. “Every minute offline cost thousands, and finding the leak could take hours.”
Finding the Signal in the Pressure
For PK, the answer started with pressure. Changes in pressure along a pipeline can reveal leaks long before they’re visible in the field. A small drop between two points might indicate a developing crack; a sharp drop could mean a rupture. By measuring pressure at several points along each line, operators could not only confirm a leak but also locate where it was happening.
“Pressure tells you the truth faster than anything else in the system,” says Lazo. “It reacts instantly—the first sign that something’s wrong—so it became the foundation for our monitoring strategy.”
Measuring pipeline pressure is the foundation of PK's monitoring strategy.
Building Intelligence at the Edge
Once PK decided to use pressure as the key indicator, the next challenge was turning that data into clear, actionable information for operators. The system needed to collect readings from multiple points along each pipeline, compare them instantly, and highlight any segment behaving abnormally—all without relying on cloud servers or fragile network links.
“Our goal was edge analysis,” says Mario Hernández, PK’s data scientist. “The controller should detect pressure changes on its own, without relying on a cloud connection.”
PK designed a distributed architecture: compact control panels positioned along the pipeline, each gathering data from nearby pressure transmitters and forwarding it to a main control node at the pumping station. The system would need to support both wired and wireless sensors, survive harsh outdoor conditions, and tie into existing drives and instrumentation, without unnecessary complexity.
The Right Platform for the Job
To meet those requirements, PK needed a controller that could think for itself, rugged enough for the mine site, yet flexible enough to run analytics and modern control software side by side. After testing a few alternatives, the team found what they were looking for in Opto 22’s
groov EPIC® (
Edge
Programmable
Industrial
Controller).
“We wanted everything in one place—control, visualization, and analytics,” says Lazo. “
groov EPIC gave us that without extra PCs or middleware, and it could handle every protocol we needed right out of the box.”
Installed at the main pumping station,
groov EPIC serves as the system’s central node, polling pressure transmitters along the pipelines through a mix of wired and wireless links. The controller uses CODESYS®, an IEC 61131-3 PLC programming platform with built-in drivers that communicate with Modbus®/TCP gateways and EtherNet/IP™ variable frequency drives, gathering real-time data for local processing.
Selected tags are also logged to the site’s OSIsoft® PI historian, giving engineers a continuous record of pipeline conditions for analysis and reporting.
PK Soluciones chose Opto 22's groov EPIC as the center of their solution.
While CODESYS manages the control logic and I/O, Node-RED, a free flowchart-based IoT development platform included with the
groov EPIC, handles data manipulation and short-term trending. Operators access live dashboards through
groov View (an HMI development and runtime tool, also included), which displays pressure by segment, calculates differences between measurement points, and raises alarms when patterns suggest a developing leak.

Using Node-RED, CODESYS, and an AI program running on the groov EPIC enabled advanced pressure monitoring for the miles of pipeline.
Teaching the System to Think
With the control and visualization in place, PK saw an opportunity to take the project further. The team wanted the system not only to report pressure changes, but also to understand them—to distinguish between normal transients and the earliest signs of a leak.
Because
groov EPIC runs a secure Linux® operating system, PK could install and run their own software directly on the controller. Hernández developed a lightweight AI (artificial intelligence) model using Python 3.4 to analyze recent pressure data and identify subtle patterns that traditional thresholds might miss.
“Running inference locally on the EPIC means we don’t depend on an internet link or a remote server,” Hernández explains. “If something starts to change, the controller reacts immediately.”
This edge-based analysis helps reduce false alarms and gives operators an early warning when conditions begin to drift, often before a visible leak or pressure loss occurs.
Inside the System
Each of the two tailings pipelines is divided into four monitoring points. At the far end near the deposition area, wired pressure transmitters send continuous readings to the control network. Upstream, where terrain makes cabling difficult, Yokogawa® wireless transmitters expose data through field gateways using Modbus/TCP.
At the pumping station, the
groov EPIC polls all transmitters once per second, calculates pressure differences between each pair of sensors, and detects anomalies. Node-RED builds short-term trends operators can view in real time, while OSIsoft PI logs long-term data for compliance and performance analysis.
The Python inference model runs directly on
groov EPIC's Yocto Linux environment, analyzing the last several minutes of pressure data to spot early leak signatures. If a segment’s pressure delta or anomaly score exceeds its threshold, the controller triggers alarms in
groov View and energizes a beacon in the pump control room. Operators can immediately see which pipeline and segment are affected.
The system also communicates with the plant’s PowerFlex® 755 variable-frequency drives over EtherNet/IP. Drive status, motor current, and speed appear on the same dashboard, helping engineers correlate pump behavior with pressure changes.