Skip to content

Circuit based on STM32 (Adafruit HUZZAH32 – ESP32 Feather Board) and a digital output (I2S) MEMS microphone (INMP441) that detects beeping washing machine or dryer and sends notification to smartphone.

License

Notifications You must be signed in to change notification settings

wklenk/stm32-i2s-beep-detection

Repository files navigation

stm32-i2s-beep-detection

Circuit based on STM32 (Adafruit HUZZAH32 – ESP32 Feather Board) and a digital output (I2S) MEMS microphone (INMP441 or SPH0645LM4H) that detects beeping washing machine or dryer and sends notification to smartphone.

Dependencies

Parts

Motivation

If your washing machine or dryer is located in the basement, you often are unsure if it already has finished its work. Continuous nagging questions of your partner like "Did the washing machine already beep" can drive you crazy. With this solution, you can install a small circuit in the basement next to the washing machine, and let it send you (and your partner) a push notification on the smartphone as soon as the washing machine has finished.

Wiring

I2S_WS <--> D25

I2S_SD <--> D22

I2S_SCK <--> D26

Wiring Note: I had some problem with selecting the left channel for the INMP441- Either the data sheets are wrong, or the manufacturer does not stick to it for some versions of it.

I2S Signals in Logic Analyzer

The Word Select (WS) signal equals the sample rate of 44.100 kHz.

The Serial Clock (SCK) is 2 x 16 x 44100 Hz = 1.54 MHz

I2S Signals in Logic Analyzer

How it works

STM32 microcontrollers already has Wi-Fi on board, so it is easy to connect to the local WLAN as soon as the beeping of the washing machine is detected.

The microphone uses a sample rate of 44100Hz and sends the audio samples to the STM32 using the I2S protocol

The STM32 uses a library to do a Fast Fourier Transformation and returns the most dominant frequency (peek frequency).

If this peak frequency is stable more than 500ms, then is can be interpreted as a beep of the washing machine, and the notification can be triggered.

Room for improvement

  • Could add code to distinguish the beep codes (frequency, rhythm of beeep) of several machines, enabling to distinguish between washing machine and dryer.
  • Optimization of sample rate and number of samples for FFT analysis.

Kudos

About

Circuit based on STM32 (Adafruit HUZZAH32 – ESP32 Feather Board) and a digital output (I2S) MEMS microphone (INMP441) that detects beeping washing machine or dryer and sends notification to smartphone.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages