Smart Whistle Counter for Pressure Cooker

By Palak Patel

- Advertisement -
Comment errors or corrections found for this circuit, and get the chance to win big!

Pressure cooker is a very common utensil in almost all Indian households, keeping track of how many whistles have been blown to know when to switch off the gas stove is boring work, many of the time we miss a whistling sound. This article describes a smart electronic counter which counts the number of whistles and also time duration of cooking. It generates buzzer alarm when set counts or time duration is reached.  

Circuit Description

The Circuit diagram of smart whistle counter is shown in figure-1, It is based on Arduino Mega 2560 board. LM393 based sound sensor module is used for detection of sound of whistle. It operates at 5V and gives analog voltage proportional to sound level, which is fed to analog input pin (A0) of micro-controller.   4X4 keypad is used as an input device to set total number of whistles, or total time duration for cooking. 4X4 keypad is consists of 4 rows and 4 columns, which are connected to 8 digital input pins of micro-controller. In this project 0.91” inch I2C Serial 4-pin OLED display module is interfaced with Arduino, It displays number of detected whistles and time duration.  The resolution of the display is 128 X 32 and its driving voltage is 5V. It is connected on the SCL and SDA pins of the Arduino bord. Active alarm buzzer module is used in this project works on 5V. Connected on the digital output pin number 53 of Arduino board. It provides 1KHz sound signal. Buzzer is triggered when set whistle count is reached or cooking duration is reached.

Fig. 1 Circuit Diagram

Table 1: Parts list

Component Part Number Quantity
Micro-controller board  Arduino Mega 2560 1
Sound Sensor LM393 1
Display 0.91” OLED 128×32 1
Keypad 4X4 Keypad 1
Buzzer MH-FMD 1
Switch SPST 1
Battery  9V battery 1


Sound sensor output is connected to analog input of micro-controller, it is digitized with 10 bits resolution. A moving window low pass filter is implemented in software, with window size of 25000 samples. The sum value of window is compared with “high threshold”, a whistle is declared detected if the sum value is higher. The whistle sound stays high for few seconds, so whistle low detection is also important. If the detected flag is true and window sum value is less than “low threshold”, whistle low is declared. The section of C code is shown in figure-2.  This method of whistle detection is very robust, it works well in presence of other household surrounding noise.

- Advertisement -







       if ((sum > (sound_high_thresold*no_of_samples)) && wst_ongoing==false)





       if ((sum  <  (sound_low_thresold*no_of_samples)) && wst_ongoing==true)





The other functionalities of software are running clock timer (minutes & seconds), get inputs from 4×4 key pad, display data on OLED, play buzzer, etc. The display shows the number of detected whistles and time since start of cooking. When number of whistles reaches to the previous set value the module buzzes the alarm to indicate that the task of the pressure cooker is over and now its time to turn off the gas stove. Similarly if pressure cooker doesn’t make any whistle for long period of time then also it buzzes an alarm to indicate that there must be some issue with pressure cooker and we can immediately turn off the gas stove. Photographs of Smart whistle counter is shown in figure.

Smart Whistle Counter a) External view   b) Internal view
Fig. 2: Smart Whistle Counter a) External view   b) Internal view

Miniaturized product concept

A concept of miniaturized product which can be directly attached to any stainless steel whistle of pressure cooker is shown in figure 3. It will be based on a custom ASIC (Applications Specific Integrated Circuit), which will have a micro-controller core, analog front-end for mic (sound sensor), display driver, buzzer driver and interface to multifunctional keys. It will be powered through button cells or small rechargeable batteries. A COTS smart watch chip can also be reconfigured by changing software to achieve similar functionality. 

Miniaturized Smart whistle counter
Fig. 3: Miniaturized Smart whistle counter

Palak Patel is an Electronics engineer having experience in embedded system development for terminal automation industry. Currently she is doing freelancing for embedded systems projects.



What's New @

Most Popular DIYs

Electronics Components

Truly Innovative Tech