0% found this document useful (0 votes)
85 views8 pages

Audio Visualizer With An LCD Display

This document provides instructions for building a simple audio visualizer using an Arduino, LCD display, and sound sensor. It consists of 4 steps: 1. Connecting the LCD display and sound sensor to the Arduino based on a provided circuit diagram. 2. Uploading code to the Arduino that reads sound levels from the sensor and displays increasing patterns of "#" characters on the LCD based on the sound levels. 3. Explaining that the sensor detects sound and sends levels to the Arduino, which displays different patterns on the LCD based on programmed thresholds. 4. Concluding that the visualizer demonstrates audio visualization and can be modified in various ways, such as adding more displays or customizing the displayed

Uploaded by

Zeal Education
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views8 pages

Audio Visualizer With An LCD Display

This document provides instructions for building a simple audio visualizer using an Arduino, LCD display, and sound sensor. It consists of 4 steps: 1. Connecting the LCD display and sound sensor to the Arduino based on a provided circuit diagram. 2. Uploading code to the Arduino that reads sound levels from the sensor and displays increasing patterns of "#" characters on the LCD based on the sound levels. 3. Explaining that the sensor detects sound and sends levels to the Arduino, which displays different patterns on the LCD based on programmed thresholds. 4. Concluding that the visualizer demonstrates audio visualization and can be modified in various ways, such as adding more displays or customizing the displayed

Uploaded by

Zeal Education
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

instructables

Audio Visualizer With an LCD Display

by Applexanand

Welcome to my third Instructable.


People love listening to music. It is as they say, music re ects our mood. And it is a spectacle to see music become 'alive'
right before our eyes. Well, that's what music visualization does.
According to Wikipedia, music visualization "generates animated imagery based on a piece of music. The imagery is
generated and rendered in real time and is synchronized with the music we play."

Music visualization is greatly seen on EDM concerts, where artists team up with VJs (or video jockeys) to create visual
spectacles, that can attract and mesmerize the audience. This can be done with video editing and e ects software such
as Davinci Resolve Fusion and Adobe After E ects. However, this can also be achieved using hardware.
In this Instructable we're gonna create a simple and easy-to-make audio visualizer using an Arduino UNO, a sound sensor
or a microphone, and a 16x2 LCD display. So without further ado, let's get started
Supplies:

Here are the list of components required for creating this project
16x2 LCD display
Arduino UNO (or Nano)
Two 1kΩ resistors
LM393 Sound Sensor Module
Jumper Cables and Breadboard
A computer for uploading the code

That's it. No other components are required.


All the items are easily available on Amazon or any other shopping app. Or you can just go to your nearest electronics
dealer to get your components.

Audio Visualizer With an LCD Display: Page 1


Audio Visualizer With an LCD Display: Page 2
Step 1: Connecting Each Component

