top of page

Heading 1

 best view in FULL SCREEN

Project Name : Light Organ

 

Project description:

Light Organ is a piece of music analyzer that will lit the leds according to the music loudness (DB). The left led will lit at the lowest volume (threshold). The higher the music volume , more leds will lit (from left to right).

 

Components:

Sound Sensor – Locate at the top of the PCB. Looks like a small MIK.

Five (5) Leds – represent the loudness of the music. Could be even more to make a higher resolution for analyzing the music.

 

contact to                                                    yohizu@gmail.com

 

Code for arduino

===========

/*

Light Organ
This example code is in the public domain.
 Create  13 November 2014
  by Yohi Zucker

צריך לכוון את רמת הסף לערך קרוב לערך במצב שקט. הקפיצה בהשמעת קול היא בערכים ממש נמוכים כ +5 עד +7 יחידות
נורית לד ימניתדולקת כעשר ערך היציאה האנלוגית גבוהה מערך הסף. כבויה , כאשר מתחת
 נורית לד שמאליתמינת מצב יציאה דיגיטלית
ניתן לכוון את ערך הסף השקט של הרגש על ידי סיבוב הבורג של הרכיב הכחול
*/

int DO = 2; //Pin for Digital Output - DO//I didn't use this option.
int DA = A0; // Pin for Analog Output - AO
int threshold = 535; //Set minimum threshold for LED lit
int sensorvalue = 0;
 
void setup() {
  Serial.begin(9600);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
}
 
void loop() {
  sensorvalue = analogRead(DA);  //Read the analog value
  Serial.print("Analog: ");
  Serial.print(sensorvalue);  //Print the analog value
  Serial.print("  ");
  Serial.print("Digital: ");
  Serial.println(digitalRead(DO));  //Print the digital value
 
  if (sensorvalue >= threshold) { //Compare analog value with threshold
    digitalWrite(3, HIGH);
     if (sensorvalue >= threshold+1){
     digitalWrite(4, HIGH);
       if (sensorvalue >= threshold+2){
         digitalWrite(5, HIGH);
           if (sensorvalue >= threshold+3){
             digitalWrite(6, HIGH);
              if (sensorvalue >= threshold+4){
                digitalWrite(7, HIGH);
                 if (sensorvalue >= threshold+5){
                   digitalWrite(8, HIGH);
                   if (sensorvalue >= threshold+6){
                     digitalWrite(9, HIGH);
                     if (sensorvalue >= threshold+7){
                       digitalWrite(10, HIGH);
  }}}}}}}}
 
 
 
 
 
   
   
   
    
   
  //}
 else {
    digitalWrite(3, LOW);
    digitalWrite(4, LOW);
    digitalWrite(5, LOW);
    digitalWrite(6, LOW);
    digitalWrite(7, LOW);
    digitalWrite(8, LOW);
    digitalWrite(9, LOW);
   digitalWrite(10, LOW);
 }
}

 
 
bottom of page