Clap Activated LED Using Arduino Nano, Microphone and OLED

by devkrishnavhora in Circuits > Arduino

53 Views, 0 Favorites, 0 Comments

Clap Activated LED Using Arduino Nano, Microphone and OLED

In this project, we will make a simple clap-activated LED system using an Arduino Nano, microphone sound sensor, and OLED display.

When the microphone detects a loud sound such as a clap, the Arduino Nano turns ON its built-in LED for 3 seconds. The OLED displays the current status, and the Serial Monitor also shows whether the LED is ON or OFF.

This is a simple project for learning how to use a microphone sensor, digital input, LED output, and an OLED display with Arduino.

Supplies

Arduino Nano

Deshbot shield

Microphone sound sensor module with A0 and D0

0.96-inch I2C OLED display

Jumper wires

USB cable

Wiring


Microphone to Arduino Nano

For this project, we use the D0 (digital output) of the microphone sensor.

Microphone Arduino Nano
---------------------------
VCC → 5V
GND → GND
D0 → D11

The A0 pin of the microphone is not used in this project.

OLED to Arduino Nano

OLED Arduino Nano
---------------------------
VCC → 5V
GND → GND
SDA → A4
SCL → A5

The Arduino Nano's built-in LED is connected to D13, so no external LED is required.

How It Works

The microphone module detects a sudden loud sound, such as a clap.

When the microphone's D0 output becomes HIGH, the Arduino:

  1. Turns ON the built-in LED.
  2. Displays LED ON on the OLED.
  3. Displays Clap Detected on the OLED.
  4. Prints LED ON in the Serial Monitor.
  5. Keeps the LED ON for 3 seconds.
  6. Turns the LED OFF.
  7. Displays LED OFF and Waiting... on the OLED.
  8. Prints LED OFF in the Serial Monitor.

The system then waits for the next clap.

OLED Display

When the system starts, the OLED shows:

READY

Clap Detector

When a clap is detected:

LED ON

Clap Detected

After 3 seconds:

LED OFF

Waiting...

Serial Monitor

Open the Arduino IDE Serial Monitor and set the baud rate to 9600.

The Serial Monitor will show:

System Ready
LED ON
LED OFF

This allows you to see when the Arduino detects the clap and changes the LED state.

Downloads

Conclusion


This project demonstrates how an Arduino Nano can detect sound using a microphone module and control an LED based on the detected sound.

The OLED provides a visual status display, while the Serial Monitor provides additional information during testing. The project can also be expanded to control relays, motors, lights, or other devices using sound commands.