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 digital multimeter
B. A single-board computer
C. A wireless router
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 relay module
B. A microSD card
C. A graphics card
D. A sound card

3 From where should Raspberry Pi Imager preferably be downloaded?

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

4 What is the main purpose of Raspberry Pi Imager?

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

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

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

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 convert every input pin into a permanent power output automatically
C. To increase the GPIO voltage
D. To change physical pin numbers

7 What does RealVNC allow a user to do?

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

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

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

9 What does BCM pin numbering refer to?

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

10 What does physical pin numbering describe?

Pin configuration of Raspberry Pi Easy
A. Numbers assigned to Python programs
B. GPIO channels inside the processor
C. Positions on the GPIO header
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. PWM pin
B. Ground pin
C. Serial data pin
D. Input 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. Power supply
B. Output
C. Operating system storage
D. Input

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 network interface
D. A digital output

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 continuously supply the highest possible current to the GPIO input
B. To prevent a floating input
C. To create a VNC password
D. To update Raspberry Pi OS

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

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

16 Which basic sequence makes an LED blink?

First program: LED blinking Easy
A. Turn ON, wait, turn OFF, wait
B. Set ground HIGH, remove power, wait
C. Read input, update OS, restart VNC
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 enable remote access
C. To assign a BCM number
D. To store the program

18 What does PWM stand for?

