Unit 1: Setting Up and GPIO Handling - Practice Quiz

ECE140 — Workshop On Iot For Digital Society 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is a Raspberry Pi?

Introduction to Raspberry Pi Easy
A. A wireless router
B. A digital multimeter
C. A single-board computer
D. A removable storage drive

2 Which component is commonly used to store the Raspberry Pi operating system?

Introduction to Raspberry Pi Easy
A. A sound card
B. A microSD card
C. A relay module
D. A graphics card

3 From where should Raspberry Pi Imager preferably be downloaded?

Downloading the Raspberry Pi Imager Easy
A. Any website that provides modified installation packages with additional third-party tools
B. The GPIO configuration menu
C. The RealVNC connection window
D. The official Raspberry Pi website

4 What is the main purpose of Raspberry Pi Imager?

Downloading the Raspberry Pi Imager Easy
A. To control LED brightness
B. To measure GPIO voltage
C. To write an operating system image
D. To create a remote desktop connection

5 Which command refreshes the list of available software packages in Raspberry Pi OS?

Setting and updating the Raspberry Pi OS Easy
A. sudo vnc connect
B. sudo apt update
C. sudo gpio read
D. sudo apt blink

6 Why should Raspberry Pi OS be updated regularly?

Setting and updating the Raspberry Pi OS Easy
A. To obtain fixes and improvements
B. To increase the GPIO voltage
C. To convert every input pin into a permanent power output automatically
D. To change physical pin numbers

7 What does RealVNC allow a user to do?

Installing RealVNC Easy
A. Generate PWM without software
B. Increase the microSD card voltage
C. Replace the Raspberry Pi operating system
D. Access the Raspberry Pi desktop remotely

8 Which RealVNC application is normally used on another computer to connect to a Raspberry Pi?

Installing RealVNC Easy
A. VNC Compiler
B. VNC Viewer
C. VNC application that rewires and protects every GPIO pin during remote access
D. VNC Imager

9 What does BCM pin numbering refer to?

Pin configuration of Raspberry Pi Easy
A. Sequential numbers assigned by the operating system to every attached USB device
B. Pin numbers printed on an LED
C. Physical positions on the header
D. GPIO numbers defined by the processor

10 What does physical pin numbering describe?

Pin configuration of Raspberry Pi Easy
A. Positions on the GPIO header
B. Numbers assigned to Python programs
C. GPIO channels inside the processor
D. Addresses of network devices

11 Which GPIO header pin type provides the electrical reference level for a circuit?

Understanding GPIO header pin functions Easy
A. Input pin
B. Ground pin
C. Serial data pin
D. PWM pin

12 Which function allows a GPIO pin to receive a digital signal from a sensor or switch?

Understanding GPIO header pin functions Easy
A. Input
B. Operating system storage
C. Power supply
D. Output

13 When interfacing a push-button switch, the connected GPIO pin is normally configured as what?

Switch interfacing with Raspberry Pi Easy
A. A power pin
B. A digital input
C. A digital output
D. A network interface

14 What is the purpose of a pull-up or pull-down resistor in a switch circuit?

Switch interfacing with Raspberry Pi Easy
A. To create a VNC password
B. To prevent a floating input
C. To update Raspberry Pi OS
D. To continuously supply the highest possible current to the GPIO input

15 For an LED-blinking program, how should the LED's GPIO pin be configured?

First program: LED blinking Easy
A. As an output
B. As an input
C. As a storage interface
D. As a ground pin

16 Which basic sequence makes an LED blink?

First program: LED blinking Easy
A. Set ground HIGH, remove power, wait
B. Read input, update OS, restart VNC
C. Turn ON, wait, turn OFF, wait
D. Turn ON and continuously increase the GPIO voltage until the LED switches OFF

17 Why is a resistor usually connected in series with an LED?

First program: LED blinking Easy
A. To limit current
B. To assign a BCM number
C. To store the program
D. To enable remote access

18 What does PWM stand for?

PWM concept and switch interfacing Easy
A. Program Window Mapping
B. Pin Wire Management
C. Power Wave Measurement
D. Pulse Width Modulation

