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 minView the series data
| time | Room 1 | Room 2 | Room 3 | Room 4 | Room 5 |
|---|---|---|---|---|---|
| 00:00 | 13.5 | 13.8 | 14.0 | 14.0 | 14.2 |
| 02:00 | 13.7 | 14.0 | 14.0 | 14.2 | 14.4 |
| 04:00 | 13.8 | 14.2 | 15.6 | 14.3 | 14.6 |
| 06:00 | 14.1 | 14.5 | 18.6 ▲ | 14.6 | 14.8 |
| 08:00 | 14.3 | 14.7 | 21.7 ▲ | 14.9 | 15.1 |
| 10:00 | 14.5 | 15.0 | 17.6 | 15.0 | 15.3 |
| 12:00 | 14.6 | 15.1 | 15.2 | 15.1 | 15.4 |
| 14:00 | 14.5 | 14.9 | 15.0 | 15.1 | 15.3 |
| 16:00 | 14.4 | 14.7 | 14.8 | 14.9 | 15.1 |
| 18:00 | 14.1 | 14.4 | 14.5 | 14.5 | 14.9 |
| 20:00 | 13.9 | 14.3 | 14.2 | 14.4 | 14.6 |
| 22:00 | 13.6 | 13.9 | 14.0 | 14.1 | 14.4 |
| 24:00 | 13.5 | 14.0 | 14.0 | 13.9 | 14.2 |
Technologies
- Python
- Modbus TCP
- PostgreSQL
- Grafana