Sound Spectrum Visualizer With Arduino Nano 33 BLE - Arduino Project Hub
Sound Spectrum Visualizer With Arduino Nano 33 BLE - Arduino Project Hub
current_site=arduino&setup=true&redirect_to=%2Fprojecthub%2Fjavagoza%2Fsound-spectrum-visualizer-with-arduino-
nano-33-ble-3c6261)
Capacitor 470 µF
(/projecthub/products/buy/564
× 1
90?
( (/proj (/projecthub/product
s=BAhJIhMzNzA0MTIsUHJvamVj
/ ecthu s/buy/56490?
dAY6BkVG%0A)
(/projecthub/pro p b/pro s=BAhJIhMzNzA0MTI
ducts/buy/5649 r ducts sUHJvamVjdAY6BkVG
0? o /buy/ %0A)
s=BAhJIhMzNzA0 j 5649
e 0?
MTIsUHJvamVjdA
Y6BkVG%0A) c s=BA
t hJIhM
h zNzA
u 0MTIs
b UHJva
/ mVjd
p AY6B
r kVG%
o 0A)
d
u
c
t
s
/
b
u
y
/
5
6
4
9
0
?
?
s
=
B
A
h
JI
h
M
z
N
z
A
0
M
T
I
s
U
H
J
v
a
m
V
j
d
A
Y
6
B
k
V
G
%
0
A
)
Resistor 2K
Depending on your RC Low pass filter and × 1
your selected cutoff frequency
Arduino IDE
(https://www.arduino.cc/en/main/ (https://www.arduino.cc/en/
(https://www.ar software) main/software)
duino.cc/en/mai
n/software)
Introduction
See how a bar graph respond to music and sound in a little OLED display. Lowest
frequencies toward the left end of the graph, highest frequencies toward the right.
The visualizer in action
Construction
Connections
Connect Mic GAIN depending the sensibility that better suits your system: VCC to
mic GAIN for 40dB, low sensitivity, GND to mic GAIN for 50dB, medium sensitivity
or let floating the mic GAIN for 60dB, high sensitivity.
Connect Analog pin 0 A0 to mic amp OUT
Connect 3.3V, GND, SDA (or analog 4 A4) and SCL (analog 5 A5) to I2C SSD1306
connect a 470 uF capacitor between VCC and GND in power bus
Getting low frequency noise?
The noise comes from any electric devices near your measuring system that are working.
All of the electronic devices work with a fixed frequency and voltage of alternative
current (AC) with the frequency of 50 Hz or 60 Hz is the power line frequency in your
country. You can use a faraday cage to eliminate the noise easily. Put your circuit inside a
box and connect the box to ground. Ground well the circuit.
#define ANALOG_PIN A0
Serial.begin(9600);
Serial.println("Sampling... please, wait. ");
}
void loop() {
// put your main code here, to run repeatedly:
newTime = micros();
// 1 millon samples
// take samples
for (int i = 0; i < SAMPLES; i++) {
unsigned long newTime = micros();
int value = analogRead(ANALOG_PIN);
vReal[i] = value;
vImag[i] = 0;
while (micros() < (newTime + sampling_period_us)) {
yield();
}
}
The screen is divided in eleven frequency zones and you a logarithmic scale grouping
frequencies similar to how the human ear perceives them.
Humans can detect sounds in a frequency range from about 20 Hz to 20 kHz. (Human
infants can actually hear frequencies slightly higher than 20 kHz, but lose some high-
frequency sensitivity as they mature; the upper limit in average adults is often closer to
15–17 kHz.)
Will use zones 3 to 13 (11 zones) for our representation.
Each bar represents the maximum value in the band with spaced lines and the mean
value in the band with a filled rectangle.
Values are shown using decibels with a preselected reference obtained in a heuristic way.
How it works?
How it works?
The audio samples are converted into a frequency spectrum using a fast Fourier
transform or FFT.
Then the spectrum is divided and grouped in 14 zones and only 11 zones are represented
in dB.
Electret Microphone
Electret is a quasi-permanently charged dielectric. It is made by heating a ceramic
material, placing it in a magnetic field then allowing it to cool while still in the magnetic
field. It is the electrostatic equivalent of a permanent magnet. In an electret microphone
a slice of this material is used as a part of the dielectric of a capacitor in which the
diaphragm of the microphone forms one plate. Sound pressure moves the diaphragm.
The movement of the plate varies the capacitance according to the sound pressure.
Given the built-in fixed charge of the dielectric, the voltage across the capacitor will also
vary. The electret capacitor is connected to the input of a built in FET amplifier. Electret
microphones are small, have excellent sensitivity, a wide frequency response and
generally a very low cost.
MAX9814 Microphone Amplifier
The MAX9814 is a microphone amplifier with automatic gain control (AGC) and low noise
microphone bias and and has a few options you can configure with the breakout.
The MAX9814 module has three amplifier settings (40dB, 50dB, 60dB). The default is
60dB, but can be set to 40dB or 50dB by jumpering the Gain pin to VCC or ground.
Internal low-noise microphone bias 1.25V, 2Vpp. The ouput from the amp is about 2Vpp
max on a 1.25V DC bias, so it can be easily used with any Analog/Digital converter that is
up to 3.3V input.
The Attack/Release ratio also can be modified, from the default 1:4000 to 1:2000 or
1:500.
For connecting directly to a Line Input, you need a blocking capacitor / coupling
capacitor to block the DC component. You can use a blocking capacitor in series above
1uF, depends on your system, if in doubt try from 33 uF to 100uF. A coupling circuit
allows AC signals to flow from one part to another while blocking the DC components. In
audio circuits, this is done to prevent DC components from distorting the audio output.
The effectiveness of a coupling capacitor depends on a broad array of frequency-
dependent parameters including insertion loss, equivalent series resistance and series
resonant frequency.
Power supply: 2.7V to 5.5V
Checking Microphone Module reponse with Analog Devices ADALM1000
Sensitivity
Sensitivity, the ratio of the analog output voltage or digital output value to the input
pressure, is a key specification of any microphone. Mapping units in the acoustic domain
to units in the electrical domain determines the magnitude of the microphone output
signal, given a known input.
The sensitivity of a microphone is the electrical response at its output to a given
standard acoustic input. The standard reference input signal for microphone sensitivity
measurements is a 1 kHz sine wave at 94 dB sound pressure level (SPL), or 1 pascal (Pa, a
measurement of pressure). A microphone with a higher sensitivity value has a higher
level output for a fixed acoustic input than a microphone with a lower sensitivity value.
Microphone sensitivity in decibels (dB) is typically a negative number; therefore, a higher
sensitivity is a smaller absolute value.
For analog microphones, the sensitivity is typically specified in units of dBV, that is,
decibels with reference to 1.0 V rms.
Reference level and Frequency Response
The frequency response of a microphone describes its output level across the frequency
spectrum. The high and low frequency limits are described as the points at which the
microphone response is 3 dB below the reference output level at 1 kHz. The reference
level at 1 kHz is customarily normalized to 0 dB.
Next steps
Arduino Nano 33 BLE uses a can do be better getting analogs reads. Next version I will
use FFT and Analog input optimized for the nrf52840.
CODE
SCHEMATICS
S DOWNLOAD (HTTPS://HACKSTERIO.S3.AMAZONAWS.COM/UPLOADS/ATTACHMENTS/1222234/SOUNDSPECTRUMV
c
h
e
m
a
t
i
c
s
f
r
i
t
z
i
n
g
soundspectrumvisualizer_qLzRsVPVlc.fzz
S
c
h
e
m
a
t
i
c
s
f
r
i
t
z
i
n DOWNLOAD (HTTPS://HACKSTERIO.S3.AMAZONAWS.COM/UPLOADS/ATTACHMENTS/1222235/SOUNDSPECTRUMV
g
COMMENTS
AUTHOR
(/projecthub/javagoza)
Enrique Albertos (/projecthub/javagoza)
4 PROJECTS 9 FOLLOWERS
FOLLOW (/PROJECTHUB/USERS/SIGN_UP?ID=476476&M=USER&REASON=FOLLOW&REDIRECT
PUBLISHED ON
November 22, 2020
WRITE A COMMENT
Share
(/projecthub/javagoza) (/projecthub/damiencatheline)
and 12 others
(/projecthub/BnBe_Club/mqtt-communication-with-the-nano-33-iot-wemos-d1-
boards-5f7f0e?ref=similar&ref_id=370412&offset=0)
MQTT Communication With the Nano 33 IoT & WeMos D1 Boards
(/projecthub/BnBe_Club/mqtt-communication-with-the-nano-33-
iot-wemos-d1-boards-5f7f0e?ref=similar&ref_id=370412&offset=0)
Project tutorial by BnBe Club (/projecthub/BnBe_Club)
9,826 VIEWS 2 COMMENTS 18 RESPECTS
(/projecthub/jingwen_zhu/getting-started-with-p5-ble-js-using-arduino-nano-33-ble-
120ea6?ref=similar&ref_id=370412&offset=1)
Getting Started with p5.ble.js Using Arduino Nano 33 BLE
(/projecthub/jingwen_zhu/getting-started-with-p5-ble-js-using-
arduino-nano-33-ble-120ea6?ref=similar&ref_id=370412&offset=1)
by jingwen_zhu (/projecthub/jingwen_zhu)
8,532 VIEWS 2 COMMENTS 21 RESPECTS
(/projecthub/liss/happy-birthday-melody-on-arduino-nano-with-3-way-polyphony-
c80c31?ref=similar&ref_id=370412&offset=2)
(/projecthub/150129/spot-welder-controlled-with-an-arduino-nano-8e90dc?
ref=similar&ref_id=370412&offset=3)
Spot Welder Controlled with an Arduino Nano
(/projecthub/150129/spot-welder-controlled-with-an-arduino-
nano-8e90dc?ref=similar&ref_id=370412&offset=3)
Project tutorial by Michael Marinis (/projecthub/Michael_Marinis) and PCBWay (/proje...
11,880 VIEWS 10 COMMENTS 26 RESPECTS
(/projecthub/touchmysound/automatizing-percussion-with-solenoids-the-sound-
compass-ce30b5?ref=similar&ref_id=370412&offset=4)
Automatizing Percussion with Solenoids: "The Sound Compass"
(/projecthub/touchmysound/automatizing-percussion-with-
solenoids-the-sound-compass-ce30b5?
Project tutorial by touchmysound (/projecthub/touchmysound)
5,490 VIEWS 4 COMMENTS 14 RESPECTS
(/projecthub/guntassingh2005/sps30-with-nano-33-ble-sense-46ec49?
ref=similar&ref_id=370412&offset=5)
(https://www.arduino.cc)
Powered by
(https://www.hackster.io)