Lab 12 - FL23 WL Microcontroller
pdf
keyboard_arrow_up
School
Purdue University *
*We aren’t endorsed by this school
Course
177
Subject
Mechanical Engineering
Date
Dec 6, 2023
Type
Pages
7
Uploaded by DeaconTurtle993
Print name (first last):
______________________
Lab partner (first last):
______________________
Course:
ECET 17700
Lab date (mm/dd/yy):
______________________
Instructor:
______________________
Lab 12 Microcontroller
Performance Checks
1. Check off 1 (IDE Configuration)
2.
Check off 2 (Modified Blinker and
ADC)
3. Check off 3 (Table 1,2)
4. Check off 4 (Table 3,4)
0. Prelab
For the prelab, read the Arduino tutorial attached in Brightspace and then answer the questions in the
Quiz.
The quiz must be completed before your lab session to receive full prelab score.
1. Objectives
The objective of this lab is to setup, configure and program using the Arduino 2560, identify and use
digital IO ports and utilize the Arduino shield to perform experiments.
2. Approach and Results
1.
IDE Configuration and the 'blinker' sketch
In this procedure you will setup the Arduino platform. The platform consists of software known as
Integrated Development Environment (IDE), hardware containing a microcontroller and supporting
circuitry (Arduino Mega 2560 development board). The IDE communicates with the development
board through a USB cable. The Arduino is programmed using programs known as 'sketches'.
a.
Start the Arduino IDE from the computer's start menu (Arduino 1.8.x). The screen shown in
Figure 1 should appear.
ECET 17700
- 2 -
Lab 12 Microcontroller
Figure 1: Arduino IDE
b.
Connect your Arduino development board using USB communication to the PC. using your USB
cable provided with the parts kit.
c.
Set the Arduino board type, Tools → Board → Arduino/Genuino Mega or Mega 2560, as
illustrated in Figure 2.
ECET 17700
- 3 -
Lab 12 Microcontroller
Figure 2: Arduino IDE: Board Type Selection
d.
Using the same menu, set the proper COM port, Tools → Port → COM X (arduino/Genuino Mega or Mega
2560), as illustrated in Figure 3. Select the port with the Arduino Mega listed beside the COM port number.
DO NOT USE COM 1!
Figure 3: Arduino IDE: Port Selection
e.
Download "Onboard LED" sketch by clicking the download link below. Note: Chrome and Firefox
browsers work best. Select 'Save as' and save the file to the location of your choice, I suggest your create a
directy on you career account for this purpose.
f.
Open the downloaded sketch using the Arduino IDE, File → Open Browse to locate the downloaded sketch
using the Open Diaglog Box.
The file is located in Brightspace
Labs
Lab 12 Microcontroller
OnboardLED.ino
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
ECET 17700
- 4 -
Lab 12 Microcontroller
g.
Compile and upload the sketch to the Arduino. This is accomplished using the highlighted right arrow
shown in Figure 4. This button will both compile and upload the sketch to your development board. As
soon as the upload is complete the sketch will begin execution. Observe the behavior of the small onboard
LED next to pin 13 on the development board.
Figure 4: Compiling and uploading an Arduino sketch
Check off 1: Demonstrate the proper operation of the ‘blinker’ sketch to the lab instructor
2.
Modification of the 'blinker' sketch
a.
Modify the sketch to "blink" the LED as follows:
The LED is turned on for 1.5 seconds.
Then turned off for 0.5 seconds
b.
Compile the sketch, upload it to the Arduino and run the program.
Observe the behavior of the small
onboard LED near pin 13
Check off 2: Demonstrate the proper operation of the modified ‘blinker’ sketch to the lab instructor.
3.
Analog to Digital Converter and PWM
a.
In this procedure you will use one of the Analog input ports of the Arduino to read an incoming
analog voltage and display its digital representation in the Arduino
b.
Place the provided potentiometer from your parts kit on the breadboard. Attach the wiper of the
potentiometer to Pin A0 of the Arduino. Attach one of the remai
ning potentiometer pins to GND
and the other to 5V as indicated by the schematic in Figure 1. Look at your lecture notes to
determine the pinout of the potentiometer.
IMPORTANT: The +5 V and GND connections are made from the Arduino to the breadboard,
NOT TO THE DC POWER SUPPLY!! Make sure to use the wires from your 140 piece wire kit,
not the header jumper wires!
Figure 5: Potentiometer Wiring
c.
Download and save the AnalogIN sketch by clicking on the link, compile and upload it your Arduino.
d.
Complete the following table by adjusting the potentiometer to the indicated voltage, using the DMM to
measure the voltage from pin A0 to GND. At each position you will need to record the incoming digital
ECET 17700
- 5 -
Lab 12 Microcontroller
value (integer from 0 to 1023) and the mapped value (integer from 0 to 255) which is displayed on the
serial monitor window of the IDE. The Serial Monitor is located in the top right corner of the Arduino
IDE, it looks like an magnifying glass. The mapped values has converted the 10-bit value to an 8-bit value.
Record your values in the following table.
Table 1: Arduino Analog Input Measurements using Potentiometer
Analog In (Vdc)
Incoming Digital
Value (0-1023)
Mapped Digital
Value (0-255)
0
1.25
2.50
3.75
5.00
4.
Digital Output Measurements with the DMM
a.
In this procedure you will use the digital I/O pins of the Arduino to send outgoing digital data to
each of the pins 0 – 13
b.
Download, and Save the "DigitalOUT" sketch by clicking the download link below. Then Open,
Compile and Upload it to your Arduino, in the same manner as you did with the sketch in Part 1.
c.
Note: Each of the 14 pins can be configured as an input or output. All of the pins are configured
as outputs for this example.
d.
You will need two of the male-to-male computer jumper wires to perform the measurement.
Using these wires connected to the DMM leads (Red lead to the digital pin, and the Black lead
connect to GND on the Arduino) make your voltage measurement. Then record if that voltage
measurement is a HIGH or LOW
.
e.
The COM connection of t
he DMM should be connected to the GND pin (through the stacking
header) of the Arduino for all measurements.
Table 2: Arduino Output Logic Measurements
Digital Pin Number
10
11
12
13
V
DC
Logic Value (High / Low)
Check off 3:
Complete Table 1, Table 2
Demonstrate the proper operation of the sketch to the lab instructor.
ECET 17700
- 6 -
Lab 12 Microcontroller
5.
Digital Output Measurement with the Shield
a.
Remove the potentiometer connection from Arduino before proceeding to the next step
b.
Connect your "shield" to your Arduino microcontroller, as shown in Figure 5, being careful not to
bend any pins. Note: You DO NOT need to push the pins down into the Arduino 100%, however
you do need to establish a good connection.
c.
Download and Save the "DigitalIO" sketch in Brightspace
Figure 6: Shield Attached to Arduino
d.
Open the sketch and complete the setup() function by inserting three lines of code.
a.
1 line to declare the LEDs as outputs through Port A
b.
2 other lines declare switches 1 and 2 (pins 2 and 3, respectively) as inputs.
c.
Look into Arduino tutorial for this information. When completed compile and upload the sketch,
then determine the function of the sketch by applying the toggle switch inputs 1 and 2 shown in
Table 2 (pin 2 and pin 3) and determine what output is displayed on the LED's on PORTA. Record
your observations in Table 2. DO NOT alter the code in the loop() function
Table 3: Arduino Output Logic Observations
Switch 1 (Pin2)
Switch 2 (pin 3)
LED Response
High
High
High
Low
Low
High
Low
Low
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
ECET 17700
- 7 -
Lab 12 Microcontroller
e.
Use the same downloaded code from previous step on AnalogIN sketch, use the slide
potentiometers adjust the voltage using the DMM.
After adjusting the voltages record the digital
values, from the serial monitor, in the following table.
Table 4: Arduino Analog Input Measurements using Arduino Shield
Analog In (Vdc)
Incoming Digital
Value (0-1023)
Mapped Digital
Value (0-255)
0
1.25
2.50
3.75
5.00
f.
Download and Save the "IOCount" full sketch in Brightspace.
g.
This sketch is to perform the following function:
d.
Use pushbuttons 50 and 51 to write even integers to the serial monitor in a vertical
fashion to count up and down, beginning with 50. The Serial Monitor is located in the top
right corner of the Arduino IDE, it looks like an magnifying
glass. The count up/
down
direction is determined by the state of the pushbuttons 50 and 51 connected to pins 50
and 51, respectively.
e.
When pushbutton 50 is pressed and held (pin is LOW) then count up and turn on the
yellow LEDs only. When pushbutton 51 is pressed and held (pin is LOW) count down
and turn on the red LEDs only. There should be a 1 second delay between counts. Control
the LEDs as a full port (PORTA), not as individual LEDs.
f.
In the VOID LOOP and VOID SETUP, change # to the correct pin number for
digitalRead and pi
nMode. In the VOID LOOP Change "LOW/HIGH" in the "if pbstatus"
statement for the pushbutton status normally open.
Check off 4:
Complete Table 3, Table 4
Demonstrate the proper operation of the modified ‘IOCount’ sketch to the lab instructor.
3.Analysis and Conclusions
1.
What is the ideal digital pin output voltage?
2.
The following statement generates a delay of
X
seconds
.
X = ?
a.
Delay(4000);
3.
In the Arduino IDE, under which menu is the port selected?
Related Documents
Related Questions
Mech. Engg. Dept.
4th year 2022-2023
Solar Energy
Spring course MEC364
Dr. Mahmoud U. Jasim
Review/Recap Sheet
Q1- Answer with true or false and rewrite the false statements completely in
correct form, otherwise no mark will be put on the false statements.
1
2
To represent a location on earth surface you need to define its altitude and longitude
angles.
3
Solar zenith and solar incidence angles have the same value for horizontal surface.
At sunset time the value of solar altitude angle is maximum.
4
The angle which represents the inclination of a given surface is the zenith angle
5
6
7
8
When the absolute value of sun-wall azimuth angle exceeds 90' this means that the sun
rays are reaching the receiving plane.
The solar irradiance and the solar irradiation have the same physical meaning.
In the case of clear sky weather, the beam solar irradiation on a horizontal surface is less
than the diffused irradiation.
The total solar radiation received by a tilted surface is the same as that…
arrow_forward
operations research - pert cpm
arrow_forward
University Of Babylon
College Of Engineering -Al-Musayyab
Automobile Production
Semi-First Semester 2023-2024
3rd Stage
A) To convert rotary motion to reciprocating motion
B) To control oil flow
C) To support the piston
D) To convert reciprocating motion to rotary motion
16. What is the function of the turbine in a turbocharger?
A) To guide the exhaust gases into the compressor
BTo convert exhaust gases' kinetic energy into mechanical
energy
C) To compress air for the engine
D) To draw high-velocity air into the engine
17. What are some advantages of synthetic lubricants over
refined oils, as mentioned in the passage?
A) Shorter oil change intervals, longer engine life
B) Lower cost, increased gas mileage
CLonger oil change intervals, increased gas mileage
D) Shorter oil change intervals, shorter engine life
18.How is a turbocharger typically powered, according to
the passage?
A) Mechanically by the engine
B) By a belt connected to the crankshaft
CBy a turbine driven by exhaust gases…
arrow_forward
LESSON: AUTODESK AUTOCAD
Choose from the choices:
arrow_forward
Develop a format for technical/lab report writing?
arrow_forward
engineering economy question. the correct answer
is about $8,888
A new CNC machine is purchased for $40,000.
The salvage value of the CNC machine is
expected to be 15% of the initial cost. The CNC
machine qualifies for 3-year GDS MACRS
depreciation. What is the book value of the CNC
machine after two years of depreciation?
arrow_forward
This question belongs to the course machine design elements in mechanical engineering major. i couldn't find an appropriate solution for it because many people confuse it with something else so this time I am attaching a picture of a slide of this topic so you can get a better understanding of what it's all about. hope this time I find a correct solution for this. Please try to help me ASAP as I have an exam in 8 hours and I am stuck on this question.
arrow_forward
University of Babylon
College Of Engineering -Al-Musayyab
Automobile Production
Semi-First Semester 2023-2024
3rd Stage
Name:
1.In automobile classification, which factor is commonly
used to categorize vehicles?
Ay Fuel Efficiency
B) Engine Size
Drive Type
D) Passenger Capacity
2. What industrial surface modification process is
described, which aims to enhance the wear, corrosion, and
fatigue resistance of steel components such as crankshafts?
A) Hardening
BNitriding
Annealing
D) Galvanizing
3.What is the purpose of the cylinder honing method
described in the passage?
A) To increase imperfections in the bore
By To remove glaze and minor imperfections
C) To rotate the spindle for reboring
D) To mount graded grinding stones
8.What are some functions of the chassis frame mentioned
in the passage?
A) To operate the brakes and acceleration
B) To carry passengers or goods, support body and engine
Toad
C) To withstand road conditions and cornering forces
D) To house the gearbox and engine…
arrow_forward
how to do dissertation timeline gantt chart
arrow_forward
Case Study: Paula’s Pain
Paula has worked for Brindle Corporation for 3 years. During this time, she has worked as a machine operator/cell leader in various work cells. Recently, the plant went to mandatory 12-hour shifts and plans to remain on this schedule for several months.
Paula’s present work cell is manufacturing 3-inch diameter exhaust tubes that are made from stainless steel. These tubes get a hole punched in them, a flange welded on, and burrs ground off. The pipe then gets placed into a gage to check that it was made correctly. (The tubes weigh about six pounds.)
Paula has been performing the welding operation. She leans into the machine and loads the part into a fixture then positions the flange. Both pieces are clamped (using hand clamps) into position and the machine is cycled by depressing two palm buttons.
The gaging operation requires placing the finished part into the gage and clamping it (using hand clamps) into place. A pin is depressed to verify the position…
arrow_forward
Share the knowledge necessary to become a Certified Quality Engineer (CQE).
Note:
(Basically, I am studying industrial engineering)
arrow_forward
What's the answer to this question?
arrow_forward
I Review
Learning Goal:
To be able to find the center of gravity, the center of
mass, and the centroid of a composite body.
Part A
A centroid is an object's geometric center. For an object
of uniform composition, its centroid is also its center of
mass. Often the centroid of a complex composite body is
found by, first, cutting the bodyng the weighted average
Find the area of the body. (Figure 1)
Express your answer numerically in feet squared to three significant figures.
into regular shaped
segments, and then by calculating i
of the segments' centroids.An object is made from a
uniform piece of sheet metal. The object has dimensions
of a = 1.55 ft , where a is the diameter of the semi-
circle,b = 3.74 ft, and c = 2.35 ft . A hole with diameter
d = 0.750 ft is centered at (1.26, 0.775).
> View Available Hint(s)
Vol AEO It vec
?
A =
ft?
Submit
Part B
Find a, the a-coordinate of the body's centroid. (Figure 1)
Express your answer numerically in feet to three significant figures.
> View…
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you

