Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Controlled RGB LED Light Show with Sound Detection

View and Edit Project In Cirkit DesignerImage of Arduino UNO Controlled RGB LED Light Show with Sound Detection

Circuit Documentation

Summary

This circuit is designed to interface an Arduino UNO with an RGB LED and a KY-038 sound sensor module. The Arduino UNO controls the RGB LED by toggling its red, green, and blue channels to create a blinking effect. The KY-038 module is connected to the Arduino for sound detection, with its analog and digital outputs interfaced with the Arduino's analog and digital pins, respectively.

Component List

Arduino UNO

KY-038 Sound Sensor Module

RGB LED (Wokwi compatible)

Resistor (200 Ohms)

Wiring Details

Arduino UNO

KY-038 Sound Sensor Module

RGB LED (Wokwi compatible)

Resistor (200 Ohms)

Documented Code

void setup() {
  // Initialize RGB LED pins as outputs
  pinMode(13, OUTPUT); // LED to Red
  pinMode(12, OUTPUT); // LED to Green
  pinMode(11, OUTPUT); // LED to Blue
}

void loop() {
  // Red LED on for 2 seconds, then off
  digitalWrite(13, HIGH);
  delay(2000);
  digitalWrite(13, LOW);
  delay(2000);
  
  // Green LED on for 2 seconds, then off
  digitalWrite(12, HIGH);
  delay(2000);
  digitalWrite(12, LOW);
  delay(2000);
  
  // Blue LED on for 2 seconds, then off
  digitalWrite(11, HIGH);
  delay(2000);
  digitalWrite(11, LOW);
  delay(2000);
}

This code is designed to sequentially blink the red, green, and blue channels of the RGB LED connected to the Arduino UNO. Each color is turned on for two seconds and then turned off before the next color is activated. The cycle repeats indefinitely.