Presentation is loading. Please wait.

Presentation is loading. Please wait.

CTY SAR FCPS Alexander Velikanov

Similar presentations


Presentation on theme: "CTY SAR FCPS Alexander Velikanov"— Presentation transcript:

1 CTY SAR FCPS Alexander Velikanov
Arduino Proximity Lab CTY SAR FCPS Alexander Velikanov

2 What are we working with?

3 How to detect distance? A proximity sensor is a device which is able to measure a physical distance. The proximity sensor is able to measure distance by pulsing out infrared light and seeing how long it takes the light to return to the sensor It then sends a voltage back that represents the distance according to the graph on the left A more detailed explanation can be found here

4 Arduino Proximity Schematic

5 Goal The system will show the distance
The distance will be show on the serial monitor

6 Programming Distance

7 Distance: Part 1 Initializing global variables Setup()
The proximity sensor is connected to analog pin 0 (A0) A constant to store the conversion value between the reading and volts A variable to store the sensor reading A variable to store the reading in volts A variable to store the reading in CM A variable to store the reading in Inches Setup() Serial.begin(9600) starts using the Serial Port

8 Distance : Part 2 Loop() Read the sensor using analogRead()
Convert the sensor reading to volts using the defined constant and store that in the variable Volts Convert volts to Inches then store that in variable Inches Convert volts to CM then store that in variable cm If the value is too low set to -1 Send the value through the serial port Add in a delay to avoid overloading the serial port buffer

9 CODE

10 Building the Distance circuit

11 Supplies 1 Arduino Leonardo board 1 Analog Proximity Sensor

12 Diagram of distance Circuit

13 Questions?


Download ppt "CTY SAR FCPS Alexander Velikanov"

Similar presentations


Ads by Google