19 What can be controlled by changing the PWM duty cycle applied to an LED?

PWM concept and switch interfacing Easy
A. Its apparent brightness
B. Its operating system
C. Its remote desktop password and network address
D. Its physical pin number

20 What logic voltage level is normally used by Raspberry Pi GPIO pins?

GPIO electrical characteristics and protection Easy
A.
B.
C.
D.

21 A student wants to download Raspberry Pi Imager while avoiding modified or malicious installers. Which source should the student use?

Downloading the Raspberry Pi Imager Medium
A. A third-party driver download website
B. A link from an online advertisement
C. A community file-sharing website
D. The official Raspberry Pi software website

22 A Raspberry Pi has no operating system on its microSD card. Where should Raspberry Pi Imager initially be installed?

Downloading the Raspberry Pi Imager Medium
A. On the empty microSD card before it is formatted
B. On the computer used to prepare the microSD card
C. On the router connected to the Raspberry Pi
D. On the Raspberry Pi through its GPIO header

23 Which command sequence refreshes package information and then installs available Raspberry Pi OS upgrades?

Setting and updating the Raspberry Pi OS Medium
A. sudo apt remove && sudo apt clean
B. sudo apt install && sudo apt update
C. sudo apt search && sudo apt download
D. sudo apt update && sudo apt full-upgrade

24 A Raspberry Pi will be used headlessly and must connect to Wi-Fi immediately after its first boot. Which preparation is most appropriate?

Setting and updating the Raspberry Pi OS Medium
A. Install a desktop environment after every boot
B. Format the microSD card after writing the image
C. Connect the Wi-Fi adapter through a GPIO output
D. Configure Wi-Fi and SSH in Imager before writing

25 RealVNC Viewer is installed on a laptop, but a connection to the Raspberry Pi is refused. Both devices are on the same network. What should be checked first?

Installing RealVNC Medium
A. Whether PWM is enabled on a GPIO pin
B. Whether the microSD card has two partitions
C. Whether the VNC server is enabled on the Pi
D. Whether the laptop has an HDMI output

26 After enabling VNC on a Raspberry Pi, which information can a laptop on the same local network normally use to initiate a connection?

Installing RealVNC Medium
A. The Raspberry Pi hostname or IP address
B. The monitor HDMI resolution setting
C. The Raspberry Pi GPIO pin numbering mode
D. The microSD card partition label

27 An LED is connected to physical header pin 12, which is BCM GPIO18. A program uses GPIO.setmode(GPIO.BOARD) followed by GPIO.setup(18, GPIO.OUT). What is the simplest correction?

Pin configuration of Raspberry Pi Medium
A. Change GPIO.BOARD to GPIO.BCM
B. Change physical pin 12 to pin 18
C. Change GPIO18 to the 5 V supply
D. Change GPIO.OUT to GPIO.IN

28 A Python program exits unexpectedly while a GPIO pin is configured as an output. Which structure best ensures that the pin configuration is released?

Pin configuration of Raspberry Pi Medium
A. Place GPIO.output() in an endless loop
B. Place GPIO.setmode() after every output
C. Place GPIO.setup() inside each delay
D. Place GPIO.cleanup() in a finally block

29 A push button connects a GPIO input to ground when pressed, and the internal pull-up resistor is enabled. What logic levels should the program expect?

Switch interfacing with Raspberry Pi Medium
A. HIGH for both released and pressed states
B. LOW when released and HIGH when pressed
C. LOW for both released and pressed states
D. HIGH when released and LOW when pressed

30 One physical button press is sometimes detected as several rapid presses. Which modification most directly addresses this problem?

Switch interfacing with Raspberry Pi Medium
A. Disable all pull-up and pull-down resistors
B. Replace the input pin with a 5 V pin
C. Add hardware or software switch debouncing
D. Increase the GPIO output drive strength

31 Which project requirement most strongly favors a Raspberry Pi over a basic microcontroller board?

