Arduino has 10-bit ADC and 8-bit DAC so this is a very low resolution for making a voice command, even the Processor RAM and ROM are also very low, so one thing is clear, this configuration does not allow me to do sufficiently. Even in this topic, didn't find any suitable library for this purpose,
but I don't lose Hope.....
For this project, you need
Microphone
How it works?
The first thing is what is going on in my mind? And how do I do it? To know that I must understand a condenser microphone.
If I give a 5-volt logic supply to a condenser microphone, if I want to see the value of the microphone then I have to connect it with a voltage divider and see the zero one binary value showing the graph on my oscilloscope,
we will see the signal is a tiger on 0.5 microseconds.
Now if I tap the microphone then you will see a very small 0.1 binary value. That is my mic-taping graph.
This voltage is very low, which Arduino's ten-bit ADC cannot analyze properly. because Arduino doesn't like below 5-volt, For that, I need to use a sound sensor module so that the correct value can be measured by the Arduino.
Actually, I mean the five-volt value here is 1024 to the Arduino, if it's 2.5 volts, that means 512, then my resolution is halved here. So it is wise to keep the voltage as high as possible.
I hope now you understand everything pretty well, How important it is!!
Step 1
Mic setup
now at first, I connected the microphone with Analog pin A0, next should had to connect logic 5 volts to run the mic Module.
Now I want to analyze the microphone captures sound so that is why I will connect my USB cable to this Arduino and another to my PC,
next, I write an Analog read code and the value will be printed on a Serial monitor,
If you look carefully, you will see that I have given a delay of 50 milliseconds here (delay(50);
which is the timeline, which means that the amount of information value of my voice will be collected and how much less will be collected, depends on this delay.
Since the Arduino can't do a lot of numbers, I use a proper delay here to get the correct information from my voice.
743
724
746
721
761
718
758
746
742
Arduino analyzed the voice ("Arduino light on")
721
761
718
751
740
749
here you can see the "Arduino light off" command value.
Arduino analyzed the voice ("light off")
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUmeP59Uf4vMJe7qMGtdMdeea1N9BhdGJfms6KfFZSeTLr0CZCvg0w41iLBqgr48xDE3e1cJ9mg1oLGeWPJQbqjlrl2v7VgEXlRViuaDSQWUZJhrKiVP_JWuL8swAz-MyaW4MAArr_7nYA0bZTjplB7fl9Wgyvi6ZHv5OjSSDgwZvrIlo_tk2G6sYIAGSi/w125-h40-rw/link%20downloder.png)
you can watch this video on my YouTube channel
please do not enter any spam link in comment box