Here are the following connections for both LCD and Sound Sensor Module to the Arduino UNO. This breadboard
diagram was made on a software called Fritzing.
I won't be going on too long with the technical details here, just where you need to connect and why.
LCD Connections
1. VSS and VDD to 5V and GND respectively, to power the LCD.
2. V0 connected to a 1k resistor and then to GND. We are not changing the contrast of the LCD here, so the
LCD will show the characters clearly.
3. RS (Register Select) to pin 13. It is con gured to give value HIGH so that Data Register is selected (you
don't need to know what a Data Register does, just that it helps in transferring data to the LCD)
4. R/W (Read/Write) to GND. We con gure the R/W pin to value LOW so that we can write data to the LCD.
5. E (Enable) to pin 12. This is used to latch (keep all the data coming from the Arduino to the data pins.
6. pins D4-D7 are connected to pins 11 to 8 respectively. They are the data pins which will transfer data from
Arduino to the LCD display
7. LED+ is connected to 1k resistor and then to 5V, and LED- to GND. This is for the LED backlight, which will
cause the LCD display to glow.
Audio Visualizer With an LCD Display: Page 3
Sound Sensor connections
The Sound Sensor Module detects the sound via a microphone and feeds into an op-amp (LM393-dual comparator). It
has 4 pins
VCC - Powered by +5V
GND - Ground
Analog pin (AO) - Analog output connected to analog input of microcontroller
Digital pin (DO) - Digital output connected to digital input of microcontroller

The four pins are connected to Arduino UNO as follows


1. VCC to 5V
2. GND to GND
3. AO to analog pin A0
4. DO to nothing (here we are not using digital output)

After following the steps exactly as mentioned, you are good to upload the program.

Step 2: Uploading the Program

The above image is the schematic of the circuit, also made on Fritzing.
I have created a program for the same circuit. If you have followed the exact steps for building the circuit, you can upload
the code directly to the Arduino Board, or you need to change some parameters according to your connections.
Following is the code for my circuit.
#include <LiquidCrystal.h>
LiquidCrystal lcd(13,12,11,10,9,8);
int soundsensor = A0;

Audio Visualizer With an LCD Display: Page 4


float t = 25;
float t1 = 5;

void setup() {
// put your setup code here, to run once:
pinMode(soundsensor, INPUT);
Serial.begin(9600);
lcd.begin(16,2);
lcd.setCursor(0,0);
lcd.print("Audio Visualiser");
delay(2000);
}

void loop() {
// put your main code here, to run repeatedly:

long sum=0;
int sensorVal= analogRead(soundsensor);//Input from soundsensor
Serial.println(sensorVal);
for(int i=0;i<100;i++){
sum+=sensorVal;
}
sum=sum/100;
/* here we are comparing the soundsensor values with the pre determined values (selected at random). If it goes above the pre dertermined value, the character will be displa
yed*/

if(sum>195){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("#");
lcd.setCursor(0,0);
lcd.print("##");
delay(t);
}
else{
lcd.clear();
lcd.setCursor(0,1);
lcd.print(" ");
lcd.setCursor(0,0);
lcd.print("#");
delay(t1);
}

if(sum>200){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("##");
lcd.setCursor(0,0);
lcd.print("####");
delay(t);
}
else{
lcd.clear();
lcd.setCursor(0,1);
lcd.print("#");
lcd.setCursor(0,0);
lcd.print("##");
delay(t1);
}

if(sum>205){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("###");
lcd.setCursor(0,0);
lcd.print("#####");
delay(t);
}
else{
lcd.clear();
Audio Visualizer With an LCD Display: Page 5
lcd.clear();
lcd.setCursor(0,1);
lcd.print("##");
delay(t1);
}

if(sum>210){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("####");
lcd.setCursor(0,0);
lcd.print("######");
delay(t);
}
else{
lcd.clear();
lcd.setCursor(0,1);
lcd.print("##");
delay(t1);
}

if(sum>220){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("#####");
lcd.setCursor(0,0);
lcd.print("########");
delay(t);
}
else{
lcd.clear();
lcd.setCursor(0,1);
lcd.print("###");
delay(t1);
}

if(sum>230){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("#######");
lcd.setCursor(0,0);
lcd.print("#########");
delay(t);
}
else{
lcd.clear();
lcd.setCursor(0,1);
lcd.print("###");
delay(t1);
}

if(sum>240){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("########");
lcd.setCursor(0,0);
lcd.print("#########");
delay(t);
}
else{
lcd.clear();
lcd.setCursor(0,1);
lcd.print("##");
delay(t1);
}

if(sum>260){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("############");
lcd.setCursor(0,0);
Audio Visualizer With an LCD Display: Page 6
lcd.print("##########");
delay(t);
}
else{
lcd.clear();
lcd.setCursor(0,1);
lcd.print("#");
delay(t1);
}

if(sum>280){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("##############");
lcd.setCursor(0,0);
lcd.print("############");
delay(t);
}
else{
lcd.clear();
lcd.setCursor(0,1);
lcd.print(" ");
delay(t1);
}
Serial.println(sum);
}

You can also modify the code to obtain di erent results. Feel free to post your modi cations in this Instructable
If you have any problems in uploading the code from the code box, I have also attached the code le, which contains the
same program as in the code box.

Download

https://www.instructables.com/ORIG/F52/XG79/L3ZW07DL/F52XG79L3ZW07DL.ino

Audio Visualizer With an LCD Display: Page 7


Step 3: My Hardware Works!

I will explain the working in a simpler way.


When music is played from the speakers, the microphone picks up the sound and sends it to the op-amp. The op-amp (or
operational ampli er, if you didn't know that) works as a comparator (a device which compares two values and sends an
output if one is greater than the other), and sends the output to the analog port in the Arduino UNO
We can access the output values from the Serial Monitor for analysis and use the potentiometer (soldered in the module
itself) to change the sensitivity (as per required).
I have programmed these values in such a way that if the input goes above a certain value, the LCD will display the
characters and it will increase in a bar like shape. The characters can be customized as per the user.
Well, a person can understand only a little bit by explaining with words, so I have uploaded a video too.

https://youtu.be/jtUPyxDADf8

Step 4: Everything Has an End

Congratulations for reaching this far!


It is as they say, if there is a beginning, there will be an end, and this Instructable has to end (or else you will get really
board reading this). And while this visualizer may not be perfect, it is simple and you can make it in 10 minutes (half an
hour, tops). And hey, it is as they say, a simple solution may or may not be perfect.
Now that I have shown you how the audio visualizer works, it is now up to you to build and modify the circuit. You can
add another LCD display (just to give that visualizer feeling), or change it altogether (bigger the display, better the
visualization).
There are endless ideas for modi cation, and all of this can be saved for a later date. I hope that all of you enjoyed
reading this Instructable. If you want more of these Instructables, please do share it with your friends and colleagues,
and encourage them to build this circuit.
Thank you and have a nice day.
Peace and Quiet

Audio Visualizer With an LCD Display: Page 8

You might also like