sparklogic.ru

Logging NAS cabinet temperature with an STM32 and a DS18B20

A cabinet thermometer is useful when its readings match the question you are trying to answer. Put one probe near the NAS air intake and, if you have a second probe, place it in the room outside the cabinet. Record both channels under the same conditions so you can see whether a warm intake is specific to the cabinet.

Build the sensor side

The DS18B20 identifies devices individually on a 1-Wire bus. Use the wiring diagram and timing tables in the Analog Devices datasheet. For a bench prototype, power the sensor from a suitable external supply, share ground with the STM32, and use a pull-up compatible with your supply and GPIO configuration. Check the pinout for your exact sensor package or breakout before wiring.

Record the two device IDs and their physical positions. Read back the scratchpad, check its CRC, and start logging only after a completed temperature conversion. A missing device, failed CRC, or timed-out conversion should produce an error record. Give every sample a timestamp and keep the sensor ID in each row.

Place and check the probes

  1. Put both probes together in moving room air to see how closely the readings track. Use a known reference if you need absolute accuracy.
  2. Move the intake probe into its measurement position. Keep it clear of metal surfaces, drive cases, and direct exhaust from another device.
  3. Record idle operation and a representative file-copy or backup period. Log workload start, workload finish, and any door or fan changes.
  4. Confirm that unplugging a probe appears as a fault in the log. Check that the normal data stream resumes when you reconnect it.

The cabinet log describes the intake environment. Compare it with the NAS drive temperatures and the limits in each drive's documentation before setting an alarm. A small CSV with timestamps, device IDs, readings, and workload markers makes it possible to compare cooling changes later.