Introduction to Raspberry Pi Medium
A. Generating one fixed-frequency square wave
B. Reading one switch with minimal power consumption
C. Running Linux, networking, and a graphical interface
D. Controlling one LED without an operating system

32 A Raspberry Pi data logger is being switched off by directly disconnecting its power supply. Which practice better protects its file system?

Introduction to Raspberry Pi Medium
A. Disconnect the network cable before removing power
B. Perform an operating-system shutdown before removing power
C. Remove the microSD card while the Pi is running
D. Set every GPIO output HIGH before removing power

33 A sensor communicates using the I2C bus on a standard 40-pin Raspberry Pi header. Which GPIO pair should normally carry its data and clock signals?

Understanding GPIO header pin functions Medium
A. GPIO10 for SDA and GPIO11 for SCL
B. GPIO14 for SDA and GPIO15 for SCL
C. GPIO18 for SDA and GPIO19 for SCL
D. GPIO2 for SDA and GPIO3 for SCL

34 A GPS module uses 3.3 V UART communication. Which Raspberry Pi GPIO signals should be cross-connected to the module?

Understanding GPIO header pin functions Medium
A. GPIO14 TX to module RX and GPIO15 RX to module TX
B. GPIO10 MOSI to module RX and GPIO9 MISO to module TX
C. GPIO14 TX to module TX and GPIO15 RX to module RX
D. GPIO2 SDA to module RX and GPIO3 SCL to module TX

35 An LED has a forward voltage of approximately and should draw no more than from a GPIO output. Which standard resistor is the safest suitable choice?

First program: LED blinking Medium
A.
B.
C.
D.

36 An LED is connected from a GPIO output through a resistor to ground. Which repeated sequence produces a visible blink with equal ON and OFF times?

First program: LED blinking Medium
A. Set HIGH, delay, set LOW, delay
B. Set input, delay, set output, delay
C. Set HIGH, set LOW, delay, delay
D. Set LOW, delay, set LOW, delay

37 A PWM signal has a frequency of and a duty cycle of . For how long is the signal HIGH during each cycle?

PWM concept and switch interfacing Medium
A.
B.
C.
D.

38 A button should increase an LED's PWM brightness by per valid press without exceeding the allowed range. Which control rule is most appropriate?

PWM concept and switch interfacing Medium
A. Count every transition and allow duty cycle above
B. Disable the pull resistor and increase PWM frequency
C. Set the GPIO permanently HIGH after the first press
D. Debounce the press and clamp duty cycle to –

39 A sensor produces a digital output, but its signal must be read by a Raspberry Pi GPIO input. What is the safest interface?

GPIO electrical characteristics and protection Medium
A. A suitable level shifter or voltage divider
B. An LED connected in parallel with the GPIO
C. A direct wire from the sensor to GPIO
D. A pull-up resistor connected to the 5 V rail

40 Two Raspberry Pi GPIO pins might accidentally be configured as outputs at opposite logic levels while connected together. Which addition can reduce the resulting fault current?

GPIO electrical characteristics and protection Medium
A. A series resistor between the two GPIO pins
B. A pull-up resistor on both GPIO outputs
C. A capacitor from each GPIO pin to 5 V
D. A direct connection through a shorter wire

41 A laboratory computer uses 64-bit Ubuntu on an x86-64 processor, while the SD card will boot a Raspberry Pi 4 with an ARM processor. Which Raspberry Pi Imager package should be downloaded?

Downloading the Raspberry Pi Imager Hard
A. The Linux ARM64 package, because the target Raspberry Pi uses ARM
B. The Linux x86-64 package, because Imager runs on the laboratory computer
C. The Windows x86-64 package executed through Linux compatibility mode
D. The Raspberry Pi OS ARM64 image renamed as an installer package

42 An air-gapped laboratory requires both reproducible installation and verification that no downloaded file was modified. Which workflow best satisfies these requirements?

Downloading the Raspberry Pi Imager Hard
A. Transfer only Imager, allow offline execution, and expect it to obtain the OS
B. Download files from a mirror, disable verification, and let Imager repair errors
C. Download official files, verify published hashes, transfer them, and select the local image
D. Copy an installed SD card, rename its partitions, and trust the existing filesystem

