Presentation is loading. Please wait.

Presentation is loading. Please wait.

The George Washington University Electrical & Computer Engineering Department ECE 1020 Dr. S. Ahmadi Lab 1.

Similar presentations


Presentation on theme: "The George Washington University Electrical & Computer Engineering Department ECE 1020 Dr. S. Ahmadi Lab 1."— Presentation transcript:

1 The George Washington University Electrical & Computer Engineering Department ECE 1020
Dr. S. Ahmadi Lab 1

2 Class Agenda Digital Sensors Analog Sensors
Light Sensors. Optical Rangefinder Sensors. Ultrasonic Sensors (Sonar). Analog Sensor Characterization

3 Arduino !

4 Two Distinct Categories of Sensors
Digital and Analog Digital sensors have two states: 0 or 1 Analog sensors have a range of states depending on their input Example: A door can be open or closed What type of representation of the condition of the door is this? How far the door is open (0 to 180 degrees!)

5 Digital Sensors A digital sensor is an electronic or electrochemical sensor, where data conversion and data transmission are done digitally. Sensors are often used for analytical measurements, i.e. the measurement of chemical and physical properties of liquids. Typical measured parameters are pH value, conductivity, oxygen, redox potentials and others. Such measurements are used in the industrial world and give vital input for process control.

6 Analog Sensors Output a range of values, depending on the input read.
The main analog ports are A0….7 Ports to be used can be programmed by the user. The three main analog sensors that we will be using are the Light Sensor, the Optical Rangefinder Sensor and the Ultrasonic Sensor, also known as the Sonar.

7 Light Sensors The sensor : qrd1114

8 Optical Rangefinder Sensors (Proximity Sensor)
The Sensor : sharp 2y0a21

9 Ultrasonic Sensors (Sonar)
The sensor: sfr04

10 Sonar Sample Code int triggerPin = 8; //to send a trigger pulse to sonar sensor int dataReadPin = 11; //read the length of echo(PWM) void setup() { Serial.begin(9600); pinMode(triggerPin, OUTPUT); pinMode(dataReadPin, INPUT); } void loop() { digitalWrite(triggerPin, HIGH); delayMicroseconds(20); //send a high pulse for 20 us digitalWrite(triggerPin, LOW); Serial.println(pulseIn(dataReadPin, HIGH)); //read the duty cycle of high pulse delay(50); //repeat after 50ms

11 Analog Sensor Characterization
The purpose of this exercise is to tabulate the readings from the three different analog sensors mentioned, when different inputs are sensed: Light Sensor: Using the attached color scale, move the light sensor along the sheet, and record the values read at different intervals. Optical Rangefinder: Using the provided boards, at different distances record the outputs read from the sensor. Ultrasonic Sensor: Similar to the Optical Rangefinder, record the output from the sensor at different input distances.

12 Light Sample Code int readPin = 0; //analog read pin void setup() {
Serial.begin(9600); pinMode(readPin, INPUT); } void loop() { Serial.println(analogRead(readPin)); delay(50);

13 Light Sensor Color Scale
½” 100% 0% 50%

14 ½” ½” ½” ½”

15 Lab Requirements Collect Data for at least one sensor. (Data to be handed in at end of lab, and you’ll need it for your HW.) FOR LIGHT SENSOR: Take 10 equally spaced readings. FOR SONAR SENSOR: Take enough readings to characterize sensor (more when measurements are non-linear, less when data is predictable) Insert the data into an Excel spreadsheet Plot the data (X-axis for distance, Y-axis for sensor readings). the spreadsheet to all group members to complete HW

16 Sensor Range Sensors have an established operating range. Determine what this is for your sensor. Choose your ten points so that they span the complete operating range of the sensor.

17 Example Plot of Sensor Characterization – RANGE FINDER SENSOR

18 Due in Lab Today After tabulating the results, plot the graph for each sensor type, to see if the relationship turns out linear or not. Draw the curve to fit the graph. Note: To simplify your work, write a short program that can continually print out the reading of the sensor on the Handyboards display. Take a look at HW#1(Comprehensive Report on the Characterization of Robot’s Sensors), save your data/graphs for HW#1.


Download ppt "The George Washington University Electrical & Computer Engineering Department ECE 1020 Dr. S. Ahmadi Lab 1."

Similar presentations


Ads by Google