PWM concept and switch interfacing Easy
A. Program Window Mapping
B. Power Wave Measurement
C. Pin Wire Management
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 operating system
B. Its physical pin number
C. Its apparent brightness
D. Its remote desktop password and network address

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 community file-sharing website
B. The official Raspberry Pi software website
C. A third-party driver download website
D. A link from an online advertisement

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 router connected to the Raspberry Pi
C. On the computer used to prepare the microSD card
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 search && sudo apt download
B. sudo apt update && sudo apt full-upgrade
C. sudo apt install && sudo apt update
D. sudo apt remove && sudo apt clean

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. Configure Wi-Fi and SSH in Imager before writing
B. Install a desktop environment after every boot
C. Connect the Wi-Fi adapter through a GPIO output
D. Format the microSD card after writing the image

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 the laptop has an HDMI output
B. Whether the VNC server is enabled on the Pi
C. Whether the microSD card has two partitions
D. Whether PWM is enabled on a GPIO pin

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 GPIO pin numbering mode
B. The monitor HDMI resolution setting
C. The microSD card partition label
D. The Raspberry Pi hostname or IP address

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 GPIO18 to the 5 V supply
B. Change GPIO.OUT to GPIO.IN
C. Change physical pin 12 to pin 18
D. Change GPIO.BOARD to GPIO.BCM

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.setmode() after every output
B. Place GPIO.cleanup() in a finally block
C. Place GPIO.output() in an endless loop
D. Place GPIO.setup() inside each delay

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. Increase the GPIO output drive strength
D. Add hardware or software switch debouncing

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

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

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. Set every GPIO output HIGH before removing power
D. Remove the microSD card while the Pi is running

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. GPIO18 for SDA and GPIO19 for SCL
B. GPIO10 for SDA and GPIO11 for SCL
C. GPIO14 for SDA and GPIO15 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 TX and GPIO15 RX to module RX
B. GPIO14 TX to module RX and GPIO15 RX to module TX
C. GPIO2 SDA to module RX and GPIO3 SCL to module TX
D. GPIO10 MOSI to module RX and GPIO9 MISO 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 LOW, delay, set LOW, delay
D. Set HIGH, set LOW, delay, 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. Disable the pull resistor and increase PWM frequency
B. Count every transition and allow duty cycle above
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. An LED connected in parallel with the GPIO
B. A direct wire from the sensor to GPIO
C. A suitable level shifter or voltage divider
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 pull-up resistor on both GPIO outputs
B. A direct connection through a shorter wire
C. A capacitor from each GPIO pin to 5 V
D. A series resistor between the two GPIO pins

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 Raspberry Pi OS ARM64 image renamed as an installer package
B. The Windows x86-64 package executed through Linux compatibility mode
C. The Linux x86-64 package, because Imager runs on the laboratory computer
D. The Linux ARM64 package, because the target Raspberry Pi uses ARM

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 official files, verify published hashes, transfer them, and select the local image
C. Copy an installed SD card, rename its partitions, and trust the existing filesystem
D. Download files from a mirror, disable verification, and let Imager repair errors

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 update, then sudo apt full-upgrade, and reboot if required
B. Run sudo apt autoremove alone, then reinstall the Raspberry Pi bootloader
C. Run sudo apt upgrade alone, then delete the package database and reboot
D. Run sudo rpi-update first, then replace all configured software repositories

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. Change only the desktop wallpaper and retain the original system identity files
B. Regenerate machine identifiers and SSH host keys uniquely on every cloned system
C. Reformat only the boot partition while preserving the cloned root filesystem
D. Assign every clone the same static address and preserve all authentication 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. Install and enable RealVNC Server on the Pi, then connect using Viewer
B. Install another Viewer on the Pi, then connect the two Viewer applications
C. Enable SSH on the laptop, then use Viewer without any Pi-side service
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. Forward port 5900 publicly, disable encryption, and retain password-only access
C. Place the Raspberry Pi in the router DMZ and permit every incoming protocol
D. Disable authentication temporarily and restrict access using the VNC window size

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 23, corresponding to BCM GPIO11
B. Physical pin 24, corresponding to BCM GPIO8
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. Select BOARD numbering because it automatically releases GPIO10 from SPI mode
B. Enable an internal pull-up because pull resistors disable all alternate functions
C. Use another GPIO or disable the SPI function before taking control of GPIO10
D. Drive GPIO10 harder so the Python output overrides the peripheral controller

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 input is floating only while pressed; configure the pin as a PWM output
B. The press is active-low; apply hardware or software debouncing to the transition
C. The press is active-high; replace the pull-up with a stronger output driver
D. The switch generates analog voltage levels; connect it directly to the 5 V rail

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. Add only an external pull-up while leaving the switch directly connected
B. Place a large capacitor directly between the GPIO pin and the 5 V supply
C. Place a suitable series resistor, such as , in the switch path
D. Place a forward-biased diode directly between the GPIO pin and ground

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 a shell script and assume the Linux scheduler provides deterministic timing
B. Use hardware-timed peripherals or a dedicated microcontroller for the critical loop
C. Use a normal Python sleep loop and increase the graphical desktop priority
D. Use a VNC session because remote execution removes local scheduling delays

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. Provide controlled shutdown or use a read-only and power-loss-tolerant storage design
C. Increase the GPIO drive strength so the SD card completes writes more quickly
D. Disable every pull resistor because pulls continue consuming power after shutdown

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 GPIO2 and GPIO3, permanently assigned to the system clock
B. Those pins are GPIO10 and GPIO11, permanently assigned to the SPI data bus
C. Those pins are GPIO14 and GPIO15, permanently assigned to the primary UART
D. Those pins are GPIO0 and GPIO1, commonly reserved for the HAT ID EEPROM bus

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 3.3 V UART-to-RS-232 level shifter with crossed transmit and receive signals
B. A passive cable connecting the Pi UART pins directly to the RS-232 connector
C. An I2C level converter with clock connected to transmit and data connected to receive
D. A 5 V pull-up on both UART lines with transmit and receive connected in parallel

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 output with an initial low state and perform cleanup in finally
D. Configure the pin as an input first and connect the LED without a resistor

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. Debounce the button, update once per stable press, and clamp duty cycle to
B. Increase PWM frequency, process every detected edge, and allow duty cycle above
C. Disable the input pull resistor, count both edges, and reset PWM after every callback
D. Replace duty-cycle control with GPIO numbering changes and retain all button callbacks

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