Final exam
Arduino Basics
Before you start
- 20 questions, drawn at random from a pool of 34.
- Pass mark: 70%. Your final score is 30% practice + 70% exam.
- No time limit, but finish within 3 hours. You can move between questions before you submit.
- Failed? Review the lessons and try again: every attempt gets a new set of questions.
Question 1 of 20Choose one
What does an Arduino do with its program when the power is switched off and on again?
Question 2 of 20True or false
On an Arduino Uno, digital pin 13 is connected to a small LED built into the board.
Question 3 of 20Select all that apply
Which jobs suit an Arduino Uno better than a laptop? Select all that apply.
Select all that apply.
Question 4 of 20Fill in the blanks
Fill in the blanks
In Blink, delay(1000) pauses the program for milliseconds, which is second.
Question 5 of 20Put in order
Order what happens from clicking Upload to the LED blinking.
Drag the items, or use the arrow buttons, to put them in order.
- loop() runs over and over
- The compiled program is sent over USB to the bootloader
- The IDE compiles the C++ code into machine code
- The board resets and runs setup() once
- The bootloader writes it into flash memory
Question 6 of 20Work it out
A white LED with a forward voltage of 3.0 V should run at 10 mA from a 5 V pin. What resistor value in ohms does the formula give?
Question 7 of 20Choose one
Which LED leg connects toward the positive side of the circuit?
Question 8 of 20True or false
The two long rails on the edges of a breadboard are typically used to distribute power and ground along the board.
Question 9 of 20What would you do?
What would you do?
A student wires an LED directly between pin 8 and GND with no resistor and sets the pin HIGH. What is the most likely outcome?
Question 10 of 20Sort into groups
Sort each button wiring by whether it gives a reliable reading.
Tap an item, then tap its group (or drag it there).
Question 11 of 20Choose one
A sketch toggles a lamp each time a button is pressed, but sometimes one press toggles it twice. What is the cause?
Question 12 of 20Work it out
analogRead(A2) returns 205 on a 5 V Uno. What voltage is that, to two decimal places?
Question 13 of 20Choose one
A 10 kΩ potentiometer has its outer pins on 5 V and GND, and the wiper on A0. What range of readings do you get as you turn it fully?
Question 14 of 20Work it out
In a voltage divider, R1 = 20 kΩ is on top (to 5 V) and R2 = 5 kΩ is on the bottom (to GND). What is the output voltage in volts?
Question 15 of 20True or false
analogWrite() works on every digital pin of the Arduino Uno.
Question 16 of 20Work it out
analogWrite(5, 191) on a 5 V pin gives what average voltage? Round to two decimals.
Question 17 of 20Fill in the blanks
Fill in the blanks
To convert a reading from analogRead into an analogWrite level, you can use map(raw, 0, , 0, ).
Question 18 of 20Choose one
A TMP36 reads 0.5 V. What temperature does that mean?
Question 19 of 20Choose one
Which data type should store a count of visitors that may reach 50,000 on an Uno?
Question 20 of 20Spot the mistake
This line should run the block only when mode equals 2, but it runs every time. Click the faulty token.
Question 21 of 20Work it out
How many times does for (int i = 0; i < 8; i++) run its body?
Question 22 of 20Choose one
What is the value of the C++ expression 9 / 2 when both numbers are integers?
Question 23 of 20True or false
A variable declared inside loop() without the keyword static keeps its value from one pass of loop() to the next.
Question 24 of 20What would you do?
What would you do?
Your Serial Monitor prints a steady stream of strange symbols instead of the numbers you expected. Serial.begin(115200) is in setup(). What should you check first?
Question 25 of 20Match the pairs
Match each Serial-related item to its role.
Tap an answer, then tap the place where it belongs (or drag it there).
- Serial.begin(9600)
- Serial.print()
- Serial.println()
- Serial Plotter
Question 26 of 20Choose one
Why can a sketch that uses delay(2000) in loop() miss a quick button press?
Question 27 of 20Work it out
A task should run every 250 ms using the millis() pattern. The last run was at previous = 10,000. What is the earliest millis() value at which the task runs again?
Question 28 of 20True or false
Writing if (millis() - previous >= interval) keeps working correctly when millis() wraps back to zero after about 49.7 days, as long as the variables are unsigned long.
Question 29 of 20Choose one
What does the width of the pulse sent to a hobby servo control?
Question 30 of 20Select all that apply
Which practices are correct when an Arduino controls a DC motor through a transistor? Select all that apply.
Select all that apply.
Question 31 of 20Fill in the blanks
Fill in the blanks
To run a DC motor both forward and in reverse, you need a circuit called an , usually bought as a motor driver module.
Question 32 of 20Work it out
A project draws 120 mA from a 3,000 mAh battery pack. Ignoring losses, how many hours will it run?
Question 33 of 20Choose one
What is the recommended input voltage range for the Uno's barrel jack?
Question 34 of 20Put in order
Order these steps for building a new sensor project.
Drag the items, or use the arrow buttons, to put them in order.
- Test the output alone with a minimal sketch
- List the inputs, outputs, behavior and power needs
- Combine them with the project logic
- Assign pins and estimate the current budget
- Test the sensor alone with Serial prints