Тёмный

SOUND SENSOR DATA ON ARDUINO SERIAL PLOTTER - Arduino tutorial #30 

Bas on Tech
Подписаться 7 тыс.
Просмотров 101 тыс.
50% 1

The CZN-15E sound sensor with microphone is able to detect sound. This sensor or for example used in a so called "clap sensor". In this tutorial I'll explain how you can read the sound sensor, and plot the result on the Arduino IDE's serial plotter. In order to draw this chart we need to process the sensor data with a technique called sampling.
The plotted amplitude is the amount of sound sampled over time. It does NOT represent a sound wave. The sensor is binary, it only measures if there is sound or not and is therefore incapable of determining sound frequency or amplitude.
The Arduino for beginners tutorials series guides you through the world of Arduino. A video is around 10 minutes and shows you step-by-step how to build the circuit and write the code. The website contains the course material, circuit diagram, Arduino code and shopping list of all the components used in the tutorial.
⬇️ Arduino code, circuit diagram and part list arduino-tutorials.net/tutoria...
👉 More tutorials and projects on arduino-tutorials.net
🇳🇱 Deze tutorial is ook in het Nederlands beschikbaar • 🇳🇱 GELUIDSSENSOR OP SE...
CHAPTERS:
00:00 Introduction
00:16 Components
00:26 Sound sensor
02:09 Building the circuit
02:40 Arduino code - part 1
04:08 Arduino code - part 2
COMPONENTS
🇨🇳 Arduino Uno (clone) with cable - AliExpress
arduino-tutorials.net/r/Jd28hF
🇳🇱 Arduino Uno (clone) - Opencircuit
arduino-tutorials.net/r/8237Hd
🇳🇱 Arduino Uno SMD (original) - Opencircuit
arduino-tutorials.net/r/Ud29dh
🇳🇱 Arduino Uno Chip (original) - Opencircuit
arduino-tutorials.net/r/Jd82ha
🇨🇳 Jumper wire assortment (MM/MF/FF) - AliExpress
arduino-tutorials.net/r/Fh378fg
🇨🇳 Jumper wire male-female - AliExpress
arduino-tutorials.net/r/sjf83h
🇳🇱 Jumper wire male-female - Opencircuit
arduino-tutorials.net/r/a7DH2g
🇨🇳 CZN-15E sound sensor - AliExpress
arduino-tutorials.net/r/2387yD
🇳🇱 CZN-15E sound sensor - Opencircuit
arduino-tutorials.net/r/8374HDv
VIDEO SUMMARY:
In this tutorial Bas is showing how to use a sound sensor to show audio on the serial plotter. He explains that the sensor captures sound waves with a microphone and translates them into resistance which is the same as the amount of sound. When there is low resistance, the sensor sends 5V to the OUT and when there is lot of sound it sends around 0V. The potentiometer on the sensor can be adjusted to set the level of the boundary that determines whether the signal will be seen as LOW or HIGH. Then, Bas demonstrates how to build the circuit, connect the sensor to the Arduino, and run the code. To display the intensity of the sound, he shows how to use the serial plotter. He also mentions that he changed the code to sample the audio and use millis() to measure the elapsed milliseconds since the last time.
#arduino #BasOnTech

Опубликовано:

 

