0
0
Raspberry Piprogramming~5 mins

Pull-up and pull-down resistors in Raspberry Pi - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AGround
BPositive voltage supply
COutput pin
DBattery negative terminal
Which resistor prevents a GPIO pin from floating low?
APull-down resistor
BPull-up resistor
CSeries resistor
DNo resistor
How do you enable an internal pull-down resistor in RPi.GPIO?
AGPIO.setup(pin, GPIO.IN)
BGPIO.setup(pin, GPIO.OUT)
CGPIO.setup(pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
DGPIO.setup(pin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
What problem occurs if no pull-up or pull-down resistor is used on an input pin?
APin will short circuit
BPin will always read high
CPin may float causing unreliable readings
DPin will always read low
Which of these is a correct way to set a GPIO pin as input with pull-up resistor in Python?
AGPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_UP)
BGPIO.setup(17, GPIO.OUT)
CGPIO.setup(17, GPIO.IN)
DGPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
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.