Yun Jin Yonggledel임동교
Published © GPL3+

Innovation Lab #12: Sound Detector with RGB LED

A Bongilcheon High School Innovation Lab project.

BeginnerShowcase (no instructions)15 minutes3,314
Innovation Lab #12: Sound Detector with RGB LED

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Breadboard (generic)
Breadboard (generic)
×1
SparkFun Sound Detector
×1
RGB Diffused Common Cathode
RGB Diffused Common Cathode
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Sound Detector

Sound Detector

Code

Sound Detector

Arduino
Sound Detector LED Color Change
int red = 11;
int green = 10;
int blue = 9;
int volum;

void setup() {
  Serial.begin(9600);
  pinMode(red, OUTPUT);
  pinMode(green, OUTPUT);
  pinMode(blue, OUTPUT);
}

void loop() {
  volum = analogRead(A0);
  Serial.println(volum);
  delay(100);

  if (volum <= 50) {
    digitalWrite(red, LOW);
    digitalWrite(green, LOW);
    digitalWrite(blue, HIGH);
  }
  
  else if(volum <= 52) {
    digitalWrite(red, LOW);
    digitalWrite(green, HIGH);
    digitalWrite(blue, LOW);
  }

  else if(volum <= 55) {
    digitalWrite(red, HIGH);
    digitalWrite(green, LOW);
    digitalWrite(blue, LOW);
  }
}

Credits

Yun Jin Yong

Yun Jin Yong

6 projects • 10 followers
gledel

gledel

100 projects • 115 followers
Looking back on my childhood, I was happy when I was making something and I was proud of myself. "Making is instinct!"
임동교

임동교

0 projects • 12 followers

Comments