apt update refreshes the package index, while apt full-upgrade installs upgrades and handles dependency changes.
Incorrect! Try again.
24A 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
Correct Answer: Configure Wi-Fi and SSH in Imager before writing
Explanation:
Raspberry Pi Imager customization can preconfigure Wi-Fi, credentials, hostname, and SSH for headless startup.
Incorrect! Try again.
25RealVNC 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
Correct Answer: Whether the VNC server is enabled on the Pi
Explanation:
RealVNC Viewer cannot connect unless a compatible VNC server is installed, running, and enabled on the Raspberry Pi.
Incorrect! Try again.
26After 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
Correct Answer: The Raspberry Pi hostname or IP address
Explanation:
A VNC client locates the Raspberry Pi through its network hostname or IP address and then requests authentication.
Incorrect! Try again.
27An 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
Correct Answer: Change GPIO.BOARD to GPIO.BCM
Explanation:
With BCM numbering, the value 18 refers to GPIO18. In BOARD mode, the value 18 refers to physical header pin 18.
Incorrect! Try again.
28A 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
Correct Answer: Place GPIO.cleanup() in a finally block
Explanation:
A finally block runs when normal execution ends or an exception occurs, allowing GPIO resources to be reset.
Incorrect! Try again.
29A 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
Correct Answer: HIGH when released and LOW when pressed
Explanation:
The pull-up holds the input HIGH while the switch is open. Pressing the switch connects the input to ground, producing LOW.
Incorrect! Try again.
30One 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
Correct Answer: Add hardware or software switch debouncing
Explanation:
Mechanical contacts briefly open and close several times during a transition. Debouncing filters these unwanted changes.
Incorrect! Try again.
31Which 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
Correct Answer: Running Linux, networking, and a graphical interface
Explanation:
A Raspberry Pi is a single-board computer suited to multitasking, networking, file systems, and graphical applications.
Incorrect! Try again.
32A 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
Correct Answer: Perform an operating-system shutdown before removing power
Explanation:
A proper shutdown completes pending writes and unmounts file systems, reducing the risk of microSD card corruption.
Incorrect! Try again.
33A 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
Correct Answer: GPIO2 for SDA and GPIO3 for SCL
Explanation:
The standard I2C interface uses GPIO2 as SDA and GPIO3 as SCL, located at physical pins 3 and 5.
Incorrect! Try again.
34A 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
Correct Answer: GPIO14 TX to module RX and GPIO15 RX to module TX
Explanation:
UART transmit and receive lines are cross-connected: the Pi's TX goes to the module's RX, and the Pi's RX goes to the module's TX.
Incorrect! Try again.
35An 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.
Correct Answer:
Explanation:
The minimum resistance is . A standard resistor keeps the current below while allowing good visibility.
Incorrect! Try again.
36An 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
Correct Answer: Set HIGH, delay, set LOW, delay
Explanation:
Setting the output HIGH lights the LED, and setting it LOW turns the LED off. Equal delays create an approximately 50% blink duty cycle.
Incorrect! Try again.
37A 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.
Correct Answer:
Explanation:
The period is . The HIGH time is .
Incorrect! Try again.
38A 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 –
Correct Answer: Debounce the press and clamp duty cycle to –
Explanation:
Debouncing prevents one press from being counted repeatedly, while clamping keeps the PWM duty cycle within its valid range.
Incorrect! Try again.
39A 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
Correct Answer: A suitable level shifter or voltage divider
Explanation:
Raspberry Pi GPIO uses 3.3 V logic and is not 5 V tolerant. Level conversion keeps the input voltage within a safe range.
Incorrect! Try again.
40Two 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
Correct Answer: A series resistor between the two GPIO pins
Explanation:
A series resistor limits current if one output drives HIGH while the other drives LOW, helping protect the GPIO output drivers.
Incorrect! Try again.
41A 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
Correct Answer: The Linux x86-64 package, because Imager runs on the laboratory computer
Explanation:
Raspberry Pi Imager executes on the host computer, so its package must match the host OS and CPU architecture. The selected OS image must match the target Raspberry Pi.
Incorrect! Try again.
42An 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
Correct Answer: Download official files, verify published hashes, transfer them, and select the local image
Explanation:
The installer and OS image should come from official sources and be checked using published hashes or signatures. Imager can then write the verified local image without Internet access.
Incorrect! Try again.
43A 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
Correct Answer: Run sudo apt update, then sudo apt full-upgrade, and reboot if required
Explanation:
apt update refreshes repository metadata, while apt full-upgrade may add or remove packages to resolve changed dependencies. rpi-update is not the routine OS update mechanism.
Incorrect! Try again.
44A 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
Correct Answer: Regenerate machine identifiers and SSH host keys uniquely on every cloned system
Explanation:
Cloning can duplicate /etc/machine-id and SSH host keys. Each deployed system needs unique identity data, along with a unique hostname or network configuration where applicable.
Incorrect! Try again.
45A 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
Correct Answer: Install and enable RealVNC Server on the Pi, then connect using Viewer
Explanation:
The Raspberry Pi must run and expose the VNC server service. RealVNC Viewer is the client used on the controlling computer to initiate the connection.
Incorrect! Try again.
46RealVNC 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
Correct Answer: Use a trusted VPN or RealVNC cloud connection without directly exposing port 5900
Explanation:
A VPN or authenticated cloud-mediated connection avoids directly publishing the VNC service. Exposing port 5900 broadly increases attack surface and should not require weakened encryption.
Incorrect! Try again.
47A 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
Correct Answer: Physical pin 23, corresponding to BCM GPIO11
Explanation:
BCM mode interprets 11 as GPIO11 rather than physical pin 11. On the 40-pin header, GPIO11 is physical pin 23 and is also commonly used as SPI clock.
Incorrect! Try again.
48SPI 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
Correct Answer: Use another GPIO or disable the SPI function before taking control of GPIO10
Explanation:
A pin cannot reliably serve an active SPI peripheral and an unrelated GPIO output simultaneously. Pin numbering modes do not change hardware multiplexing or kernel ownership.
Incorrect! Try again.
49A 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
Correct Answer: The press is active-low; apply hardware or software debouncing to the transition
Explanation:
The released input reads high through the pull-up, while a press pulls it low. Mechanical contact bounce can create multiple edges and must be filtered or debounced.
Incorrect! Try again.
50A 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
Correct Answer: Place a suitable series resistor, such as , in the switch path
Explanation:
Without series resistance, pressing the switch while the pin drives high creates a near-short to ground. A series resistor limits the resulting current while preserving valid input levels.
Incorrect! Try again.
51A 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
Correct Answer: Use hardware-timed peripherals or a dedicated microcontroller for the critical loop
Explanation:
General-purpose Linux scheduling can introduce unpredictable latency. Hardware timers, DMA-based mechanisms, or a microcontroller are more suitable for strict real-time timing.
Incorrect! Try again.
52A 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
Correct Answer: Provide controlled shutdown or use a read-only and power-loss-tolerant storage design
Explanation:
Power loss during pending filesystem writes can corrupt SD-card data. Graceful shutdown, read-only filesystems, overlays, or suitable power-fail hardware reduces this risk.
Incorrect! Try again.
53A 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
Correct Answer: Those pins are GPIO0 and GPIO1, commonly reserved for the HAT ID EEPROM bus
Explanation:
Physical pins 27 and 28 are ID_SD and ID_SC, associated with GPIO0 and GPIO1. They are intended for reading a compliant HAT's identification EEPROM.
Incorrect! Try again.
54A 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
Correct Answer: A 3.3 V UART-to-RS-232 level shifter with crossed transmit and receive signals
Explanation:
The Pi exposes 3.3 V TTL UART signals, while RS-232 uses different, often negative, voltage levels and inverted signaling. A proper transceiver is required, with TX connected to RX and a shared reference.
Incorrect! Try again.
55An 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.
Correct Answer:
Explanation:
The minimum resistance is . The next common value, , keeps the current at approximately .
Incorrect! Try again.
56An 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
Correct Answer: Configure the output with an initial low state and perform cleanup in finally
Explanation:
Setting a defined initial output reduces startup glitches. A try/finally structure ensures cleanup or an explicit safe state even when an exception interrupts the blinking loop.
Incorrect! Try again.
57An 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.
Correct Answer:
Explanation:
For ideal PWM, . Perceived brightness may not vary linearly with this electrical average.
Incorrect! Try again.
58Each 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
Correct Answer: Debounce the button, update once per stable press, and clamp duty cycle to –
Explanation:
Mechanical bounce produces several transitions during one press. Debouncing and recognizing one stable press prevents repeated updates, while clamping keeps the PWM value within its valid range.
Incorrect! Try again.
59A 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
Correct Answer: from sensor to GPIO and from GPIO to ground
Explanation:
The divider gives . Directly applying a 5 V push-pull signal can damage a non-5-V-tolerant Raspberry Pi GPIO.
Incorrect! Try again.
60A 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
Correct Answer: Use a transistor driver, a coil flyback diode, and a common ground reference
Explanation:
A transistor supplies the coil current without overloading the GPIO. The flyback diode suppresses the inductive voltage spike when current is switched off, and a common ground establishes the control reference.
Incorrect! Try again.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill.
The rest comes out of a student's own pocket: the domain, the storage,
and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it.
What it pays for →