Recall & Review
beginner
What is a pull-up resistor?
A pull-up resistor is connected between a signal line and a positive voltage supply to ensure the line reads a high voltage (logic 1) when no other device is driving it.
Click to reveal answer
beginner
What is a pull-down resistor?
A pull-down resistor is connected between a signal line and ground to ensure the line reads a low voltage (logic 0) when no other device is driving it.
Click to reveal answer
beginner
Why do we need pull-up or pull-down resistors in Raspberry Pi GPIO inputs?
They prevent the input pin from 'floating' which can cause unpredictable readings by ensuring the pin has a default voltage level when no button or sensor is connected.
Click to reveal answer
intermediate
How can you enable an internal pull-up resistor on a Raspberry Pi GPIO pin using Python?
Using the RPi.GPIO library, you can set up a pin with pull-up like this: <br>
GPIO.setup(pin_number, GPIO.IN, pull_up_down=GPIO.PUD_UP)Click to reveal answer
beginner
What happens if you don't use pull-up or pull-down resistors on an input pin?
The input pin may 'float', causing it to randomly read high or low, leading to unreliable or noisy input signals.
Click to reveal answer
What does a pull-up resistor connect to?
✗ Incorrect
A pull-up resistor connects the signal line to a positive voltage supply to keep the input high when not driven.
Which resistor prevents a GPIO pin from floating low?
✗ Incorrect
A pull-down resistor keeps the pin at a low level, preventing it from floating high.
How do you enable an internal pull-down resistor in RPi.GPIO?
✗ Incorrect
Use GPIO.PUD_DOWN to enable the internal pull-down resistor on a GPIO pin.
What problem occurs if no pull-up or pull-down resistor is used on an input pin?
✗ Incorrect
Without pull resistors, the pin voltage can float and cause random input values.
Which of these is a correct way to set a GPIO pin as input with pull-up resistor in Python?
✗ Incorrect
This command sets GPIO pin 17 as input with an internal pull-up resistor enabled.
Explain what pull-up and pull-down resistors do and why they are important for Raspberry Pi GPIO inputs.
Think about how to keep a wire from 'floating' when nothing is connected.
You got /4 concepts.
Describe how to enable internal pull-up and pull-down resistors on Raspberry Pi GPIO pins using Python code.
Look at the parameters inside GPIO.setup for input pins.
You got /4 concepts.