• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Arduino Simple Music Analyzer VU Meter From Stereo Input

By Abhishek Ghosh May 1, 2018 1:52 pm Updated on May 1, 2018

Arduino Simple Music Analyzer VU Meter From Stereo Input

Advertisement

In our old guide we made VU Meter using microphone and LEDs, also our Arduino door bell project have kind of VU meter with 3 LEDs. Now, our one reader asked how to create good looking but easy Music Analyzer or VU Meter using Audio input from devices like microphone out or smartphone’s USB out. Here is Arduino Simple Music Analyzer VU Meter From Stereo Input Project. It is nothing but reproduction of an old German blog :

Vim
1
http://playingwitharduino.blogspot.in/2011/12/vumetro-leds-al-ritmo-de-la-musica.html

Basic reason to “copy” it is nothing but :

  1. That is easiest
  2. That blog post has demonstration video
  3. The particular code has way to debug on serial monitor
  4. Original is not in English
  5. We will probably improve it in future and need a reference English text guide

The blog does not seem to be active after 2012.

Advertisement

---

 

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 :

Arduino Simple Music Analyzer VU Meter From Stereo Input

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 el valor
Valor = analogRead(A0);
//Transferimos los valores para saber cual era el estado anterior
Valor4 = Valor3;
Valor3 = Valor2;
Valor2 = Valor1;
Valor1 = Valor;
//Visualizamos los valores en Serial 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 :

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
int led[11] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int input, i;
void setup()
{
  for (i = 0; i < 11; i++)
    pinMode(led[i], OUTPUT);
}
void loop()
{
  input = analogRead(A0);
  input = input / 12;
  if (input < 12)
  {
    if (input == 0)
    {
      for (i = 0; i < 11; i++)
      {
        digitalWrite(led[i], LOW);
      }
    }
    else
    {
      for (i = 0; i < input; i++)
      {
        digitalWrite(led[i], HIGH);
        delay(4);
      }
      for (i = i; i < 11; i++)
      {
        digitalWrite(led[i], LOW);
      }
    }
  }
}

 

Conclusion on Arduino Simple Music Analyzer aka VU Meter

 

We can use anything analog input as logic to visually or audibly represent it with Arduino and code. As number of LEDs are lower in number in these projects, we need not to think about how to increase the number of pins of Arduino board. That is exactly where we need to know about charplexing, multiplexing etc.

Charplexing, multiplexing like for 8×8 dot matrix displays will need more code and that code will become library.

Tagged With vumetro arduino
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Arduino Simple Music Analyzer VU Meter From Stereo Input

  • Arduino and LED Bar Display : Circuit Diagram, Code

    Here is a Guide Explaining the Basics, Circuit Diagram, Code on Arduino and LED Bar Display. LED Bar Display is Actually Like Multiple LED.

  • How to Control Multiple Relays With Single Arduino ESP32?

    Before How to Control Multiple Relays With Single Arduino ESP32 Testing, You Need to Learn How to Create Multiple MQTT Channels & Fetch Data.

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Arduino : Light ON One By One Following Foot Steps on Hallway

    This idea is good for automatic turning on and off multiple lights one by one while a person is walking staircase or walking through a passage or hallway. As IR Obstacle Sensors has physical limits, we can not use if the passage is wide like a road – it will fail for physical reasons. Human […]

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy