ESP32 & ESP8266

Build a $10 ESP32-C3 Fridge Monitor That Logs Its Own Data

Build a $10 ESP32-C3 Fridge Monitor That Logs Its Own Data

Clear a Saturday afternoon and about PHP 600 of parts, and you can end the weekend with a fridge that keeps its own logbook. Hunter McGuire built a refrigerator monitor around a Seeed Studio XIAO ESP32C3 that stores its temperature history on the board itself, then sends the network a short summary instead of a firehose of raw readings.

What he built

The monitor reads temperature every five seconds. That works out to 17,280 samples a day. Pushing all of those to a broker would be wasteful for a box whose temperature moves slowly, so the firmware keeps a 30-minute rolling window in a RAM ring buffer and publishes one summary per minute: 1,440 messages a day, a 92 percent cut in traffic. Every sixth sample is also written to MicroTetherDB, a BTree store that sits on top of the btree module bundled with MicroPython’s ESP32 builds, configured to retain 60 records.

Local history is the point. A fridge can average a healthy 39°F and still hide a failing door seal or a compressor cycling far too often. Those show up in the shape of the curve, not in the current reading. Because the samples never leave the board, the ESP32-C3 can compute its own min, max and drift, raise a flag when something looks off, and hand over the raw records only when you ask for them.

Parts and cost reality

  • XIAO ESP32C3 — 21 x 17.5 mm, RISC-V core, 400 KB SRAM, 4 MB flash, Wi-Fi and USB-C, around $5
  • DHT22 temperature and humidity sensor, roughly $4, with a 10k pull-up resistor on the data line
  • Three jumper wires, a small breadboard, and an MQTT broker on whatever Pi or PC you already leave running

Nothing here needs a soldering iron if your XIAO came with headers. The tricky part is placement: run the DHT22 on a short lead into the fridge cavity and keep the board outside, because condensation on a warm PCB will do more damage than a cold sensor ever will.

Spend your Sunday on this

Flash MicroPython, wire the DHT22 data pin to GPIO D0, and start with a plain five-second print loop before you add the ring buffer. Get the sampling right, then bolt on storage, then MQTT. The full write-up with the buffer and database code is at Hackster. If your readings come back as NaN, the DHT22 library is almost certainly polling faster than the sensor’s 2-second minimum interval, so slow the loop before you blame the wiring.

Frequently Asked Questions

What hardware does this fridge monitor use?

A Seeed Studio XIAO ESP32C3 (21 x 17.5 mm, RISC-V core, 400 KB SRAM, 4 MB flash) paired with a DHT22 temperature and humidity sensor. Total parts cost is around $10, plus a 10k pull-up resistor, three jumper wires and a breadboard.

Why store the readings on the board instead of the cloud?

Sampling every five seconds produces 17,280 readings a day. Keeping a 30-minute rolling window in RAM and a 60-record BTree database in MicroTetherDB lets the board publish one summary per minute instead, which is 1,440 messages a day and 92 percent less traffic. It also means the device can spot a short-cycling compressor on its own.

What will I learn if I build this?

You will practice MicroPython on an ESP32-C3, single-wire sensor timing with the DHT22, ring buffers and embedded key-value storage, and MQTT publishing. The bigger lesson is edge data reduction: deciding what a device should compute locally versus what it should send upstream, which is the same trade-off behind most real IoT and thesis sensor-network designs.

This article was inspired by reporting from Hackster. Find the parts and modules to build it at Circuitrocks.

// written by Ann Arandia

Ann Arandia covers community projects and maker events for the Circuitrocks blog. She writes about local workshops, kid-friendly electronics, and the Philippine maker scene — the people, the meet-ups, the projects that come out of them.