43 A Raspberry Pi OS installation has not been updated for several months. Which procedure correctly refreshes package metadata and permits dependency changes required by a distribution update?

Setting and updating the Raspberry Pi OS Hard
A. Run sudo apt upgrade alone, then delete the package database and reboot
B. Run sudo apt autoremove alone, then reinstall the Raspberry Pi bootloader
C. Run sudo rpi-update first, then replace all configured software repositories
D. Run sudo apt update, then sudo apt full-upgrade, and reboot if required

44 A configured Raspberry Pi OS card is cloned onto 30 cards. After booting, several devices produce SSH identity warnings and management software treats them as the same host. What should have been done before deployment?

Setting and updating the Raspberry Pi OS Hard
A. Regenerate machine identifiers and SSH host keys uniquely on every cloned system
B. Assign every clone the same static address and preserve all authentication files
C. Reformat only the boot partition while preserving the cloned root filesystem
D. Change only the desktop wallpaper and retain the original system identity files

45 A student installs RealVNC Viewer on a laptop but cannot connect to a Raspberry Pi that has no VNC-related service running. Which configuration establishes the required client-server arrangement?

Installing RealVNC Hard
A. Enable SSH on the laptop, then use Viewer without any Pi-side service
B. Install and enable RealVNC Server on the Pi, then connect using Viewer
C. Install another Viewer on the Pi, then connect the two Viewer applications
D. Install RealVNC Server on the laptop, then make the Pi open the session

46 RealVNC works within a classroom LAN, but remote access is required from the Internet. Which approach minimizes unnecessary exposure of the Raspberry Pi?

Installing RealVNC Hard
A. Use a trusted VPN or RealVNC cloud connection without directly exposing port 5900
B. Disable authentication temporarily and restrict access using the VNC window size
C. Place the Raspberry Pi in the router DMZ and permit every incoming protocol
D. Forward port 5900 publicly, disable encryption, and retain password-only access

47 A Python program executes GPIO.setmode(GPIO.BCM) followed by GPIO.setup(11, GPIO.OUT). Which 40-pin header contact is configured?

Pin configuration of Raspberry Pi Hard
A. Physical pin 24, corresponding to BCM GPIO8
B. Physical pin 23, corresponding to BCM GPIO11
C. Physical pin 11, corresponding to BCM GPIO17
D. Physical pin 19, corresponding to BCM GPIO10

48 SPI is enabled and a kernel driver is actively using GPIO10 as MOSI. A Python program then attempts to configure GPIO10 as an ordinary output. What is the soundest design decision?

Pin configuration of Raspberry Pi Hard
A. Enable an internal pull-up because pull resistors disable all alternate functions
B. Select BOARD numbering because it automatically releases GPIO10 from SPI mode
C. Drive GPIO10 harder so the Python output overrides the peripheral controller
D. Use another GPIO or disable the SPI function before taking control of GPIO10

49 A push-button connects a GPIO input to ground, and the GPIO uses an internal pull-up. Pressing the button triggers several callbacks instead of one. Which interpretation and correction are appropriate?

Switch interfacing with Raspberry Pi Hard
A. The press is active-low; apply hardware or software debouncing to the transition
B. The switch generates analog voltage levels; connect it directly to the 5 V rail
C. The input is floating only while pressed; configure the pin as a PWM output
D. The press is active-high; replace the pull-up with a stronger output driver

50 A switch pulls a GPIO input to ground and the internal pull-up is enabled. Which addition best limits fault current if software accidentally reconfigures that GPIO as a high output while the switch is pressed?

Switch interfacing with Raspberry Pi Hard
A. Place a large capacitor directly between the GPIO pin and the 5 V supply
B. Add only an external pull-up while leaving the switch directly connected
C. Place a forward-biased diode directly between the GPIO pin and ground
D. Place a suitable series resistor, such as , in the switch path

