DEV Community

Akasha Mughal
Akasha Mughal

Posted on

Designing a Pharmaceutical AIoT Pipeline: MES, Sensors, Edge Computing, and AI

A pharmaceutical manufacturing environment is a distributed systems problem disguised as a physical process. There may be sensors on the production floor, RFID readers at controlled access points, BLE devices tracking assets, environmental monitoring equipment, and business applications handling manufacturing, laboratory, quality, and inventory data. Then there is the AI layer. The difficult part is not simply training a model.

The difficult part is designing a reliable path from physical event → usable data → contextualised intelligence → operational response.

A useful reference architecture is:

Physical Devices
↓
Edge Layer
↓
Event Processing
↓
Integration Layer
↓
MES / ERP / LIMS / QMS
↓
Analytics / AI
↓
Application / Workflow

Let's break down the engineering problem.

  1. Start With Events

A pharmaceutical AIoT system should begin by defining what events matter.

Examples:

Material received
Asset moved
Equipment started.
Temperature changed.
Pressure changed.
Batch operation completed
Quality event created
Access event detected

Instead of thinking about the system as a collection of devices, think of it as an event-processing architecture.

For example:
{"event": "equipment_status_change",
"asset_id": "MTR-042",
"status": "running",
"location": "line-03",
"timestamp": "2026-09-30T10:42:15Z"}

The exact schema will depend on the implementation, but the principle is important: events need identity, time, and context.

  1. Build an Identity Layer

A sensor reading without identity can be difficult to use.
Suppose the system receives:

temperature = 21.8

It becomes much more useful when it can establish:
sensor → room → equipment → process → batch

This is where RFID, BLE, barcodes, UWB, and other identification technologies can become important. Identity is effectively the join key between the physical world and digital systems. Without good identity relationships, later analytics can become fragmented.

  1. Use the Edge for Local Processing

Not every event needs to travel directly to a central system in raw form.
An edge device or gateway can provide a local processing layer:

Sensor
↓
Edge Gateway
↓
Validate
↓
Normalise
↓
Filter / Aggregate
↓
Forward Event

For example, the edge layer might detect that a sensor has produced an impossible value, remove duplicate transmissions, or convert data from a device-specific protocol into a standardised event. Edge computing can also help when low latency or intermittent connectivity matters.

  1. Normalise Data Before AI

Different pharmaceutical systems may use different formats.
One system may identify an asset as:

EQUIP-102

while another may use:

102

and a third may use:

COMPRESSOR_102

If these identifiers are not reconciled, an AI system may incorrectly treat the same physical object as three different entities. A canonical data model or master-data mapping layer can help.

Conceptually:

Source A ─┐
Source B ─┼→ Normalisation → Canonical Event
Source C ─┘

This is often less exciting than the AI model, but it can be more important for system reliability.

  1. Connect the Existing Enterprise Systems

A pharmaceutical facility already has important digital systems.
Common examples include:

MES
ERP
LIMS
QMS
Warehouse Systems
Environmental Monitoring
Asset Management

The objective of AIoT should not automatically be to replace them. Instead, the architecture can provide controlled information exchange between them.
A simplified flow could look like this:

Environmental Sensor
↓
Edge Gateway
↓
Integration Layer
↓
Manufacturing Context
↓
MES / QMS
↓
Analytics

For pharmaceutical facilities that need this type of connectivity, PharmaFlux AI's pharmaceutical edge integration approach describes integration across MES, ERP, LIMS, QMS, RFID, BLE, environmental monitoring, and AIoT infrastructure.

  1. Add AI After the Data Foundation

A common mistake is selecting the ML model too early.
First solve:

What data exists? Can we trust it? Can we associate it with the right asset or process? Can we access the historical information required for training?

Then decide what type of AI is appropriate.
Possible applications include:

Anomaly detection
Identify operating conditions that differ from expected patterns.
Forecasting
Estimate future values such as equipment conditions or resource demand.
Classification
Categorise events based on historical examples.
Pattern detection

Identify relationships across equipment, materials, environmental conditions, and manufacturing events.The model should follow the problem.

  1. Don't Treat an AI Score as a Final Decision

Suppose an anomaly-detection model returns:

anomaly_score = 0.91

That number alone does not establish what happened.
The application may also need:

equipment_state
maintenance_state
process_state
environmental_state
batch_context

A decision layer can then combine the model output with business and operational rules.

AI Signal
+
Operational Context
+
Policy / Rules
↓
Recommended Action

This is particularly important when the resulting decision could affect manufacturing, quality, equipment, or controlled environments.

  1. Build for Auditability

Pharmaceutical software often needs more than functional correctness.
You also need to know:

Which device generated the event?
When was the event received?
Was the data changed?
Which model or rule produced the result?
Who reviewed the output?
What action followed?
What happened afterward?

A useful event record might therefore include:
{"event_id": "evt-92841",
"source": "sensor-214",
"asset_id": "tank-08",
"timestamp": "2026-09-30T10:42:15Z",
"ingested_at": "2026-09-30T10:42:16Z",
"model_version": "anomaly-v3",
"decision": "review_required"}

The actual implementation depends on the system and regulatory requirements, but the engineering principle is straightforward: Make important decisions traceable.

  1. Close the Feedback Loop

The system should not necessarily end at the AI output.
Consider:

Sensor
↓
AI identifies anomalies.
↓
The operator investigates.
↓
Maintenance performed
↓
New sensor data

The final data tells you whether the physical condition changed.
That creates a loop:

Observe → Analyse → Decide → Act → Verify

Verification can provide valuable information for evaluating models and workflows.

  1. Security Is Part of the Architecture

A connected pharmaceutical environment expands the attack surface. Devices, gateways, APIs, enterprise systems, and AI applications all need appropriate controls.

Depending on the architecture, this can involve:

Device authentication
Role-based access
Network segmentation
Encryption
Credential management
Secure APIs
Logging
Monitoring
Software-update controls

Security should not be bolted onto the system after the devices and integrations are already deployed.

The Architecture in One View
Putting everything together:

PHYSICAL WORLD
|
+---------------+---------------+
| | |
Sensors RFID/BLE Equipment
| | |
+---------------+---------------+
↓
Edge Gateway
↓
Event Processing
↓
Data Normalisation
↓
Integration Layer
↓
+------+------+------+------+
| | | | |
MES, ERP, LIMS, QMS, Other
| | | |
+------+------+------+------+
↓
Analytics / AI
↓
Decision / Workflow
↓
Human / System
↓
Action
↓
Verification

The important observation is that the AI model sits inside the architecture rather than defining the architecture.

Final Thought

Pharmaceutical AIoT is not fundamentally an "AI project". It is an integration problem involving physical devices, identity, data engineering, edge computing, enterprise applications, analytics, security, and operational workflows. The teams that solve those connections well can create systems where physical events become structured information and structured information becomes useful intelligence.

The pipeline is simple to describe:

Identify → Sense → Integrate → Analyse → Decide → Verify
Making every step reliable is the real engineering challenge.

Top comments (1)

Collapse
 
edgeai profile image
Emanuel Maceira •

The identity layer is doing a lot of the heavy lifting here. I’d version the sensor-to-batch mapping alongside the event, so a delayed gateway upload doesn’t get joined to whichever batch happens to be running when it arrives.