Jan 02, 2026

Fart Alarm

A hilariously fun project to detect emissions from flatulence

The Fart Alarm

The Fart Alarm is a small (tiny) device consisting of an ESP-32, VOC sensor, and DAC board with small speaker that detects the VOCs emitted by farts and plays a user selected audio file.

The idea came about while dreaming up ways to prank my sister and her teenage boys over the holidays. The idea was a small device capable of easily being hidden and run off a power bank for a relatively long period of time (days). It needed to play sounds loud enough to be heard, and needed to reliably be triggered by farts. The result was more successful than expected.

Hardware

The hardware for the fart alarm was:

  1. ESP32-QTPY from Adafruit (https://www.adafruit.com/product/5700)

  2. AudioBFF from Adafruit (https://www.adafruit.com/product/5769)

  3. SGP-40 VOC sensor (https://www.adafruit.com/product/4829)

  4. Micro SD Card (up to 32gb)

Firmware

The firmware is custom firmware that reads the data from the VOC sensor, applies the sensiron VOC index algorithm to calculate the air quality index from there. This is then compared against three thresholds built into the firmware - yellow, red, and critical.

The firmware also creates a new wireless network that can be connected to which will launch a captive portal and allow the user to adjust the AQI alert thresholds for your environment, select the audio file that will play when red and critical alerts are triggered, and do a full system test to manually trigger an alert. It also provides visibility into the last 60 minutes of AQI values so you can see how things are trending over time - and observe spikes associated with farts or other events that negatively impact air quality.

The device is relatively cheap to make, is small, uses little power, and can be easily hidden. It's perfect for pranks... and kids absolutely love it.