Distance Sensor & Sound Sensitive Sensor
by JonathanYeong in Circuits > Sensors
1198 Views, 4 Favorites, 0 Comments
Distance Sensor & Sound Sensitive Sensor
If you ever need it
Gather the Required Components
- Sharp 2YOA21
- I2C(Raspberry Pi 3 & Arduino Uno)
- 7" Raspberry Pi Touch Screen
- RGB LED
- Sound sensitive Sensor
- 1 LED Light
- Resistor (10K)
- +- 25 cables
- 2 Ethernet cables
- 1 Router
Software: required,
Arduino IDE
Windows 10
Visual Studio Community 2015 update 3
Universal Windows Platform installed (option comes together with the Visual Studio installer)
Windows 10 IoT Core Dashboard
For information on how to set up your Pi to be ready visit
Connecting the Raspberry Pi to the 7" Touch Screen
Watch the video for the steps to connect your Raspberry Pi to your display
Fritzing Diagram
Connect your circuit in the following order
Arduino Uno to Sharp 2YOA21 Sensor
Analog Pin 0 -> Vout
5 -> VCC
Ground -> GND
Arduino Uno to RGB LED
Digital Pin 12 -> G(Green)
Digital Pin 13 -> R(Red)
Ground -> GROUND
Arduino Uno to Sound Sensitivity Sensor
Analog Pin 3 -> AO
GND -> GND
5V -> VCC
Digital Pin 2 -> DO
Arduino Uno to Red LED
Digital Pin 7 -> (-) Cathode
5V -> 10K Resistor -> (+)Anode
Programming the Arduino
Attached along is the Arduino code that I have done up,
Within it includes the code for the distance sensor, the sound sensitive sensor and the how to send the data to Pi
Downloads
Programming the Pi to Receive the Data From the Arduino & Display
Attached along are codes that allows you to receive data from the Arduino and display on the 7" touch screen
Do remember to install the reference WinRtXamlToolKit.Controls.Gauge.UWP from nuget otherwise your code wouldn't work!
Finish!
Plug the cables in the correct places, do the code accordingly, and the device should perform exactly how you want it to!