Arduino Sound Meter
Maybe your like
Embed the widget on your own site
Add the following snippet to your HTML:

In this video we make a sound level meter using an Ardiuino Una, a 1.3" OLED display and a microphone breakout board.
Read up about this project on 
Arduino Sound meter
Rayan kiwan3 6,354In this video we make a sound level meter using an Ardiuino Una, a 1.3" OLED display and a microphone breakout board.
IntermediateFull instructions provided6,354Things used in this project
Hardware components | |||||
![]() |
| × | 1 |
| |
![]() |
| × | 1 | ||
| × | 1 | |||
![]() |
| × | 1 |
| |
![]() |
| × | 1 |
| |
Software apps and online services | |||||
![]() |
| ||||
![]() |
| ||||
Story
Arduino Sound Level MeterIn this video we make a sound level meter using an Ardiuino Una, a 1.3" OLED display and a microphone breakout board. The sketch samples the AC waveform of the microphone for 50ms and records the minimum and maximum values. This gives us the peak-to-peak value for the sound.Then we convert this value to a calibrated decibel numeric value and then map that value to create a bar graph.
connections :
OLED:
connect VCC to 5V.
connect GND to GND.
connect SCL to A5.
connect SDA to A4.
sound sensor :
connect VCC to 5V.
connect GND to GND.
connect A0 pin to A0.
Read moreCode
- arduino oled sound meter
arduino oled sound meter
Arduino //-------------------------------------------------------------------------------------------- // LIBRARIES //-------------------------------------------------------------------------------------------- #include <SPI.h> #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #define OLED_RESET 4 Adafruit_SSD1306 display(128, 64, &Wire, OLED_RESET); //-------------------------------------------------------------------------------------------- // GLOBAL VARIABLES //-------------------------------------------------------------------------------------------- const int sampleWindow = 50; // Sample window width in mS (50 mS = 20Hz) unsigned int sample; //-------------------------------------------------------------------------------------------- // SETUP //-------------------------------------------------------------------------------------------- void setup() { Serial.begin(9600); //Serial comms for debugging display.begin(SSD1306_SWITCHCAPVCC, 0x3C); //OLED display start display.display(); //show buffer display.clearDisplay(); //clear buffer display.setTextSize(1); //Set text size to 1 (1-6) display.setTextColor(WHITE); //Set text color to WHITE (no choice lol) display.setCursor(0,0); //cursor to upper left corner display.println(" Arduino Sound Meter"); //write title display.display(); //show title delay(2000); //wait 2 seconds } //-------------------------------------------------------------------------------------------- // MAIN LOOP //-------------------------------------------------------------------------------------------- void loop() { unsigned long startMillis= millis(); // Start of sample window float peakToPeak = 0; // peak-to-peak level unsigned int signalMax = 0; //minimum value unsigned int signalMin = 1024; //maximum value // collect data for 50 mS while (millis() - startMillis < sampleWindow) { sample = analogRead(0); //get reading from microphone if (sample < 1024) // toss out spurious readings { if (sample > signalMax) { signalMax = sample; // save just the max levels } else if (sample < signalMin) { signalMin = sample; // save just the min levels } } } peakToPeak = signalMax - signalMin; // max - min = peak-peak amplitude float db = map(peakToPeak,20,900,49.5,90); //calibrate for deciBels display.setCursor(0,0); //cursor to upper left display.setTextSize(2); //set text size to 2 display.print(db); //write calibrated deciBels display.print(" dB"); //write units for(int x =5;x<114;x=x+6){ //draw scale display.drawLine(x, 32, x, 27, WHITE); } display.drawRoundRect(0, 32, 120, 20, 6, WHITE); //draw outline of bar graph int r = map(db,0,120,1,120); //set bar graph for width of screen display.fillRoundRect(1, 33, r, 18, 6, WHITE); //draw bar graph with a width of r display.display(); //show all that we just wrote & drew display.clearDisplay(); //clear the display }Credits
Rayan kiwan
36 projects • 2 followersFollowComments
Related channels and tags
- microphone
- oled
- oled sound meter
- sound meter
Tag » Arduino Db Meter Code
-
Arduino Based Decibel Meter With Sound Sensor - The IOT Projects
-
Measure Sound/Noise Level In DB With Microphone And Arduino
-
Decibel Meter Using Sound Module & Arduino With LCD Display
-
Arduino Based Decibel Meter With Sound Sensor & LCD Display
-
Arduino Decibel Meter - Instructables
-
IoT-Based Power Decibel Meter - Arduino Project Hub
-
Arduino Decibel Meter - Arduino Project Hub
-
Arduino Projects: Arduino Decibel Meter - Tutorial45
-
Arduino Sound Level Meter - Maker Portal
-
Arduino Sound Level Meter And Spectrum Analyzer 313
-
Dwyl/iot-decibel-meter: A Decibel Meter Built With An Arduino - GitHub
-
Arduino Library To Implement A Db Meter With A Analog Sound Sensor.
-
Gravity: Analog Sound Level Meter - DFRobot
_ztBMuBhMHo.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)