Precision Machining Technology (MindTap Course Li...
Mechanical Engineering
ISBN:9781285444543
Author:Peter J. Hoffman, Eric S. Hopewell, Brian Janes
Publisher:Cengage Learning

Welding: Principles and Applications (MindTap Cou...
Mechanical Engineering
ISBN:9781305494695
Author:Larry Jeffus
Publisher:Cengage Learning
Related Questions
- Mech. Engg. Dept. 4th year 2022-2023 Solar Energy Spring course MEC364 Dr. Mahmoud U. Jasim Review/Recap Sheet Q1- Answer with true or false and rewrite the false statements completely in correct form, otherwise no mark will be put on the false statements. 1 2 To represent a location on earth surface you need to define its altitude and longitude angles. 3 Solar zenith and solar incidence angles have the same value for horizontal surface. At sunset time the value of solar altitude angle is maximum. 4 The angle which represents the inclination of a given surface is the zenith angle 5 6 7 8 When the absolute value of sun-wall azimuth angle exceeds 90' this means that the sun rays are reaching the receiving plane. The solar irradiance and the solar irradiation have the same physical meaning. In the case of clear sky weather, the beam solar irradiation on a horizontal surface is less than the diffused irradiation. The total solar radiation received by a tilted surface is the same as that…arrow_forwardoperations research - pert cpmarrow_forwardUniversity Of Babylon College Of Engineering -Al-Musayyab Automobile Production Semi-First Semester 2023-2024 3rd Stage A) To convert rotary motion to reciprocating motion B) To control oil flow C) To support the piston D) To convert reciprocating motion to rotary motion 16. What is the function of the turbine in a turbocharger? A) To guide the exhaust gases into the compressor BTo convert exhaust gases' kinetic energy into mechanical energy C) To compress air for the engine D) To draw high-velocity air into the engine 17. What are some advantages of synthetic lubricants over refined oils, as mentioned in the passage? A) Shorter oil change intervals, longer engine life B) Lower cost, increased gas mileage CLonger oil change intervals, increased gas mileage D) Shorter oil change intervals, shorter engine life 18.How is a turbocharger typically powered, according to the passage? A) Mechanically by the engine B) By a belt connected to the crankshaft CBy a turbine driven by exhaust gases…arrow_forward
- LESSON: AUTODESK AUTOCAD Choose from the choices:arrow_forwardDevelop a format for technical/lab report writing?arrow_forwardengineering economy question. the correct answer is about $8,888 A new CNC machine is purchased for $40,000. The salvage value of the CNC machine is expected to be 15% of the initial cost. The CNC machine qualifies for 3-year GDS MACRS depreciation. What is the book value of the CNC machine after two years of depreciation?arrow_forward
- This question belongs to the course machine design elements in mechanical engineering major. i couldn't find an appropriate solution for it because many people confuse it with something else so this time I am attaching a picture of a slide of this topic so you can get a better understanding of what it's all about. hope this time I find a correct solution for this. Please try to help me ASAP as I have an exam in 8 hours and I am stuck on this question.arrow_forwardUniversity of Babylon College Of Engineering -Al-Musayyab Automobile Production Semi-First Semester 2023-2024 3rd Stage Name: 1.In automobile classification, which factor is commonly used to categorize vehicles? Ay Fuel Efficiency B) Engine Size Drive Type D) Passenger Capacity 2. What industrial surface modification process is described, which aims to enhance the wear, corrosion, and fatigue resistance of steel components such as crankshafts? A) Hardening BNitriding Annealing D) Galvanizing 3.What is the purpose of the cylinder honing method described in the passage? A) To increase imperfections in the bore By To remove glaze and minor imperfections C) To rotate the spindle for reboring D) To mount graded grinding stones 8.What are some functions of the chassis frame mentioned in the passage? A) To operate the brakes and acceleration B) To carry passengers or goods, support body and engine Toad C) To withstand road conditions and cornering forces D) To house the gearbox and engine…arrow_forwardhow to do dissertation timeline gantt chartarrow_forward
- Case Study: Paula’s Pain Paula has worked for Brindle Corporation for 3 years. During this time, she has worked as a machine operator/cell leader in various work cells. Recently, the plant went to mandatory 12-hour shifts and plans to remain on this schedule for several months. Paula’s present work cell is manufacturing 3-inch diameter exhaust tubes that are made from stainless steel. These tubes get a hole punched in them, a flange welded on, and burrs ground off. The pipe then gets placed into a gage to check that it was made correctly. (The tubes weigh about six pounds.) Paula has been performing the welding operation. She leans into the machine and loads the part into a fixture then positions the flange. Both pieces are clamped (using hand clamps) into position and the machine is cycled by depressing two palm buttons. The gaging operation requires placing the finished part into the gage and clamping it (using hand clamps) into place. A pin is depressed to verify the position…arrow_forwardShare the knowledge necessary to become a Certified Quality Engineer (CQE). Note: (Basically, I am studying industrial engineering)arrow_forwardWhat's the answer to this question?arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Precision Machining Technology (MindTap Course Li...Mechanical EngineeringISBN:9781285444543Author:Peter J. Hoffman, Eric S. Hopewell, Brian JanesPublisher:Cengage LearningWelding: Principles and Applications (MindTap Cou...Mechanical EngineeringISBN:9781305494695Author:Larry JeffusPublisher:Cengage Learning

Precision Machining Technology (MindTap Course Li...
Mechanical Engineering
ISBN:9781285444543
Author:Peter J. Hoffman, Eric S. Hopewell, Brian Janes
Publisher:Cengage Learning

Welding: Principles and Applications (MindTap Cou...
Mechanical Engineering
ISBN:9781305494695
Author:Larry Jeffus
Publisher:Cengage Learning