Introduction to Project:
In this Project we are going to interface sound sensor to Arduino. and then we are going to plot the graph of those analog values using python. For that purpose we have connected our Arduino to Raspberry pi. So here Arduino is throwing data to raspberry pi through it's serial port and we are using one python script in raspberry pi to plot the graph of those analog values.
Step 1: Installation of All Software
1) Raspbian OS:
This is the recommended os for raspberry pi. You can also installed other OS from third party. Raspbian OS is debian based OS. We can install it from noobs installer. you can Download here
2) Python idle:
This is the software we get in raspbian os. For this project we have used python script.
3) Arduino IDE:
You can download the latest Arduino IDE from this link: https://www.arduino.cc/en/Main/Software
Step 2: Component Used
1) Raspberry pi 3
2) Arduino UNO
3) Sound Sensor
4) Jumper Wire
1) Raspberry pi 3:
This is the latest version of raspberry pi. In this we have inbuilt Bluetooth and wi-fi, unlike previously we have to use Wi-Fi dongle in one of its usb port. There are total 40 pins in RPI3. Of the 40 pins, 26 are GPIO pins and the others are power or ground pins (plus two ID EEPROM pins.)There are 4 USB Port and 1 Ethernet slot, one HDMI port, 1 audio output port and 1 micro usb port and also many other things you can see the diagram on right side. And also we have one micro sd card slot wherein we have to installed the recommended Operating system on micro sd card. There are two ways to interact with your raspberry pi. Either you can interact directly through HDMI port by connecting HDMI to VGA cable, and keyboard and mouse or else you can interact from any system through SSH(Secure Shell). (For example in windows you can interact from putty ssh.) Figure is given above.
2) Arduino UNO:
Arduino/Genuino Uno is a microcontroller board based on the ATmega328P (datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and a reset button.
3) Sound Sensor:
Sound Sensor can detect the sound intensity of the environment. The main component of the module is a simple microphone, which is based on electret microphone. This module’s output is analog and can be easily sampled and tested.
Step 3: Circuit Diagram
Circuit Diagram of this project is given above.
Here are the connections of our First figure
Arduino Sound Sensor
In second figure Arduino directly connected with Raspberry Pi
Step 4: Working of Plot
Here are the command to install graph plot on raspberry pi:
sudo apt-get install python-matplotlib
sudo apt-get install python-pip
sudo pip install drawnow
sudo pip install pyserial
After installation you can run python script i.e plotArduino.py
you run that file and get the output like above figure
Step 5: Code for Project
We already posted our source code of this project in github
we've given our level of best to make you understand this project. Still if you have any doubt feel free comment us below
So finally if all things will go well. Definitely you will enjoy this project.you also mail us on email@example.com.
Thanks & Regards,
We have a be nice policy.
Please be positive and constructive.