1 / 8

ESC100 Design Studio

ESC100 Design Studio. Session 2: Arduino & Distance Sensing Prof Anderson, Section 2. PreLab Check . End. You have 5 minutes to get your circuit running. Have the LCD display your First and Last Name. Go…. Today’s Exercise. theawesomeboston.com. Use a distance Sensor…Why?

lucine
Download Presentation

ESC100 Design Studio

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ESC100 Design Studio Session 2: Arduino & Distance Sensing Prof Anderson, Section 2

  2. PreLab Check End www.A6training.co.uk You have 5 minutes to get your circuit running. Have the LCD display your First and Last Name. Go….

  3. Today’s Exercise theawesomeboston.com • Use a distance Sensor…Why? • http://www.youtube.com/watch?v=bp9KBrH8H04 • More info: • IEEE.org: How Google's Self-Driving Car Works • NY Times: How an autonomous car gets around

  4. The Distance Sensor Light Emitter Light Detector https://www.sparkfun.com/products/8959

  5. Download the Code (and study it!) #include <LiquidCrystal.h> const char buttonPin=7; //The pushbutton is connected to pin 7. This line creates an 8-bit number that can't be changed and stores "7" in it. const char sensorPin=A0; //The sensor is connects to pin A0. This line creates an 8-bit number that can't be changed and stores "?" in it. intsensorVal=0; //Value read by analog input...will be from 0 to 1023. float sensorVoltage=0.0; //Voltage corresponding to sensorVal booleanbuttonVal; //Boolean variable to record if button has been pushed. LiquidCrystallcd(12,11,5,4,3,2); //creating a LiquidCrystal variable (object) named lcd. void setup() { pinMode(buttonPin,INPUT_PULLUP); //Button Pin is an input and we want it connected to a pull-up resistor. lcd.begin(16,2); //Get RedBoard ready to talk to the lcd (this is an lcd with 16 cols and 2 rows) lcd.clear(); //Clear the lcd screen; Serial.begin(9600); //Get Redboard ready to talk to your computer over the usb cable }

  6. Build the Circuit & Make Measurements

  7. Analysis and Discussion • Using Excel, make a plot of your average sensor output (x-axis) versus distance measured (y-axis). Be sure to carefully label axes. You might want to refer to the LabWrite website resource on making graphs: http://labwrite.ncsu.edu/res/res-homepage.htm. • Develop a calibration curve for your sensor using the Excel trendline function. This should yield an equation for the distance as a function of the sensor output. • Use your equation to estimate the size of objects A, B and C. Report the values with an estimate of each measurements variability (i.e. the size of A was found to be 10 ± 1 m).

  8. Reporting Style Individual Memo Lab Report – Due at start of lab next week. Review guidelines, see me to discuss

More Related