Lab 5: Circuit Prototyping, Sensors, and the Arduino Introduction . In this lab you will create a prototype of an electronic speed sensor that you will use to measure the speed of the roller coaster ball on your roller coaster. The lab has the following objectives: ● Understand the workings of a speed sensor using an LED (Light Emitting Diode) and a phototransistor ● Illustrate how engineers build prototype electronic circuits ● Review some basic concepts about electronic circuitry Part 1: Review of Kirchhoff’s Voltage Law . In this task, your team will quickly review Kirchhoff’s voltage law prior to it’s application later in the lab. Task 1: Construct Circuit Begin by constructing the circuit to the right. Once completed, have the instructor or lab monitor check the circuit prior to applying power. Task 2: Calculate Theoretical Voltages Use your knowledge of Ohms law and Kirchhoffs laws to calculate expected values for both voltages indicated. Task 3: Measure Using the DMM, measure the power supply voltage, the other voltages listed, and the resistance values of the two resistors. Be sure to power off the circuit before measuring resistances. Task 4: Verify Verify that theory matches reality with regard to voltages. Specifically, does the supply voltage match the sum of other voltages? Part B: Construction of LED Circuit . In this task, your team will construct a circuit with a switch and LED. The circuit is assembled such that when the switch is pressed, the LED will light. Task 1: Construct Circuit Construct the circuit seen at the top of the next page. Once constructed, have the instructor of lab monitor check the circuit prior to applying power. Task 2: Measure Voltages Once constructed and powered, measure the voltage across the switch and the resistor and record the values both when the switch is pressed and released. Additionally, record the state of the LED for both. Task 3: Calculations Calculate the voltage across the LED for both states of the circuits. Additionally, calculate the currents through all three branches of the circuit and record those values. Part C: Construction of Speed Sensor . Next your team will construct a prototype of the speed sensors used on the coaster. Task 1: Construct Circuit Create the circuit seen below and on the next page. Be sure to look at both the schematic and image of the completed circuit. Keep in mind that in the following task you will need to fit the ball as well as track between the LED and phototransistor. The phototransistor and LED are labeled on the front of the boards. Task 2: Calibrate Use a white scrap of paper to align the LED with the phototransistor. Calibrate the sensor by placing the paper directly in front of the phototransistor lens. Verify that the Red LED beam points directly at the phototransistor. Verify that the phototransistor circuit works by placing an opaque object (finger, Buck ID card, etc.) between the Red LED and the phototransistor. The circuit works properly if the green LED turns “ON” when the light beam is interrupted. If the Red LED beam is not centered on the phototransistor lens, gently adjust the angle of the Red LED to center the beam. Task 3: Measure Measure and record the voltage across the phototransistor both when the beam is “on” and when it is “off” (obstructed), as well as the voltage across the resistor. Part D: Take Measurements Using Prototype . Task 1: Retrieve Equipment Request a signal probe from the instructor or lab monitor. Task 2: Connect Probe Connect the probe to the circuit as shown in the picture below. The other end of the probe should be attached to the speed sensor reader BnC connector. This connection is made by pressing the two ends together and twisting. Task 3: Measure Speed Using your coaster kit, make a small hill and a section of track, and lay it between the LED and sensor. Pick a starting point, and roll the ball through the sensor. Use the speed sensor reader to ensure alignment and test function. Finally, use it to gather time deltas (one of the display options under the ‘Get Velocities’ option. Part E: Connect to the Arduino Directly . In this final task, you will connect the sensor you have built to one of the Arduino’s analog ports, and write a small code segment to read the sensor. Task 1: Connecting to the Arduino Disconnect the sensor from the power supply you were using, and instead replace it with the 5V and GND ports of the Arduino. Then, run the output line (the line the probe hook was attached to) to one of the analog ports on the arduino board. Have your work inspected by the lab monitor or instructor before powering anything on again. Task 2: Write Polling Code Write a small snippet of code that will read the analog port you chose and display the result to the serial monitor. Discussion Questions 1. Why do we need the resistors in the above circuit? 2. What other devices will work in a similar format? 3. What concerns, if any, are there in this type of monitoring? Report: Lab Memo Format