51 A control loop must toggle an output every with worst-case jitter below while Raspberry Pi OS performs networking and storage operations. Which architecture is most appropriate?

Introduction to Raspberry Pi Hard
A. Use hardware-timed peripherals or a dedicated microcontroller for the critical loop
B. Use a normal Python sleep loop and increase the graphical desktop priority
C. Use a VNC session because remote execution removes local scheduling delays
D. Use a shell script and assume the Linux scheduler provides deterministic timing

52 A deployed Raspberry Pi is frequently disconnected from power without shutdown, eventually causing filesystem corruption. Which design change most directly addresses the underlying risk?

Introduction to Raspberry Pi Hard
A. Change from BCM numbering to BOARD numbering before disconnecting the supply
B. Increase the GPIO drive strength so the SD card completes writes more quickly
C. Disable every pull resistor because pulls continue consuming power after shutdown
D. Provide controlled shutdown or use a read-only and power-loss-tolerant storage design

53 A custom board for a 40-pin Raspberry Pi uses physical pins 27 and 28 as ordinary digital outputs. Why can this interfere with standard HAT identification?

Understanding GPIO header pin functions Hard
A. Those pins are GPIO14 and GPIO15, permanently assigned to the primary UART
B. Those pins are GPIO10 and GPIO11, permanently assigned to the SPI data bus
C. Those pins are GPIO0 and GPIO1, commonly reserved for the HAT ID EEPROM bus
D. Those pins are GPIO2 and GPIO3, permanently assigned to the system clock

54 A technician wants to connect the Raspberry Pi UART on physical pins 8 and 10 to a legacy computer's RS-232 port. Which interface is required?

Understanding GPIO header pin functions Hard
A. A passive cable connecting the Pi UART pins directly to the RS-232 connector
B. An I2C level converter with clock connected to transmit and data connected to receive
C. A 5 V pull-up on both UART lines with transmit and receive connected in parallel
D. A 3.3 V UART-to-RS-232 level shifter with crossed transmit and receive signals

55 An LED with forward voltage is driven from a GPIO. To target no more than , which standard resistor is the closest suitable choice?

First program: LED blinking Hard
A.
B.
C.
D.

56 An active-high LED briefly flashes during program startup and remains on if the Python program terminates with an exception. Which structure best controls both problems?

First program: LED blinking Hard
A. Configure PWM at full duty cycle and terminate by forcibly killing Python
B. Configure the output with an initial high state and omit cleanup after exceptions
C. Configure the pin as an input first and connect the LED without a resistor
D. Configure the output with an initial low state and perform cleanup in finally

57 An LED receives pulses from PWM at a duty cycle of , with a frequency high enough to avoid visible flicker. What is its approximate average current?

PWM concept and switch interfacing Hard
A.
B.
C.
D.

58 Each detected button press should increase LED PWM duty cycle by , but one physical press often produces increases of or . Which correction best preserves the intended behavior?

PWM concept and switch interfacing Hard
A. Replace duty-cycle control with GPIO numbering changes and retain all button callbacks
B. Increase PWM frequency, process every detected edge, and allow duty cycle above
C. Debounce the button, update once per stable press, and clamp duty cycle to –
D. Disable the input pull resistor, count both edges, and reset PWM after every callback

59 A push-pull sensor produces a logic-high output. A divider should reduce this to approximately at a Raspberry Pi GPIO. Which resistor arrangement gives the required nominal voltage?

GPIO electrical characteristics and protection Hard
A. from sensor to GPIO and from GPIO to ground
B. from sensor to GPIO and from GPIO to ground
C. from sensor to GPIO and from GPIO to ground
D. from sensor to GPIO and from GPIO to ground

60 A relay coil requires , far above what a GPIO should supply. Which interface provides appropriate drive and protection?

GPIO electrical characteristics and protection Hard
A. Use only an internal pull-up and omit protection because the relay is digital
B. Drive the coil directly from the GPIO and place a resistor across the GPIO pin
C. Connect the coil between two GPIO pins and switch them in opposite directions
D. Use a transistor driver, a coil flyback diode, and a common ground reference