---
title: "Cold-Chain Monitor"
description: "The coldchain core is host-unit-tested on nativesim/native/64; the full app runs end-to-end on native_sim with synthetic environment data covering every state. No model ships (stub + deterministic classifier/fallback). HiL with a real BME280 + a trained model is bench-gated."
source: https://docs.alplab.ai/sdk/examples/cold-chain-monitor
---

# `cold-chain-monitor`

:::warning[`[UNTESTED]` — v0.9 paper-correct]
The `cold_chain` core is host-unit-tested on `native_sim/native/64`; the full app runs end-to-end on native_sim with synthetic environment data covering every state. No model ships (stub + deterministic classifier/fallback). HiL with a real BME280 + a trained model is bench-gated.
:::

A pharma/food **cold-chain integrity monitor**: sample a BME280 T/RH/P sensor on a slow logging cadence, compute standards-backed metrics (temperature-excursion time, Mean Kinetic Temperature, dewpoint), classify the integrity state, and emit an AI anomaly score. The *environmental* edge-AI vertical.

Source: [`examples/ai/cold-chain-monitor/`](https://github.com/alplabai/alp-sdk/tree/main/examples/ai/cold-chain-monitor).

## Honest scope

A reference cold-chain logger. MKT, dewpoint, and excursion-time are the real, recognized metrics; thresholds are configurable per product. **Not** a certified GxP / 21-CFR-Part-11 data logger — no validated audit trail, no calibration traceability, no tamper-proof storage.

Standards-backed metrics: **MKT** (Mean Kinetic Temperature, ICH Q1A / USP &lt;1079&gt;) is the single temperature delivering the same cumulative thermal stress as the fluctuating profile (`MKT ≥ arithmetic mean`, so a brief hot spike counts for more than its duration); **dewpoint** (Magnus) flags condensation / mould risk when ambient T nears it.

## Pipeline

```
BME280 (I2C) --window--> cold_chain (mean/min/max, MKT, dewpoint, excursion)
  -> cc_classify (OK / TEMP_EXCURSION / MKT_EXCEEDED / CONDENSATION_RISK)
  -> <alp/inference.h> anomaly score (deterministic fallback) -> CC record
```

## `board.yaml`

```yaml
libraries:
  - name: tflite-micro
    cores: [m55_hp]

som:
  sku: E1M-AEN801

preset: e1m-evk
supported_boards:
  - e1m-evk
  - e1m-x-evk

pins:
  - { e1m: E1M_I2C0, macro: EVK_I2C_BUS_SENSORS, doc: "BME280 environment sensor bus" }

cores:
  a32_cluster:
    os: "off"
  m55_hp:
    app: ./src
    inference:
      default_arena_kib: 64
    peripherals:
      - i2c                   # BME280 link

chips:
  - bme280                    # temperature / humidity / pressure

diagnostics:
  log_level: info
```

The DEEPX DX-M1 NPU is populated on `E1M-V2M101` / `E1M-V2M102` / `E1M-V2M103` — not on `E1M-V2N101` / `E1M-V2N102` / `E1M-V2N103`, the same PCB without it. Pick either via `som.sku` in `board.yaml`.

## Expected output

```
# CC,t_s,state,temp_c,rh_pct,dewpoint_c,mkt_c,excursion_min
CC,256.0,OK,5.0,50.0,-4.6,5.0,0.0
CC,768.0,CONDENSATION_RISK,5.0,95.0,4.3,5.0,0.0
```

## See also

- [`<alp/inference.h>`](https://docs.alplab.ai/sdk/api/inference) · [`<alp/chips/bme280.h>`](https://docs.alplab.ai/sdk/chips)
- [`multimodal-fusion-pdm`](https://docs.alplab.ai/sdk/examples/multimodal-fusion-pdm) — BME280 as one of three fused modalities
- [Examples overview](https://docs.alplab.ai/sdk/examples/overview)
