WorksheetsIntroduction to Microcontrollers - Lecture and Schedule
Total questions: 99
Worksheet time: 50mins
According to the tentative schedule, what is the topic for the Week 5 lecture on October 6th?
Good design
Intro to microcontrollers
Teamwork
Intro to Solid Modelling
What is the due date for the Arduino Assignment as per the reminder?
October 6th
October 13th
October 17th
October 20th
The lab topic for Week 6 (October 13th) is _________.
Ideation and design (stained glass and in-home sensor)
Circuit analysis and soldering
Arduino programming basics
User interface prototyping
What does Electrical engineering deal with?
Generation and distribution of electric power through conductors
Manipulation of electric signals to process information
Only low voltage and current systems
Which of the following is NOT a system included in Electrical engineering?
Power plants
Electrical grids
Computers
Electronics focuses on manipulation of electric signals to process information and change the state of an item.
True
False
Electrical systems involve high voltage and current, while Electronics involves ______ voltage and current.
low
high
medium
variable
Which of the following is a system included in Electronics?
Large machinery
Controllers
Power plants
What does PCB stand for in electronics hardware?
Printed Circuit Boards
Power Control Box
Primary Connection Board
Programmable Circuit Base
A microcontroller is a compact integrated circuit that governs specific operations in embedded systems.
True
False
Which of the following is NOT a feature of a microcontroller?
Combines a processor, memory, and input/output on a single chip
Made with conductive traces etched from copper sheets
May include arithmetic logic or other specialized processing units
Why learn to use Microcontrollers? (e.g. Arduino) Which of the following is NOT a reason to use microcontrollers?
Enables us to add logic or brains to our designs
Speeds prototyping
Makes designs more expensive
Convenient and easy access to sensors and controls
Broadly adopted and accessible technology (not starting from scratch)
Why learn to use Microcontrollers? (e.g. Arduino) Microcontrollers are ________ adopted and accessible technology (not starting from scratch).
broadly
rarely
narrowly
slowly
Why learn to use Microcontrollers? (e.g. Arduino) Which of the following disciplines can benefit from the use of microcontrollers?
Mechanical (automation ...)
All of the above
Biomedical (wearable or assistive and adaptive tech ...)
Electronics (control and communication ...)
Civil (smart infrastructure ...)
Why learn to use Microcontrollers?
Mechanical
Smart infrastructure
Electronics
Automation
Civil
Sensors, process control
Biomedical
Control and communication
Chemical
Wearable or assistive and adaptive tech
We can't communicate with or control things until we can connect with them because:
Connection is required to send and receive information.
Things can be controlled without any connection.
Communication happens automatically without connection.
Control is possible even without communication.
To turn on the LED light, how should we connect the button battery?
Connect the positive terminal of the battery to the longer leg of the LED and the negative terminal to the shorter leg.
Connect both terminals of the battery to the longer leg of the LED.
Connect the positive terminal of the battery to the shorter leg of the LED and the negative terminal to the longer leg.
Connect both terminals of the battery to the shorter leg of the LED.
LED light powered by a battery. Does it matter which way we connect them? (Which way we wire the LED?)
Yes
No
Which direction do electrons actually flow?
Positive to Negative
Negative to Positive
Both directions
None of the above
The conventional approach to current flow is from positive to negative.
True
False
A diode is a ________ electrical device.
polarized
non-polarized
neutral
variable
What happens if an LED is connected backwards?
LEDs connected backwards do not emit light.
LEDs connected backwards emit more light.
LEDs connected backwards explode immediately.
LEDs connected backwards work as a normal resistor.
Which leg of the LED is the anode?
Short leg
Long leg
Flat edge
Cathode
Does it matter if we use a 9V battery instead?
Yes, using a 9V battery can affect the circuit's performance.
No, any battery will work the same.
It only matters if the battery is rechargeable.
A 9V battery is always the best choice.
What can we do?
use resistors
paint the wires
remove the battery
increase the wire length
How much resistance is required here?
50Ω
10Ω
100Ω
200Ω
What is the value of V_r in the equation V_circuit = V_led + V_r, if V_circuit = 3V and V_led = 2V?
2V
1V
3V
0V
Using Ohm's Law, what is the formula to calculate resistance (R)?
R = V / I
R = I / V
R = V × I
R = I × R
In a series circuit, the sum of the source voltages (Σ V_sources) is equal to the sum of the voltage drops (Σ V_drops), and ______ is constant.
current (I)
voltage (V)
resistance (R)
power (P)
The purpose of using a resistor in this circuit is:
To limit the current flow
To increase the voltage
To store electrical energy
To convert AC to DC
Resistors are color coded. Which color band represents the multiplier in a 4-band resistor?
1st band
2nd band
3rd band
4th band
The tolerance band in a resistor is usually colored ______ or ______.
gold or silver
red or blue
green or yellow
black or white
brown or orange
Match the following Arduino Uno hardware components to their corresponding labels on the diagram:
Reset button
1
Tx and Rx LEDs
2
Digital Pins
3
Power LED
4
Microcontroller (brains)
5
Which component on the Arduino Uno is responsible for processing and controlling the board (the 'brains')?
Reset button
Microcontroller
Power LED
USB Port
The USB Port (type B – square plug) on the Arduino Uno is used for:
Connecting the Arduino to a computer for programming and power.
Connecting external sensors directly to the Arduino.
Supplying power from a battery pack.
Interfacing with wireless modules.
Microcontrollers Digital I/O: Push buttons / switches are examples of ______ signals (on/off).
digital
analog
mechanical
optical
Microcontrollers Digital I/O: Buzzers are examples of ______ signals (on/off).
digital
analog
continuous
variable
Microcontrollers Digital I/O: Digital communication signals are sequences of ______ signals.
on/off
analog
continuous
random
Microcontrollers Digital I/O: Other digital devices like displays use sequences of ______ signals.
on/off
analog
pulse-width
frequency
Type of Data Microcontrollers Generally Deal with: Which type of data do microcontrollers generally deal with for both input and output?
Digital
Analogue
Both
None
Which programming language are Arduinos programmed using?
Python
Java
C++
JavaScript
Microcontrollers only do ______ what we tell them.
EXACTLY
SOMETIMES
NEVER
APPROXIMATELY
Programs are just a sequence of instructions that are really specific.
True
False
What must we be very careful about in our programs?
Instructions and syntax
Hardware connections
Power supply
None of the above
In the provided Arduino code example, what is the purpose of the 'lightOn' variable?
To store the pin number
To store if the LED is on or off
To store the button state
To store the output voltage
In the Arduino code example, which function is used to set up the pin modes?
setup()
loop()
pinMode()
digitalWrite()
What is the purpose of defining global variables in an Arduino program?
To store values that are used only once
To define any constants and/or global variables with starting values
To run code continuously
To set pin modes
In Arduino, which function runs ONLY once at the start?
loop()
setup()
main()
start()
In Arduino, which function runs continuously while the board is powered?
setup()
main()
loop()
start()
In C/C++, everything is ________ (e.g. functions digitalWrite, pinMode ...).
CASE SENSITIVE
CASE INSENSITIVE
OBJECT ORIENTED
STATIC
Which of the following is required at the end of each command in C/C++ syntax?
Colon
Semicolon
Comma
Period
Which color does the Arduino IDE use for code comments by default?
Black
Orange
Blue
Green
The Arduino IDE uses different colors for built-in functions, code comments, and other elements.
True
False
What is the best practice for defining global variables in C/C++?
Defined at top
Defined inside main()
Defined inside a function
Defined in a header file without extern
In C++/Arduino, variables must be declared before use, including their ______ information.
type
size
location
value
Which of the following is a floating point variable type in C/C++?
int
long
float
bool
Local variables in C/C++ are accessible everywhere in your code.
True
False
What is the range of values for an int type in C/C++?
-32768 to +32767
0 to 65535
-2147483648 to +2147483647
-128 to +127
Which variable type would you use to store a value that can only be true or false in C/C++?
bool
int
float
char
What is the correct way to declare a single character variable in C/C++?
char tagChar = 'T';
char tagChar = "T";
char tagChar = T;
char tagChar = 'TT';
Which Arduino function is used to set a pin as input or output?
digitalRead
pinMode
analogRead
millis
What does the Arduino function digitalWrite(pin#, LOW | HIGH) do?
Sets a pin voltage to LOW (0V) or HIGH (5V)
Reads the voltage level from a pin
Configures the pin as input or output
Generates a PWM signal on the pin
Which function would you use to read an analog value from a pin in Arduino?
analogRead(pin#)
digitalWrite(pin#)
pinMode(pin#)
digitalRead(pin#)
The millis() function in Arduino returns the number of milliseconds since the board began running.
True
False
What is the purpose of the map(...) function in Arduino?
Linear interpolation from one range to another. Useful for AI/AO.
To generate random numbers within a range.
To store sensor data in memory.
To control the speed of a motor directly.
Which color pins on the Arduino UNO can be either inputs or outputs?
Green
Yellow
Red
Blue
Yellow pins on the Arduino UNO can only be _______.
inputs
outputs
power sources
grounds
Indicated Red pins deliver _______ if the board is powered.
power
data
ground
signal
Green and yellow pins on the Arduino UNO are controllable points.
True
False
Which function in Arduino code runs only once at start?
void setup()
void loop()
digitalRead()
digitalWrite()
Which function in Arduino code runs continuously?
void setup()
void loop()
digitalRead()
digitalWrite()
To read button state in Arduino, use _______.
digitalRead
analogWrite
pinMode
delay
To turn light on or off in Arduino, use _______.
digitalWrite
analogRead
pinMode
delay
When you click on the button, what do you see?
A pop-up window appears
The page reloads
Nothing happens
A sound is played
What do you see in the Serial output?
A sequence of numbers increasing by one
A blank screen with no output
An error message indicating a failure
A series of random characters
What is 'Serial' in Arduino programming?
A function for mathematical operations
A global Arduino object dedicated to serial communication over the USB tether cable
A type of variable
A debugging tool
What does the function Serial.print(argument) do in Arduino programming?
It prints to the computer screen
It sends the argument to the serial port
It saves data to a file
It reads input from the user
In Arduino, the Serial.print(argument) function generally sends ______ or text in quotes to the serial port.
numbers
images
sounds
colors
Why is using the Serial object in Arduino programming very useful?
It helps in drawing graphics
It is very useful for troubleshooting programming
It increases the speed of the program
It saves memory
In the code example, what is the purpose of Serial.begin(9600)?
To start the LED
To initialize serial communication at 9600 bps
To read a button state
To print a message
In the 'Delay for Button Release Example', what is the purpose of delay(200)?
To turn on the LED
To allow the button to be released
To print a message
To initialize serial communication
In the 'Require Button Release Example', what is the value of btnReady when the button is pressed and released?
true
false
Which of the following is an example of an analog signal that microcontrollers can process?
Temperature sensor
Humidity sensor
Speed of a motor
Loudness of a speaker
Microcontrollers work with 2 types of data: ______ and digital.
Analog
Binary
Serial
Parallel
Analog signals can take on any value within their range.
True
False
According to the table, do microcontrollers generally deal with analog input data?
True
False
According to the table, do microcontrollers generally deal with analog output data?
True
False
Which type of data can Arduinos handle as output?
Digital
Analogue
Both
None
True or False: Arduinos can send analogue signals.
True
False
All Arduino output is _______.
digital
analog
mechanical
optical
What technique do Arduinos use to simulate analogue outputs?
Pulse Width Modulation (PWM)
Digital to Analogue Conversion (DAC)
Serial Communication (UART)
Frequency Modulation (FM)
Explain how Arduinos fake analogue output (AOs).
By using Pulse Width Modulation (PWM) to simulate varying voltage levels.
By directly generating true analogue voltages from digital pins.
By using digital-to-analogue converters on all pins.
By switching between high and low states at random intervals.
What is the average output voltage for a 50% duty cycle if the maximum voltage is 5V?
2.5V
1V
5V
0V
Which type of data output can Arduinos NOT handle directly, according to the table shown?
Digital Output Data
Analogue Output Data
Digital Input Data
Analogue Input Data
Arduinos can output PWM signals only on select digital pins marked with ~.
True
False
To output a 2.5V signal using Arduino PWM, what value should be written to the pin using analogWrite?
127
64
255
200
How many different pulse thicknesses can Arduino PWM slice a max 5V output into?
256 (0 to 255)
128 (0 to 127)
512 (0 to 511)
1024 (0 to 1023)
In the example provided, if a cylinder stroke is 75 mm out of 150 mm, what voltage and analogWrite value would be used?
2.5 volts and analogWrite value of 127
5 volts and analogWrite value of 255
1.5 volts and analogWrite value of 76
3.75 volts and analogWrite value of 191
What is the voltage range that can be read on an Arduino analog pin?
0-3.3V
0-5V
0-10V
0-12V
