Clap Switch With PICO 2 and MAX9814
by Arnov Sharma in Circuits > Arduino
295 Views, 2 Favorites, 0 Comments
Clap Switch With PICO 2 and MAX9814
Greeting everyone and welcome back. Here's something useful.
The CLAP Switch project employs the MAX9814 microphone amplifier module in conjunction with an OLED display. The OLED screen displays a printed message when a clap is detected.
The idea here was to create a simple breadboard setup for testing with the MAX9814 microphone module and PICO. Setting up this breadboard version was critical in developing a Clap Switch Circuit, which will be developed soon.
In this Instructables, we will explore the MAX9814 microphone sensor's setup guide and the preparation of a basic clap switch with it, utilizing an OLED screen and the PICO 2.
Supplies
These were the materials used in this project:
- Raspberry Pi PICO 2
- MAX9814 Microphone Amplifier Module
- Breadboard
- OLED display 128x32 SSD1306
- Jumper Wires
MAX9814- Microphone Amplifier Module
The MAX9814 is a high-performance microphone amplifier module designed for applications requiring precise audio capture and amplification. It features Automatic Gain Control (AGC), which dynamically adjusts the amplification level to accommodate varying audio input levels, ensuring consistent and high-quality output.
We use MAX9814 in our Clap Switch project because of the AGC, which dynamically adjusts the gain to ensure consistent audio output, even in varying noise environments. This means it can accurately detect claps regardless of background noise levels. Additionally, its low input-referred noise density and low Total Harmonic Distortion (THD) ensure that the audio signal is clear and precise, making the detection of clap sounds more reliable.
It operates on 2.7V to 5.5V, consumes around 3mA, and offers a 2V peak-to-peak output on a 1.25V DC bias, covering a frequency range from 20Hz to 20kHz. With a low input-referred noise density of 30 nV/√Hz and a THD of 0.04%, it ensures clear, high-fidelity audio. The amplifier supports programmable gain settings of 40dB, 50dB, and 60dB, provides a 2V microphone bias, and works in temperatures from -40°C to +85°C, packaged in a compact 14-pin TDFN.
PCBWAY GIFTSHOP
As for sourcing the MAX9814 Microphone Amplifier module along with PICO 2 we used in this project, we got them from PCBWAY's Giftshop.
https://www.pcbway.com/project/gifts_detail/Raspberry_Pi_Pico_2_a84bd81f.html
PCBWAY gift shop is an online marketplace where you can get a variety of electronics modules and boards for their genuine price, or you could use the PCBWAY currency, which is called beans.
You get beans after ordering something from PCBWAY as reward points, or you can also get them by posting any project in the PCBWAY community.
Also, PCBWay is hosting its 7th Project Design Contest, a global competition that invites electronics enthusiasts, engineers, and makers to showcase their innovative projects. The contest provides a platform for participants to share their creativity and technical expertise with the broader community.
This year’s competition includes three major categories: electronic project, mechanical project and SMT 32 project
With prizes awarded for the most exceptional designs, the contest aims to inspire and support innovation, making it an exciting opportunity for both professionals and hobbyists to gain recognition and connect with like-minded creators.
You guys can check out PCBWAY if you want great PCB service at an affordable rate.
PICO and MAX9814 Wiring
- We start the assembly process by placing all three components, which are the PICO 2, the SSD1306 OLED screen and the MAX9814 MIC Module, on the breadboard.
- Next, we first connected the VBUS of PICO 2 with the OLED's VCC and MAX Module's VCC, all three in parallel. GND of all three are also connected in parallel.
- We now connect the SDA and SCL of OLED with the GPIO4 and GPIO5 of the PICO.
- At last we connected the OUT pin of the MAX9814 module with GPIO26 of the PICO 2.
The wiring process has been completed.
CODE
We next uploaded the below sketch into the PICO 2.
Our Code Set up the OLED display and a microphone to detect claps and display corresponding messages.
The OLED is initialized with specific dimensions and an I2C address, and the microphone is connected to pin 26, with a clap detection threshold set at 500. When the microphone detects a sound above this threshold, it registers a clap, considering a minimum delay between claps and a defined window for detecting the second clap.
If a clap is detected, the OLED displays "Clap Detected" for five seconds; otherwise, it displays "Nothing happened." The code includes serial output for debugging, allowing for monitoring of analog values and confirming clap detection. This setup ensures effective and reliable clap detection with the appropriate message displayed on the OLED screen.
Make sure to install the OLED Library before using this sketch-
Result
This is the end result of this straightforward but crucial build: a CLAP SENSOR configuration that uses the MAX9814 microphone module alongside with the PICO 2 and an OLED screen for displaying output. In order to turn on or off AC appliances—a room light with a clap—we will be developing a real CLAP switch, thus this setup is crucial.
Setting up the breadboard version of the project was crucial and informative because it helped us understand exactly how to prepare it.
Overall, this project was a success, and i will be back with the CLAP Switch project shortly.
Thanks for reaching this far. Peace