13 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 379   
@ishantripathi9707
@ishantripathi9707 2 года назад
Great videos. The world needs more teachers like you.
@BasonTech
@BasonTech 2 года назад
Thanks really appreciated! 😃
@momisoma6564
@momisoma6564 Год назад
yes we do
@slapshot256
@slapshot256 3 года назад
This works incredibly well!
@BasonTech
@BasonTech 3 года назад
Hi, great to hear! 😃
@kijijikhalid601
@kijijikhalid601 Год назад
outstanding explanation, to make the sound wave plot alive using millis() was a genius idea. thank you
@BasonTech
@BasonTech Год назад
Thanks! 😃
@juliogCyg
@juliogCyg 10 месяцев назад
Great code!. THX for sharing with us!
@BasonTech
@BasonTech 10 месяцев назад
Thanks for letting me know, great to hear! 😃
@ijlie
@ijlie 2 года назад
Geweldig! Mijn eerste stap naar de bouw van een lichtorgel.
@BasonTech
@BasonTech 2 года назад
Great! 😃
@randzvlog3364
@randzvlog3364 3 года назад
thanks LOT FOUND IT.MORE POWER HOPE TO SEE ANOTHER VERSION OF TUTORIALS ABOUT SOUND SENSOR
@BasonTech
@BasonTech 3 года назад
You're welcome! 😃
@sanjanaattanayake4231
@sanjanaattanayake4231 3 года назад
Simple and Precise 😍 Thank you Brother😃 RU-vid please recommend me these things 😑
@BasonTech
@BasonTech 3 года назад
Thanks! Unfortunately I can't control the RU-vid algorithms 😉 So liking the videos is probably the only thing that helps 😄
@ferrelmanafe9162
@ferrelmanafe9162 3 года назад
Your video is amazing, thank you so much
@BasonTech
@BasonTech 3 года назад
Hi, great to hear! Thanks! 😃
@fantastique1369
@fantastique1369 3 года назад
Great tutorial ! Thank you !
@BasonTech
@BasonTech 3 года назад
You're welcome! 😃
@BasonTech
@BasonTech 4 года назад
👉 Don't forget to check arduino-tutorials.net for the code and more Arduino tutorials and projects. If you have questions, don't hesitate to ask them in de comments. Remember: There are no stupid questions 😃 🔔 Want to stay up-to-date with the latest videos? Subscribe to the Bas on Tech channel!
@ahmedal-farsi1038
@ahmedal-farsi1038 2 месяца назад
clear and simple thanks
@BasonTech
@BasonTech 2 месяца назад
You're welcome! 😃
@vinhvo9177
@vinhvo9177 3 года назад
Really amazing video, thank you
@BasonTech
@BasonTech 3 года назад
Great to hear, thanks! 😃
@ac4cars656
@ac4cars656 2 года назад
Excellent video, very well explained....
@BasonTech
@BasonTech 2 года назад
Thanks, appreciated! 😃
@ACID2BREAKS
@ACID2BREAKS Год назад
Great Video! Would like to see how the next step, showing the frequencies, should look like
@BasonTech
@BasonTech Год назад
That would be a completely different video, since this sensor can't do that 😄 But great suggestion for a future video 😃
@TutosIngenieria
@TutosIngenieria 4 года назад
Really amazing video, thank you lots.
@BasonTech
@BasonTech 4 года назад
Glad you liked it! 😃
@keegancorey7750
@keegancorey7750 3 года назад
you prolly dont care but if you're stoned like me atm you can watch all the latest movies and series on InstaFlixxer. Have been streaming with my gf for the last few weeks xD
@peterhendrix8347
@peterhendrix8347 3 года назад
@Keegan Corey Yea, have been watching on InstaFlixxer for years myself :D
@umairansar5415
@umairansar5415 4 года назад
Exactly what I was looking for.
@BasonTech
@BasonTech 4 года назад
Great to hear! If you have any questions, just ask 😃
@umairansar5415
@umairansar5415 4 года назад
@@BasonTech So the sensor you used is for binary sound detection. Instead, I want to do full multi-channel sound recording so that I can play the recorded sound back? Will I need the same sensor? If no, please suggest alternative. Thanks!
@BasonTech
@BasonTech 3 года назад
Nope, this sensor can't do that. I am also wondering if the Arduino has enough processing power to record multi channel audio. I think the Sony Spresense would be more suitable since it is fast and has multi mic input out of the box: developer.sony.com/develop/spresense/specifications
@mohamedalismacktalk382
@mohamedalismacktalk382 Год назад
Thank you so much that helped me a lot
@BasonTech
@BasonTech Год назад
Great to hear! 😃
@kemala.7486
@kemala.7486 3 года назад
great video. thanks 👏
@BasonTech
@BasonTech 3 года назад
Thanks, glad you like it! 😃
@eranfeit
@eranfeit 4 года назад
Nice demo
@BasonTech
@BasonTech 4 года назад
Thanks! 😃
@makeit955
@makeit955 3 года назад
thanks this really helped
@BasonTech
@BasonTech 3 года назад
Great to hear! 😃
@FlowMo
@FlowMo 4 года назад
Thanks alot!
@BasonTech
@BasonTech 4 года назад
You're welcome! 😃
@pendraaa322
@pendraaa322 3 года назад
Thanks a lot bro ! It's help me for my project :)
@BasonTech
@BasonTech 3 года назад
Great to hear! 😃
@user-dj8et5np4e
@user-dj8et5np4e 3 года назад
Helo, I might be a little late but does the project really work with his code? I'm thinking of doing one for school. :D
@BasonTech
@BasonTech 3 года назад
@@user-dj8et5np4e Why shouldn't it work?
@user-dj8et5np4e
@user-dj8et5np4e 3 года назад
@@BasonTech I was just wondering due to my fear of messing up, apologies if it offended you
@BasonTech
@BasonTech 3 года назад
@@user-dj8et5np4e No worries! The only thing you can mess up is with the hardware. If you connect the wires in a wrong way causing a short circuit of something 😃
@Icecoldvibez
@Icecoldvibez 3 года назад
Thaaank you
@BasonTech
@BasonTech 3 года назад
My pleasure! 😃
@drazenlastname254
@drazenlastname254 3 года назад
Very clear. 1 question. Is there a formula i can use to show the Sound waves in Db values?
@BasonTech
@BasonTech 3 года назад
Hi Dražen, this sensor is a binary sensor, it just tells you if there is sound. By sampling I try to get a bit of an idea of the intensity of the sound. There is no way this can tell you the amount of decibels. If you want to measure that you'll need another sensor.
@ipyanamwaisekwa8209
@ipyanamwaisekwa8209 2 месяца назад
Thank you for the nice explanations. Is there any ways which I can be able to save the plotted audio into WAV or MP4 to an SD Card or by using PySerial?
@BasonTech
@BasonTech 2 месяца назад
Nope, it just tells you if there is sound or not. No frequency, dB or anything else.
@brittvandenboogaard8750
@brittvandenboogaard8750 2 года назад
Thank you very much for your clear instructions! I only have one weird outcome, when there is no sound, the value is very high and when there is sound the value gets lower. I just copied the code so i think that can't be the problem, but I use another sound sensor: Robodyn Sound Detector. It has 4 pins instead of 3, I connected the Digital Out with digital 8 on arduino. Do you maybe know what went wrong? Thank you!
@BasonTech
@BasonTech 2 года назад
Hi, it sounds like the signal is being inverted by your sensor. This is no problem, just change the code so you'll get the inverted value. So 0 needs to become 1024 and 1024 needs to become 0 😃
@ACID2BREAKS
@ACID2BREAKS Год назад
@@BasonTech Could you elaborate a little bit more on that. e.g. where exactly to change the code?
@jedi_interceptor
@jedi_interceptor Год назад
@@ACID2BREAKS try changing the digitalRead from LOW to HIGH
@untraditional6235
@untraditional6235 3 года назад
Hello, great video, still havent bought any of arduino. Im wondering if i would desolder Microphone and replaced it with RFID antenna, could i read RFID tags?
@BasonTech
@BasonTech 3 года назад
Hi, that is not going to work. I had a tutorial about RFID, but I took it down because of an error in the video. I can't promise when I upload the fixed version.
@amanshastry2651
@amanshastry2651 3 года назад
Hey, great project!! Can we obtain the same output which shows the amplitudes if we connect the out pin to a PWM pin on the Arduino and do an analog read instead of a digital read? Thank you
@BasonTech
@BasonTech 3 года назад
Thanks! The sensor I am using does not have an analog out. So in this tutorial I basically try to mimic an analog signal by sampling a digital one 😃
@amanshastry2651
@amanshastry2651 3 года назад
@@BasonTech Got it, thank you
@shillowcollins6392
@shillowcollins6392 11 месяцев назад
Thanks for such a clear video. If I want to monitor the absence of sound in 10 seconds, how will I code that?
@BasonTech
@BasonTech 11 месяцев назад
What have you tried so far, and on what are you stuck?
@majorchristopherkyle1077
@majorchristopherkyle1077 Год назад
Wow..just wow! Thanks ...you solved my problem...... I would also like to know whether you are familer with the sound sensor module which has analog pin output too....I expected such a waveform when I connected it to the analog pin but there's no difference at all no matter what sound I make! I thought the mic was damaged but everyone had the same problem!
@BasonTech
@BasonTech Год назад
The digital sampling I use in this tutorial will not work with the analog output. With an analog output it should be a log easier. Just print the value read on the analog port to the serial monitor. You should see a value variation depending on your sound.
@Mohammedmalkawi33
@Mohammedmalkawi33 3 года назад
Thanks for helpful video.. Just i have a question how can get the sample on binary form for the sound and saying.... With regards
@BasonTech
@BasonTech 3 года назад
You can't, the sensor just tells you if there is sound or not. It does not provide you with any waveform audio.
@diba2963
@diba2963 10 месяцев назад
Hi Boss, This is such an amazing video, it worked for me however I have 2 questions: 1. I'm struggling to read the signals from the Audio sensor using a Osciloscope, if I want to create a program that will action something based on some frequency (i.e. a clap light switch) can I use the plotter instead of the osciloscope ? 2. My plotter view is like very big, I would like to zoom out the plotter to have your same view, is there any setting to change to make it ? THANKS !.
@BasonTech
@BasonTech 9 месяцев назад
Hi, to display the signals on an oscilloscope you have to output them as analog signals. My code sends it to the serial monitor and the IDE makes the graph. So you then have to modify the code that you use an analog pin to set the correct value over time. Further this sensor does not measure frequency, so you can't really detect a certain frequency. To zoom out my guess is that you need to multiply the values by a certain factor which fits your need.
@Icecoldvibez
@Icecoldvibez 3 года назад
I have the same mic as you. Do you think it is possible to analyze different freuqencies wirh the arduino? Maybe with the Help of the FFT libary?
@BasonTech
@BasonTech 3 года назад
Yes, you can analyse different frequencies with an Arduino. Unfortunately not with this sensor. This is a "binary" sensor so it tells you if there is sound or not and that's it.
@wangyilu1910
@wangyilu1910 2 года назад
thank for the video and do u know how to detect the frequency of acoustic signal using this circuit?
@BasonTech
@BasonTech 2 года назад
You can't this sensor is a binary sensor and only tells you of there is sound or not. With this code we are mimicking some kind of detection by using sampling.
@kasadunrajapaksha2298
@kasadunrajapaksha2298 2 года назад
ela
@avocadosnchocolates
@avocadosnchocolates 3 года назад
THANKS THIS HELPED ME A LOT!! may i know like where do i enter the code on
@BasonTech
@BasonTech 3 года назад
Hi, what do mean exactly?
@utkuserin9750
@utkuserin9750 2 года назад
Great demonstration. Is it possible to recognize a sound with arduino. I mean I want to sample a sound like a door bell, then if the doorball rings arduino let say gives 1 for example.
@BasonTech
@BasonTech 2 года назад
Unfortunately not. The "waveform" you see is not actually a waveform. It is a graphical representation of sampled sound intensity. There is no actual information about the sound in the waveform.
@aiswaryababu7694
@aiswaryababu7694 3 года назад
Hello, it's very helpful video and nice presentation. Thankyou so much. I'am doing a project based on this but instead of aurdino how can we interface sound sensor to FPGA. If you know anything about it kindly reply.
@BasonTech
@BasonTech 3 года назад
I have no idea, sorry 😃
@aiswaryababu7694
@aiswaryababu7694 3 года назад
Thanks for your response
@radhevirani
@radhevirani 2 года назад
1k th like ✌️😬
@gowthamj8301
@gowthamj8301 2 года назад
Thanks for you explanation and i need help from you sir, the code to shows only analog value of sound but i like to see in dB value , how to convert Analog sound data to dB ? can you put video on this or any idea?
@BasonTech
@BasonTech 2 года назад
You can't. This sensor does not detect dB nor the frequency of sound. What I detect is the frequency of the sensor detecting sound. Maybe the text version of the tutorial makes it clearer: arduino-tutorials.net/tutorial/drawing-sound-sensor-data-on-serial-plotter
@zandwu2678
@zandwu2678 3 года назад
Hello. Great video sir! I just want to ask something sir if its okay. I want to turn on a LED when it reaches a certain amplitude on the plotter (300 for example). I copied your code and tried a bunch of stuff but it wont work. Sometimes the LED is just steadily on sometimes it wont even turn on. What should i do sir? Thank you in advance
@BasonTech
@BasonTech 3 года назад
Hi, could you tell me what exactly you've tried already?
@benbelkacemdrifa-ft1xr
@benbelkacemdrifa-ft1xr Год назад
Would you please make a video about sound classification using sound sensor.
@BasonTech
@BasonTech 11 месяцев назад
What do you mean by sound classification?
@DreThePlug
@DreThePlug 4 года назад
Amazing video man! super dope I just bought this component and your video is exactly what I was looking for. I also make tech footage too check out my projects when you get the time
@BasonTech
@BasonTech 4 года назад
Glad I could help! 😃
@DreThePlug
@DreThePlug 4 года назад
@@BasonTech When I make my project using it I am going to shout you out !
@DreThePlug
@DreThePlug 4 года назад
Hello I shouted you out in my most recent footage! thanks for all the help! I recently posted it.
@BasonTech
@BasonTech 4 года назад
Thanks! :)
@DreThePlug
@DreThePlug 4 года назад
@@BasonTech welcome
@wilnil
@wilnil 4 года назад
Awesome video and production qulity! I subscribed and look forward to more videos :) Unfortunately the code does not seem to work for me. I'm using a different sensor though, the ky-037 or 38, which both has digital out and analog outputs. When using the digital output from the sensor and hooking it up as you did, I'm getting a zero's in serial monitor except for when shouting really loudly or clapping. Any idea why?
@BasonTech
@BasonTech 4 года назад
Thanks! What I see on pictures is that on the sensor there is a blue potentiometer which you can adjust. With this you should be able to adjust the sensor sensitivity. Hope this works 😃
@wilnil
@wilnil 4 года назад
@@BasonTech Thanks that worked! The potentiometer was so ridiculously sensitive though :D
@hasnainahmed7605
@hasnainahmed7605 2 года назад
Thank you very much sir. Sir I want to analyze multiple sound sensors data. Is it possible to analyze on same serial plotter and detect the sound sensed by a particular sensor.? Thank you in advance 😊
@BasonTech
@BasonTech 2 года назад
Hi, you want multiple lines plotted on the same screen?
@bernardcorpinjr.8754
@bernardcorpinjr.8754 3 года назад
Hello, can it connect to a LED then when it reaches a certain sound level (your desired or assigned level) the LED will turn on or will light up?
@BasonTech
@BasonTech 3 года назад
Hi, sure you can. Just add an if statement which monitors the current value. When it is larger you turn on the LED.
@redabitar
@redabitar 3 года назад
Excuse my simple question, but I have a goal in mind to record this data over time and stream it to a text file. I understand that I would require an SD card module connected to the arduino in order to do so. Therefore I am considering going for a raspberry pi to fulfil this purpose (given the added benefits of using a Pi). My question is: would this sensor module work with a raspberry Pi as well, and would I be able to reproduce this scenario with a modified script? (Using a while loop in any programming language for example, instead of the native arduino loop)?
@BasonTech
@BasonTech 3 года назад
Hi, this sensor should probably work on a RPI as well. Keep in kind that this is not audio waveform data. You are not able to play this data as audio.
@jesusitarodriguez2381
@jesusitarodriguez2381 3 года назад
Hi thanks for the video. I have a question: If I have the audio of the SIM800L when a call is outgoing, Can I connect from the speaker outputs of SIM800L to this sound sensor instead of micro inputs in order to detect when someone answer its smartphone for example? thanks
@BasonTech
@BasonTech 3 года назад
Hi Jesusita, this sensor isn't really the right device for that. I think you need to look into a VU-meter device to which you can connect the speaker out of you SIM800L
@jesusitarodriguez2381
@jesusitarodriguez2381 3 года назад
@@BasonTech thanks
@samitabarde2122
@samitabarde2122 2 года назад
Hi there! Absolutely informative video. one question, how can we use this sensor to detect a specific audios like cry, laugh and trigger a relay?
@BasonTech
@BasonTech 2 года назад
Hi, this is not possible. The sensor just detects if there is sound or not. The highest achievable would be "clap detection".
@samitabarde2122
@samitabarde2122 2 года назад
@@BasonTech so can this be achieved using KY-037 or 038?
@samitabarde2122
@samitabarde2122 2 года назад
@@BasonTech I am trying to turn on the camera when the cry is detected using sound module..help me out please 😅
@BasonTech
@BasonTech 2 года назад
It could be, the biggest issue is to detect the characteristics of the waveform what we see as "cry" of "laugh".
@Lgp2111
@Lgp2111 2 года назад
interesting video! i guess we can figured out the frequency of the sound based of the sampling? i hope u answer my question
@BasonTech
@BasonTech 2 года назад
Hi, unfortunately we can't. This sampling calculates the amount of sound the sensor detects in the given sample time. It is unrelated to the frequency of sound. It is more the frequency of the amount of sound detected 😃
@automation4446
@automation4446 3 года назад
Thank you for the video, great stuff!!. I suppose the same can be done with other similar sensors such as KY-037 or KY-038. Thank you!
@BasonTech
@BasonTech 3 года назад
The KY-037 or KY-038 are different sensors. While the sensor in the video is binary (it detects if there is sound or not), the KY-037 or KY-038 have also an analog out to give the intensity of the sound. In my video I kinda mimic this behaviour which is not necessary for the KY-037 or KY-038. 😃
@frans0072
@frans0072 3 года назад
Hoi Bas, Werkt dit ook met die met een rode printplaat lijken op wat kleine verschillen het zelfde. En wat kun je er later mee??
@BasonTech
@BasonTech 3 года назад
Heel lastig te zeggen, heb je een linkje naar het component?
@dogrsbr
@dogrsbr 4 года назад
Congratulations was cool, but have you ever thought about making a spectrum analyzer using WS2818 led strip and the sound sensor?
@BasonTech
@BasonTech 4 года назад
Hi Luiz, yes I did! Unfortunately time is currently not on my side, but it is definitely something I want to look into 😃
@dogrsbr
@dogrsbr 4 года назад
@@BasonTech do you have the code ready?
@BasonTech
@BasonTech 4 года назад
Nope, I have the parts laying around, but not yet build anything
@medb2322
@medb2322 2 года назад
hello, sir I want to ask you if ever worked with esp8266 I want to visualise the frequencies and their amplitudes on the serial plotter .
@BasonTech
@BasonTech 2 года назад
The code should work on an ESP8266 😃
@yavuzcan233
@yavuzcan233 2 года назад
first of all thanks for your video. I and my son trying to make recgognize to speech. if i say for example "yellow" i can see some numbers on serial monitor. if i describe some diffrent patterns can i recognize that word and light the yellow red ? please . thanks from Turkey
@BasonTech
@BasonTech 2 года назад
Hi, that is not going to work on an Arduino. A Raspberry Pi for example should be more capable of such a task.
@abhyudaya98
@abhyudaya98 3 года назад
Hi Bas on Tech. I am using a mic and custom op amp circuits to amplify the sound. But when i run part 2 of your code, i am not able to see the same kind of values your are seeing. Using a headphone jack breakout I was able to hear the audio input to the mic. But my arduino is not showing me those waveforms. Would you be able to help me out on this?
@BasonTech
@BasonTech 3 года назад
Kinda hard to say, I've made this tutorial specific for this kind of sensor who is a binary sensor. A mic and amp does not work this way.
@achmadarifmunaji3320
@achmadarifmunaji3320 3 года назад
very good video. roughly what sensor is suitable for measuring the number of dB?
@BasonTech
@BasonTech 3 года назад
Thanks! The datasheet states: Sensitivity: -46±3dB -42±3dB -38±3dB -34±3dB (0dB=1V/pa,1KHz) more info at eva.fing.edu.uy/file.php/585/materiales/HD/CZN-15E.pdf
@achmadarifmunaji3320
@achmadarifmunaji3320 3 года назад
@@BasonTech thanks
@sensatyajeet1360
@sensatyajeet1360 3 года назад
Hello sir..I want to make vu meter using ws2812b RGB led and sound sensor..so if I use the statement" if sound value is between x and y then display z leds"..will it be the correct statement.. I want to use if statement ..can I guide me sir. (X,y,z are just examples I have taken)
@BasonTech
@BasonTech 3 года назад
This sensor is not so suitable for a VU meter since it is binary. Have a look at the KY-037 or KY-038 which has an analog out. The correct state for between 50 and 60 is: if((x > 50) && (x < 60)) {
@elyaakoubyyassine336
@elyaakoubyyassine336 2 года назад
thank you. i ask if we can gets sound of leak water in pipline with arduino
@BasonTech
@BasonTech 2 года назад
Recognising a specific sound with an Arduino is not really possible. You then want to look into a Raspberry PI with a sound recognition software. I have no experience with this.
@sedraahmed250
@sedraahmed250 Год назад
Does it measure if the sound is high or low, or does it measure the dice of the letter that comes out of the mouth?
@BasonTech
@BasonTech Год назад
It does measure if there is sound or not during the giving sample time. It has no sense of frequency, tone, voice etc.
@MiG-25IsGOAT
@MiG-25IsGOAT 7 месяцев назад
Amazing! Can you show us if there is a way in which we can convert this analog read into dB? really useful if you could. thanks in advance
@BasonTech
@BasonTech 6 месяцев назад
You can't with this sensor. The sensor only detects if there is sound, thats is. There is no way to detect dB, volume, intensity or frequencies.
@MiG-25IsGOAT
@MiG-25IsGOAT 6 месяцев назад
@@BasonTech Oh, Thanks for the response. I was starting to think that this sensor is not really for the environment.
@noviaakarostiani8366
@noviaakarostiani8366 2 года назад
thank you. how if we want using 4 microphone, and make them to be array ?
@BasonTech
@BasonTech 2 года назад
Just use another pin for each microphone. You can then read each mic individually.
@majorchristopherkyle1077
@majorchristopherkyle1077 Год назад
Hey....can I know how /what position did you set the Screw/Potentiometer
@BasonTech
@BasonTech Год назад
The same as the thumbnail shows. Unfortunately my guess is that the position is not really comparable between devices.
@ismaelgarzonsaldana6368
@ismaelgarzonsaldana6368 2 года назад
Hi, I have a question, what are you exactly report in the serial plotter? Whats the meaning the numbers in x-asis and y-asis
@BasonTech
@BasonTech 2 года назад
Hi Ismael, great question! I've added the explanation to the website as well: arduino-tutorials.net/tutorial/drawing-sound-sensor-data-on-serial-plotter The x-axis (horizontal) is the time axis. We set SAMPLE_TIME to 10ms. This means that each horizontal point is equal to 10ms. So if we see the number 100 on the x-axis (100x 10ms), 1 second has passed. The y-axis (vertical) is the number of moments within 10ms that the Arduino sensed sound. This is related to how fast the Arduino can go through the loop(). For example, an 8Mhz Arduino will be able to do fewer measurements per second than a 16Mhz Arduino. They are therefore not exact values, but should be viewed more relative to each other.
@chamodya6503
@chamodya6503 2 года назад
Sir, Thank you . It's a great tutorial. sir, is there a way to try this code for this sound sensor with an ATmega32 microcontroller ?
@BasonTech
@BasonTech 2 года назад
I can't think of anything why that wouldn't work 😃
@chamodya6503
@chamodya6503 2 года назад
@@BasonTech ok thank you sir ..😊
@johnpay8796
@johnpay8796 3 года назад
Hi Bas - I find it very difficult to tune the potentiometer - the same as the one in your link. The "sweet spot" between registers "ON" all the time vs registers "OFF" all the time is a hair's breadth. Literally even touching the pot with a screwdriver is enough to turn it from full on to full off, or vice versa. I bought a different mic board, and got the same result. Any ideas on this?
@BasonTech
@BasonTech 3 года назад
Hi John, that is weird. The only thing I could think of is that for example you use a 5V sensor on a 3V Arduino or something like that. On a 3V Arduino everything higher than 1.5 is considered to be 1. When having 5V connected that is 80% of the time, instead of 50%.
@johnpay8796
@johnpay8796 3 года назад
@@BasonTech Thanks, but no I tried them on 5V and 3.3V. It's either full on or full off, with a hair trigger separating the two states. I've ordered another mic and if that doesn't work I'll give up. When I am able to find the sweet spot, after 10 minutes it's already worked its way out into the full on or full off states, without any external intervention, rendering it useless for the 24/7 ambient noise-level monitoring that I was hoping to use this for...
@BasonTech
@BasonTech 3 года назад
Keep in mind that sometimes it takes me multiple tries as well to get things figured 😄
@viplovekanaujia3674
@viplovekanaujia3674 3 года назад
Can this be used with arduino fft because it looks like analog output but will it behave like analog signal with arduino fft like an analog signal from sound sensor
@BasonTech
@BasonTech 3 года назад
Hi, unfortunately I have no experience with Arduino FFT. The signal from the sensor is digital with my sampling you kinda get an analogish signal but is not real analog like a soundwave
@Naber796
@Naber796 Год назад
Can we make a 3d sound localization system with czn15e mics??? I want exact point where the sounds come from.
@BasonTech
@BasonTech Год назад
Theoretically yes, but you then need a very precise timer and calibrated sensors to do such measurements.
@Nino-pp5hr
@Nino-pp5hr 3 года назад
can i ask if you know how to show the decibel equivalent of the sound? I've having a hard time with it .
@BasonTech
@BasonTech 3 года назад
You can't with this sensor. It does not measure decibel at all.
@anamixnetwork8446
@anamixnetwork8446 2 года назад
Is it possible to save the audio files as .wave? Using this sensor
@BasonTech
@BasonTech 2 года назад
Not at all. The data is a sampled representation of the sound intensity. It is not a so-called "waveform". So the data you see does not in any way represent the actual audio content.
@nurulnadhirah5836
@nurulnadhirah5836 3 года назад
Hi ! 1. Can I connect more than one sound sensor at one time? 2. Can the data transfer to a bluetooth serial transreciever?
@BasonTech
@BasonTech 3 года назад
1. You can connect as many as you have ports on your Arduino 2. It should be possible to send the data over Bluetooth Keep in mind that this is not audio data but just sampled data on whether there is a sound or not. It is not audio waveform data.
@Trix8574
@Trix8574 2 года назад
what do the values represent on the Y-axis? I cant seem to still understand what those values mean on the chart?
@BasonTech
@BasonTech 2 года назад
During the sample period we count if there was sound or not. We keep track of a counter during this sample period. Every time we detect sound we increase the value by 1. So you can see it as the amount of time over the sample period.
@user-ny5be4lm8z
@user-ny5be4lm8z 2 года назад
great.. now what i need to do is somehow transmit the output via wifi then access it remotely ...the ultimate aim is to monitor sound levels remotely...plase guide me on the setup i need cheers
@BasonTech
@BasonTech 2 года назад
On what part are you getting stuck?
@reefermaker
@reefermaker 4 года назад
I found that it was detecting too much noise and if was looking a mess. If you put the line " delay(1); " below the if statements it delays the feedback just enough to smooth the graph and looks much neater.
@BasonTech
@BasonTech 4 года назад
Keep in mind that delay(1) actually tells the cpu to wait 1ms. So basically you're telling the Arduino to ignore the sensor values within that 1ms. Another way to smoothen is to widen your measurement window and subtract a base level where the noise is 😃
@reefermaker
@reefermaker 4 года назад
@@BasonTech I find that it sends an unwanted peak. It's one way of removing it :)
@BasonTech
@BasonTech 4 года назад
btw didn't the peak go away by adjusting the sensitivity?
@sandeepsandy6066
@sandeepsandy6066 3 года назад
sir!! can you code the program to display the same wave on OLED display ?
@BasonTech
@BasonTech 3 года назад
If you combine my OLED tutorial from ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-SuSqalI90G0.html with this tutorial, you should be able to write it yourself 😃
@nemanjaasanin9975
@nemanjaasanin9975 3 года назад
Great Video, but us there a way to have the serial plotters values as a usable value in an if statement, I am working on a small project for example when the serial plotter hits over 100 I want a led to turn on, and when its below 100 to turn off, but I just dont know what variable to put into the if statement.
@nemanjaasanin9975
@nemanjaasanin9975 3 года назад
Like the serial plotter shows the values up to 1000, but when using an if statement or the sampleBufferValue the statement only works when its being compared to a 1, and nothing over 1
@BasonTech
@BasonTech 3 года назад
Hi, in my code I use: if (millisElapsed > SAMPLE_TIME) { This if checks if the sample time has passed. You can add an additional if inside this if (or extend the if) for your desired value like: if ((millisElapsed > SAMPLE_TIME) && (sampleBufferValue > 100)) {
@nemanjaasanin9975
@nemanjaasanin9975 3 года назад
@@BasonTech Perfect, that works great, thanks for the help!
@BasonTech
@BasonTech 3 года назад
Great to hear! 😃
@nonoali3156
@nonoali3156 3 года назад
I am using just an electret condenser microphone but without the module circuit. how can I show the output of the microphone on the serial plotter with intensity?
@BasonTech
@BasonTech 3 года назад
You then need a component which does convert your mic into an analog signal suitable for your Arduino. E.g. 0-5V for 5V Arduinos of 0-3V for 3V Arduinos. Never did this though, so I don't know which component would work.
@1e0_oki
@1e0_oki 3 года назад
Hi, the video bis pretty cool, but I was thinking what if i want to manipulate the frequency of the sound and the pitch, how that could be done. I geuss, we need to connect the mic to a digital to analoge converter, that could be done by coding as well but we need to use equations. Anyway, do you have a clue of how that could be done
@BasonTech
@BasonTech 3 года назад
You can't since this is a binary sensor. The plot is only plotting the amount of sound, not the frequency. If you want to work with the frequency of sound you'll need another sensor 😃
@jain28vaibhav
@jain28vaibhav Год назад
​​@@BasonTech you please make a video for frequency vs amplitude
@mwaseemaslam3478
@mwaseemaslam3478 7 дней назад
Can you help me to build a circuit for my University project?
@myintlwinhtoo6683
@myintlwinhtoo6683 2 года назад
Sir so how to do make a combination for this sound sensor and LED light? As I want to know about it. Could you plz make a video about it?
@BasonTech
@BasonTech 2 года назад
Hi, what do you want to achieve with the LED?
@hyperrunner4589
@hyperrunner4589 3 года назад
How to use arduino, 16bit adc and Bluetooth module to transmit digital audio to bluetooth earphone?
@BasonTech
@BasonTech 3 года назад
Sorry I have no experience with these components. Maybe you can ask on the Arduino Reddit of on the Arduino forum?
@kamrenmccullen1387
@kamrenmccullen1387 Год назад
I am having trouble trying to run two of these sensors at the same time? No matter how I try to rewrite the code enabling a second sensor the graph will only show one. Any suggestions?
@BasonTech
@BasonTech Год назад
What have you tried so far and didn't work out?
@justkez2359
@justkez2359 Год назад
How can i use the different decibel/sound values in my code
@BasonTech
@BasonTech Год назад
You can't, at least not with this sensor. It is a binary sensor which has no clue about decibel or frequencies. It just tells you if there is sound or not.
@nurulnadhirah5836
@nurulnadhirah5836 2 года назад
May I know what is the unit reading of the output in serial plotter
@BasonTech
@BasonTech 2 года назад
I've added the explanation to the website as well: arduino-tutorials.net/tutorial/drawing-sound-sensor-data-on-serial-plotter The x-axis (horizontal) is the time axis. We set SAMPLE_TIME to 10ms. This means that each horizontal point is equal to 10ms. So if we see the number 100 on the x-axis (100x 10ms), 1 second has passed. The y-axis (vertical) is the number of moments within 10ms that the Arduino sensed sound. This is related to how fast the Arduino can go through the loop(). For example, an 8Mhz Arduino will be able to do fewer measurements per second than a 16Mhz Arduino. They are therefore not exact values, but should be viewed more relative to each other.
@buddhimanchetri4049
@buddhimanchetri4049 3 года назад
Hi dear sir, can we use two sounds and then differentiate their frequencies and display?
@BasonTech
@BasonTech 3 года назад
Hi, not with this sensor. This is a binary sensor: it tells you if there is sound or not. It doesn't measure a frequency at all. In order to do so you need another sound sensor.
@buddhimanchetri4049
@buddhimanchetri4049 3 года назад
@@BasonTech sir, actually I want to make a device to measure different frequency sound waves and find individual wave like in fast forrier transform of quite nice range. If any sensor available, please reply. Thank you.
@jain28vaibhav
@jain28vaibhav Год назад
Can you please make a video for frequency vs amplitude
@panjapornsittanu9967
@panjapornsittanu9967 2 года назад
Hello, I want the relay to be on all the time when there is voice. and then turn off the relay when the voice is finished.
@BasonTech
@BasonTech 2 года назад
Then you should add some kind of "debounce" and a threshold. When there is noise the relay turns on. When there is no sound the debounce makes sure the relay doesn't immediately turn off.
@shiro_leroy
@shiro_leroy 3 года назад
Can i use audio signal with RCA cables without microphone?
@BasonTech
@BasonTech 3 года назад
No you can't. For that you need a different circuit this is just a binary sound sensor.
@jain28vaibhav
@jain28vaibhav Год назад
Can you please make a video for frequency vs amplitude
@BasonTech
@BasonTech Год назад
I'll write it down as a possible video topic, no guarantees though 😉
@jain28vaibhav
@jain28vaibhav Год назад
@@BasonTech ok, but can you please share some blog or something, because i need it by next week . It will be very helpful. We have project to get amplitude vs frequency from audio/voice
@BasonTech
@BasonTech Год назад
Then you have to search how to use a microphone on an Arduino and get the information you want from its data.
@anthonyjifkins9428
@anthonyjifkins9428 3 года назад
Whats the lowest db this sensor can detect? and what distance can it detect?
@BasonTech
@BasonTech 3 года назад
The datasheet on eva.fing.edu.uy/file.php/585/materiales/HD/CZN-15E.pdf only says: Sensitivity: -46±3dB -42±3dB -38±3dB -34±3dB (0dB=1V/pa,1KH
@sohambhattacharya5630
@sohambhattacharya5630 3 года назад
How to display these types of spectrum anysis on a P10 led module
@BasonTech
@BasonTech 3 года назад
Then you have to translate the chart values to bar lengths, and show this on the P10 module
@harynian
@harynian 2 месяца назад
Remember, this sensor cant measure noise level (dB). The amplitude on diagrams dont show noise level, it only shows how long sound sensor was triggered on. When it is quieter, the sensor does not detect the quieter sound as a lower noise level, but activates fewer times in a set period of time.
@BasonTech
@BasonTech 2 месяца назад
exactly this 😃
@belenavellana2101
@belenavellana2101 3 года назад
how far is the detection range of the sound sensor?
@BasonTech
@BasonTech 3 года назад
Copied from the datasheet at eva.fing.edu.uy/file.php/585/materiales/HD/CZN-15E.pdf Sensitivity: -46±3dB -42±3dB -38±3dB -34±3dB (0dB=1V/pa,1KHz) Impedance: Low impedance Directivity: Omnidirectional Frequency: 20-16,000Hz Voltage range: 1.5V-10V Standard operation voltage:4.5V Current consumption: Max.0.5mA Sensitivity reduction: Within -3dB at 3V S/N ratio: More than 60dB
@jam1930
@jam1930 3 года назад
Hello, I would like to ask, i have a similar sensor and tried this out but instead, I notice that the opposite happens on my plot. Like the module outputs a HIGH when there's noise and a LOW when there's none. Am I doing something wrong or?
@BasonTech
@BasonTech 3 года назад
Are you 100% sure you have the same sensor? I know there are sensors with analogue output as well 😃
@jam1930
@jam1930 3 года назад
@@BasonTech oh I was able to make it work now, tho I realized that before I have the 2nd LED turned on and that's when it outputs a HIGH when there's noise. When I turned the pot and the 2nd LED on the left was turned off, it now outputs a LOW when there's noise. They look exactly the same on first glance but maybe they were different modules after all haha
@BasonTech
@BasonTech 3 года назад
Great you solved it! 😃
@coder1448
@coder1448 Год назад
Well, if the sound is below 100, I want to do an action if(sampleBufferValue
@BasonTech
@BasonTech Год назад
This should be correct. Are you using it in the loop() function?
@surajnair2315
@surajnair2315 3 года назад
Is it possible to measure the exact decibel. Like if the intensity of sound is more than a specified limit one can get warning or something like that?
@BasonTech
@BasonTech 3 года назад
The sensor just measures if there is sound or not. So there is no measurement of the intensity, decibel, frequency or whatsoever.
@surajnair2315
@surajnair2315 3 года назад
@@BasonTech so what's the solution for this?
@BasonTech
@BasonTech 3 года назад
Probably use a "real" decibel sensor. Unfortunately I have no experience with these
@surajnair2315
@surajnair2315 3 года назад
@@BasonTech no problem.. Thanks for replying
@selmankirit6011
@selmankirit6011 Год назад
How can I reflect this kind of graph to the 5110 lcd.
@BasonTech
@BasonTech Год назад
I've never worked with the 5110. But if you manage to get te screen working you should be able to convert the chart values into lines on your screen.
@jabujavi
@jabujavi 3 года назад
I'm trying second part and only geting 0 and 1. If I put SAMPLE_TIME = 100 , I can take up to 3000. How should I tune the potentiomerter in sensor to have bigger values with SAMPLE_TIME = 10?
@BasonTech
@BasonTech 3 года назад
It is two steps: The first step is to make sure your sensor is correctly giving the 1 and 0 depending on the sound volume. This can be done with the potentiometer. The second step is to pick the correct sample time. The longer the sample time the higher the values will be.
@TuanAnhNguyen-mn6yx
@TuanAnhNguyen-mn6yx Год назад
Can this sensor detect ultrasound, teacher. Thanks in advance 😍
@BasonTech
@BasonTech Год назад
According to the datasheet the CZN-15E has a frequency range of 20-16,000Hz. Ultrasound starts at 20,000, so it can't detect this
@rohanhablani133
@rohanhablani133 2 года назад
I mimicked your code, but cannot seem to get it correct. I have a four pinned sound sensor, and for some reason, it gives me 1650 something, and then 1501, and the sensor doesn't work. Please advise
@BasonTech
@BasonTech 2 года назад
Hi Rohan, are you sure the pin layout and sensor is the same? There are other sensors which looks the same but work differently.
@Ferreira019760
@Ferreira019760 3 года назад
This has good possibilities. I will need to calculate how fast the sample rate is, if anyone could help me with that I would be grateful.
@BasonTech
@BasonTech 3 года назад
Good question! You probably can do something with the millis() function to measure elapsed time? Although this is not super accurate.
Далее
Make your own Spy Bug (Arduino Voice Recorder)
7:18
Просмотров 427 тыс.
ESP32 Audio Input Using I2S and Internal ADC
10:43
Просмотров 122 тыс.
20Hz to 20kHz (Human Audio Spectrum)
2:24
Просмотров 43 млн
Lesson 20 - Sound Sensor Module KY-038
26:46
Просмотров 126 тыс.
5 Ways to Destroy an Arduino
10:33
Просмотров 200 тыс.
What's the difference? Arduino vs Raspberry Pi
6:21
Просмотров 1,8 млн
DIY IoT Decibel Meter | Sound Level Meter
7:01
Просмотров 29 тыс.