Skip to content
← projects
DataIoT

Grain storage telemetry

Continuous cold room temperature readings, with automatic alerts when stored grain leaves the safe range.

In thirty seconds

Context
Grain stored outside the safe temperature range loses quality and can lead to the loss of an entire load. Manual inspections only reveal an overnight deviation the following morning.
What I built
A collector reads the temperature directly from each cold room controller every few minutes and stores the series in Postgres. The dashboard automatically alerts when a reading leaves the agreed range.
What changed
The time between a deviation and someone learning about it drops from hours to minutes, because readings are collected every few minutes and the threshold is checked on each one.
Limitations
The time advantage follows from the architecture, rather than field measurements. No count of detected deviations or measured before-and-after response times is provided here. The demo uses a synthetic series that reproduces system behavior without publishing client temperatures.
Cold rooms monitored
5
Reading interval
1–5 min
From reading to alert
minutes

The problem

Grain stored outside its safe temperature range loses quality and can eventually lead to the loss of an entire load. Traditional monitoring relies on someone making rounds and recording a number. A deviation starting at two in the morning may only be spotted at breakfast, after damage has already occurred.

Rounds also provide sparse samples: there is no data between visits. When a deviation appears in the spreadsheet, there is no way to know whether it started ten minutes or six hours earlier. That difference can determine whether the load is lost.

The solution

Each cold room controller already knows the temperature. It just was not sharing it. A Python collector queries the controllers over Modbus TCP every few minutes, reading the temperature register directly from the equipment, without an intermediary or vendor software.

Each reading becomes a row in an append-only PostgreSQL time series: cold room, timestamp and value. Nothing is overwritten, so the history supports both the current dashboard and reviews of a room’s behavior throughout the season.

The collector runs on an internal VM, triggered by a scheduler. It is deliberately simple: read, write and exit. It does not transform data, make decisions or keep state. A network failure costs one missing reading instead of blocking a pipeline.

Grafana queries Postgres directly, without an intermediate loading step. With no scheduled refresh between the database and the screen, operators see what is in the database, with only the query’s latency. Grafana evaluates the threshold on each new reading and sends an alert when the temperature leaves the range agreed with the operations team.

The benefit is the difference between learning about a deviation in minutes and discovering it the following morning.

Data note

This project was carried out in a professional setting. The company name, site locations, cold room capacities and real temperature series are not published.

What the demo shows

The dashboard below shows five cold rooms over one day. Four follow a normal cycle, fluctuating slightly with outdoor temperatures and compressor cycles. One loses refrigeration during the night: its curve separates from the others, rises gradually and crosses the configured threshold. The alert catches that crossing within one reading interval, before the morning inspection.

The series is synthetic and generated by a formula. It reproduces the system’s behavior, and its numbers do not represent any real load.

Cold room temperatures over one day

synthetic series · readings every 5 min
12152100h04h08h12h16h20h24hlimit 18°alert 05:25
5 cold rooms in normal operationRoom 3, above limitalert at 05:25 · Room 3 · 18.1°C
Room 3 loses refrigeration at 03:00 and warms gradually because stored grain has thermal inertia. It crosses the threshold at 05:25. The alert catches that crossing within one reading interval. A manual inspection would find the same deviation hours later.
View the series data
timeRoom 1Room 2Room 3Room 4Room 5
00:0013.513.814.014.014.2
02:0013.714.014.014.214.4
04:0013.814.215.614.314.6
06:0014.114.518.6 ▲14.614.8
08:0014.314.721.7 ▲14.915.1
10:0014.515.017.615.015.3
12:0014.615.115.215.115.4
14:0014.514.915.015.115.3
16:0014.414.714.814.915.1
18:0014.114.414.514.514.9
20:0013.914.314.214.414.6
22:0013.613.914.014.114.4
24:0013.514.014.013.914.2

Technologies

  • Python
  • Modbus TCP
  • PostgreSQL
  • Grafana