We will probably improve it in future and need a reference English text guide

The blog does not seem to be active after 2012.

Arduino Simple Music Analyzer VU Meter From Stereo Input

We tested it and it is not exactly just bad. Wiring is very easy. Each negative pole of 8 LEDs will go to GND of Arduino. Each positive pole of LED will have a resistor (value can be 220 Ohm, 470 Ohm, 1 K Ohm depending on LED and board’s current). Stereo input will have only one pole going to Analog pin of Arduino. The other one will connect to GND of Arduino. You can use various colors of LEDs and the thing will look like this :

Advertisement

---

This is the code, which actually nice logic with an arbitrary value from analog pin as viewed from serial monitor of Arduino IDE :

Vim

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

//www.playingwitharduino.blogspot.com

int LED1=3;

int LED2=4;

int LED3=5;

int LED4=6;

int LED5=7;

int LED6=8;

int LED7=9;

int LED8=10;

int Valor;

int Valor1;

int Valor2;

int Valor3;

int Valor4;

void setup(){

Serial.begin(9600);

pinMode(LED1,OUTPUT);

pinMode(LED2,OUTPUT);

pinMode(LED3,OUTPUT);

pinMode(LED4,OUTPUT);

pinMode(LED5,OUTPUT);

pinMode(LED6,OUTPUT);

pinMode(LED7,OUTPUT);

pinMode(LED8,OUTPUT);

}

void loop(){

//Leemos elvalor

Valor=analogRead(A0);

//Transferimos los valores para saber cual era elestado anterior

Valor4=Valor3;

Valor3=Valor2;

Valor2=Valor1;

Valor1=Valor;

//Visualizamos los valores enSerial Monitor

Serial.print("Value: ");

Serial.print(Valor);

Serial.print("\t Value1: ");

Serial.print(Valor1);

Serial.print("\t Value2: ");

Serial.print(Valor2);

Serial.print("\t Value3: ");

Serial.print(Valor3);

Serial.print("\t Value4: ");

Serial.println(Valor4);

if(Valor1+Valor2+Valor3+Valor4==0){

digitalWrite(LED1,LOW);

digitalWrite(LED2,LOW);

digitalWrite(LED3,LOW);

digitalWrite(LED4,LOW);

digitalWrite(LED5,LOW);

digitalWrite(LED6,LOW);

digitalWrite(LED7,LOW);

digitalWrite(LED8,LOW);

}

else{

if(Valor>0){

digitalWrite(LED1,HIGH);

}

else{

digitalWrite(LED1,LOW);

}

if(Valor>50){

digitalWrite(LED2,HIGH);

}

else{

digitalWrite(LED2,LOW);

}

if(Valor>100){

digitalWrite(LED3,HIGH);

}

else{

digitalWrite(LED3,LOW);

}

if(Valor>150){

digitalWrite(LED4,HIGH);

}

else{

digitalWrite(LED4,LOW);

}

if(Valor>200){

digitalWrite(LED5,HIGH);

}

else{

digitalWrite(LED5,LOW);

}

if(Valor>250){

digitalWrite(LED6,HIGH);

}

else{

digitalWrite(LED6,LOW);

}

if(Valor>300){

digitalWrite(LED7,HIGH);

}

else{

digitalWrite(LED7,LOW);

}

if(Valor>350){

digitalWrite(LED8,HIGH);

}

else{

digitalWrite(LED8,LOW);

}

}

}

We can, actually do similar with 10 LEDs in same kind of wiring with different way of code :