Build6-7

pdf

School

University of Florida *

*We aren’t endorsed by this school

Course

3003

Subject

Electrical Engineering

Date

Apr 3, 2024

Type

pdf

Pages

4

Uploaded by CorporalGalaxy13875

Report
EEL 3003 Arduino Builds 6 & 7 Notes: There might be multiple parts to some questions, insert pictures as required, save as a PDF, and upload into Canvas before the due date/time! 1) The report as a PDF: File name) Your last name Your first name initial-Build #-#.PDF (example: VirguezL-Build6-7.PDF ) 2) A short video as a wmf, mp4, mov, or avi (mp4 works BEST) File name) Your last name Your first name initial-Circuit#.mp4 (example: VirguezL-Circuit6.mp4 ) Leave the question statements in your document, insert your answers/pictures, etc. after each individual question. First Name: Carolina Last Name: Horey UF-ID Number: 17990517 Read the instructions carefully. Build circuit 6 1. Read pages 70-77 in the Arduino Projects Book and watch lecture video "Arduino Build 06” in Module 6 2. (5%) A short one or two-sentence description of the build. Please be concise. The piezo buzzer and photoresistor are connected in a circuit allowing the piezo to give off different magnitudes of sound based on the amount of light the photoresistor senses. 3. (21%) Build the circuit and record a short video of your working circuit demonstrating all of its functions (include the calibration loop). No narration needed. Make sure your UF ID is in the video. *Video attached 4. Short answers a. (5%) What is the difference between tone and pulse width modulation? In pulse width modulation, the frequency is fixed; thus, the tone cannot change. With the tone function, the frequency can change along with the tone. b. (2%) What is a photoresistor? A photoresistor is a light-sensitive resistor. When the intensity of light exposed to the photoresistor increases, the resistance decreases. In the case of our piezo buzzer, more light exposed to the photoresistor will cause a high frequency of sound. c. (2%) How does piezoelectric speaker work? The piezoelectric speaker vibrates when it receives electricity; this vibration displaces air surrounding the speaker, creating sound waves and the buzzing sounds we hear. When connected to this circuit, the piezo receives different magnitudes of electricity according to the light detected by the photoresistor, which causes us to hear a normal buzzing sound or a high-pitched sound. d. Calibration loop i. (2%) What lines of code perform the calibration loop? Lines 35-45 perform the calibration loop: while ( millis () < 5000 ) { // record the maximum sensor value sensorValue = analogRead ( A0 ) ; if ( sensorValue > sensorHigh ) { sensorHigh = sensorValue; } // record the minimum sensor value if ( sensorValue < sensorLow ) { sensorLow = sensorValue;
} } ii. (2%) How long does the calibration loop last? The calibration loop lasts 5 seconds. iii. (2%) When does the calibration loop happen? The calibration loop occurs during the first 5 seconds once the code is uploaded to the circuit board. iv. (2%) What is the purpose of the ledPin? The ledPin variable is used as an indication that our sensor has finished calibrating. This light is associated with pin 13 and we can see it on our ELEGOO UNO board (to the left of 13). v. (2%) Why does this build require calibration? In order to obtain a range of frequencies from the piezo, a calibration is used to establish and minimum and maximum value. These values correlate to the amount of light that is around the photoresistor. 5. (5%) Describe your observations (challenges, thought process, anything interesting that occurred, etc.) during your building and testing of Circuit 6. One thing I thought was interesting is that the piezo piece can be placed on the breadboard in whatever direction disregarding the positive and negative charges on it. Build circuit 7 (pages 78-85 in your Arduino Book): 1. Read pages 78-85 in your Arduino Projects Book and build the circuit. 2. (20%) Record a video of the working circuit that demonstrates of all of its functions. As you demonstrate the circuit, refer to the flowchart that you create in part 3. If there is no narration, 10 points will be deducted. As you demonstrate each function, show the part of the flowchart that code is currently executing. Make sure your UF ID is in the video. *Video attached 3. (10%) Create a flowchart of the code using a software platform. See the document Flowchart Quick Reference.
4. (5%) A short one or two sentence description of the build. Please be concise. The code associated with this circuit initializes different frequencies for the piezo buzzer to emit when one of the switches is pressed. 5. This build introduced the resistor ladder. a. (1%) What is the advantage of using a resistor ladder over connecting each pushbutton to its own pin? The main advantage of using a resistor ladder is that it requires fewer pins to connect each pushbutton to the ELEGOO board. This method gives us a clean breadboard with minimal pins connecting elements together. b. Complete the following table. You need to calculate V AO and keyVal, not read off the serial monitor. Each value has only one value, no range. (1% each) Push Button Resistor (Ohms) V A0 (Volts) keyVal* Freq (Hz) 1 0 5 1023 262 2 220 4.9 1001 294 3 10k 2.5 512 330 4 1M 0.05 10 349 *keyVal is the variable in the code which stores the output of the ADC. MATH: 5 x 10k/(.220k + 10k) = 4.9 4.9/5 x 1023 = 1001 5 x 10k/(10k + 10k) = 2.5 2.5/5 x 1023 = 512 5 x 10k/(1000k + 10k) = 0.05 0.05/5 x 1023 = 10
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
6. (5%) Describe your observations (challenges, thought process, anything interesting that occurred, etc.) during your building and testing of Circuit 7. While I was moving around some pins I noticed that a sound would play when I touched the 10 kiloohm resistor connected to the first pushbutton. I found this interesting because no switch was turn on or off; however, this resistor connects the resistor ladder to the ground so the sound must be from some static on my hands sending a small voltage to the sensor.