Loading 3D view

ECE 396 Senior Design · Team 14-S · UIC

An array of gas sensors that smell food spoiling before you can.

Three gas sensors hang under the lid of a food container, sample the air, and turn a ring of light amber while the food is still good to eat.

  • 3 gas sensors
  • 78 × 30 mm
  • 1000 mAh LiPo

01 · Mount

It snaps onto a magnet ring, anywhere.

Eighteen N52 magnets form a ring in the roof, MagSafe style. Stick the thin steel ring under any lid, shelf or drawer and the detector clicks on, and comes off again in a second.

02 · Enclosure

Two printed shells and a ring of light.

PETG shells, 78 mm across and 30 mm tall, held by three M2 screws. A clear ring at the seam carries the status light, so it shows from every side of the box.

03 · Electronics

One round board does the smelling.

A XIAO ESP32-C6 and a 1000 mAh LiPo ride on top. On the underside, a BME688, an SGP40 and an MQ-3 face straight down at the food, and three RGB LEDs shine into the ring.

04 · Air path

127 holes let the air in.

A PTFE membrane over the vented floor lets gases through and keeps moisture off the sensors. As the readings drift, the ring turns from green to amber to red.

How we gather data

One board, two containers, three unique sensors, a reading every minute.

Before the detector can judge food on its own, it needs to learn what spoiling smells like. The test rig records it: one container holds the food, the other holds nothing and reads the fridge's own air.

  1. 1Food lid BME688 gas, humidity and temperature
  2. 2Food lid SGP40 VOC index
  3. 3Food lid MQ-3 alcohol, on its carrier
  4. 4Control lid a second BME688, empty box
  5. 5ESP32-DevKitC-32E reads all four, once a minute
  6. 6microSD breakout every reading lands on the card
  7. 7STEMMA QT sockets one cable to each lid sensor
  8. 85 V input powers the MQ-3 heater
Board
Rev B, 100 × 75 mm, 2 layers, hand-soldered through-hole
Sensors
2 × BME688, SGP40, MQ-3
Logging
One row a minute to microSD; a button marks every lid opening
Trials
3 to 5 weeks of fridge runs

The sensors

Three noses, each smelling something different.

Spoiling food doesn't give off one gas. It gives off a mix that changes as it turns, so we read it three ways and compare the food box against the empty one.

Adafruit BME688 breakout board

Bosch BME688 · Adafruit #5046

Reads the air's fingerprint.

A heated gas element whose resistance falls as the air gets dirtier, plus temperature, humidity and pressure. Pressure and humidity also show when the lid was opened.

Measures
Gas resistance, temperature, humidity, pressure
On the rig
One in each lid: food (I²C 0x76) and control (0x77)
Adafruit SGP40 breakout board

Sensirion SGP40 · Adafruit #4829

Counts volatile compounds.

A metal-oxide sensor built for VOCs, the organic gases that rise as food breaks down. It reports a single VOC index the logic can compare over time.

Measures
VOC index
On the rig
Food lid (I²C 0x59)
MQ-3 alcohol gas sensor with its stainless steel mesh cap

Hanwei MQ-3 · SparkFun SEN-08880

Smells alcohol from fermenting fruit.

A tin-dioxide element behind a stainless steel mesh. Its conductivity rises with alcohol in the air, which fruit gives off as it starts to ferment.

Measures
Alcohol (ethanol), analog
Size
16.8 mm across, 9.3 mm tall without pins
Power
Heater under 750 mW, switched on only for readings

Sources: SparkFun MQ-3 · Winsen MQ-3 manual · Adafruit BME688 · Adafruit SGP40

Results

What the rig sees as food turns.

Four sensors, food against control, over five days. As food spoils, its air gets dirtier: the BME688's gas resistance falls, the VOC index and alcohol rise, and the control box stays flat.

Example data, not measured. Real fridge trials replace it.

Gas resistancekΩ · food control
VOC indexSGP40
AlcoholMQ-3 raw
Freshness score0 fresh · 1 spoiled

Why it matters

Most food is thrown out at home, not in the field.

29% of the US food supply went unsold or uneaten in 2024, about 70 million tons.
23.4million tons of that surplus came from homes, the largest share of any sector.
10.5million tons of the household surplus was produce, the food type wasted most.
58% of the methane escaping US landfills comes from food waste.

A fridge doesn't tell you what's about to go. The detector is built to say so while there's still time to eat it.

Sources: ReFED U.S. Food Waste Report 2026 · ReFED residential fact sheet · US EPA, landfilled food waste

How it decides

Two numbers set the colour.

The gas ratio compares the control box with the food: above 1, the food's air is dirtier. The VOC index adds the SGP40's view. Together they give a freshness score from 0 to 1.

score = 0.6 × gas + 0.4 × VOC · under 0.4 fresh 0.4 to 0.7 use soon over 0.7 spoiled

Draft logic from the plan. The thresholds get tuned on the fridge data.

The detector with its light ring green: fresh The detector with its light ring amber: use soon The detector with its light ring red: spoiled

0.00Fresh

Software

FSD Monitor watches the rig live.

Our Android app (Kotlin and Jetpack Compose) shows each board's sensors, a freshness gauge, and food against control. It turns sensors on and off one at a time, records labelled trials and exports them as CSV.

  • Live readings over Wi-Fi from each rig board
  • One switch per sensor, with its warm-up shown
  • Trials saved on the phone, shared as CSV

Version 0.1 runs on simulated data. The Wi-Fi link to the rig is next. Try the screen on the right.

FSD MonitorTest rig A · Team 14-S
RIG-A

Freshness

0.00Fresh

Food vs control

Sensors · 4 of 4 live

Progress

Where the build stands.

  1. Done

    Picked the problem

    From five team ideas to a fridge spoilage sensor for food containers.

  2. Done

    Chose the sensors

    BME688, SGP40 and MQ-3. Gas only; the camera was dropped.

  3. Done

    Test rig board, Rev A and Rev B

    KiCad schematic and layout, Gerbers, a clean design-rule check. Rev B moved to the DevKitC-32E and through-hole parts.

  4. Done

    Circuit simulations

    MQ-3 divider and heater switch pass. The battery run set a longer MQ-3 interval.

  5. Done

    FSD Monitor v0.1

    The app's screens on simulated data.

  6. Done

    Demo detector, v2 design

    Magnet ring and seam light ring added, shown on this page.

  7. Now

    Order parts, build the rig

    About a month to build.

  8. Next

    Fridge trials

    Three to five weeks of runs, food against control.

  9. Next

    Tune the logic, build the detector

    Set the thresholds from real data and put them on the XIAO ESP32-C6.

  10. Spring 2027

    Demo day

    The detector in a container, telling fresh from spoiled.

Team 14-S

Five engineers, one goal.

  • Amelia
  • Devarsh
  • Priyanjali
  • Erin
  • Saketh

ECE 396 Senior Design, University of Illinois Chicago.