• 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

This Article Has Been Shared 251 Times!

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

  • LED as Sensor For Arduino : Basic Sensors in Robotics

    LED Can Act as Light Emitter & Light Detector. Here is How To Use LED as Sensor For Arduino, Circuit & Code Explaining Sensors in Robotics.

  • Arduino Based Patient Monitoring : Overview

    Here is an Overview of F/OSS Arduino Based Patient Monitoring in Terms of Ease of Build, Cost, Features & Comparison With Proprietary.

  • Arduino DC Motor Control With Speed On TM1637 LED Display

    We Can Echo The Serial Input To Display Device. Here Is Arduino DC Motor Control With Speed On TM1637 LED Display With Basic Easy Circuit.

  • ESP8266 WiFi Module : Basic Theory

    ESP8266 WiFi Module is a Common Module Used in DIY Electronics Including Arduino. Here is Basic Theory Around Popular ESP8266 WiFi Module.

  • Arduino : IR Obstacle Detection Sensor For Dimming LED (Stop Event Facing Obstacle)

    Here is Arduino IR Obstacle Detection Sensor For Dimming LED to Stop Event Facing an Obstacle. Normally, We Use IR Obstacle Sensor to Initialize an Event, Like Lighting Up LED. We Can Do the Reverse.

Additionally, 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 (22.1K 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

  • Types of Blackjack Variants: Discover the Different Versions of the Game May 23, 2022
  • How Cloud, Robotics And Sensor Technologies Are Changing The Business Landscape May 23, 2022
  • Modernizing Your Business With a Hybrid Cloud Strategy May 22, 2022
  • Big Data in Sports May 20, 2022
  • FaaS Versus PaaS Deployment: What You Should Know May 18, 2022

About This Article

Cite this article as: Abhishek Ghosh, "Arduino Simple Music Analyzer VU Meter From Stereo Input," in The Customize Windows, May 1, 2018, May 24, 2022, https://thecustomizewindows.com/2018/05/arduino-simple-music-analyzer-vu-meter-from-stereo-input/.

Source:The Customize Windows, JiMA.in

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Privacy Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

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

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