GPIO pull down resistor

I’m using GPIO pin 13 as input and I connect a button between pin 13 and 3.3V. What I want is that every time I press the button, I can read value 1 and when I release the button I can read value 0.
It seems that pin 13 has a internal pull_down resistor according to this topic:

Theoretically, a pull down resistor will set the default value to LOW, but the value stays at HIGH when release the button. Why?
As the internal resistor didn’t work, I use a 100 ohm resistor between pin 13 and GND as pull-down. It worked well using function add_event_detect() with no bouncetime paramater. When I set a bouncetime(no matter what value), the program only works for serval times and after that it gets stuck, and needs ctrl+C twice to interrupet.
It is very magic. What should I do to solve this problem? Thanks.

could you please share your environment setups, which JetPack release version you’re working with.
may I also know the kernel messages which report this failures,

I’m using JetPack 4.4 which is released on 2020/07/07 and Jetson.GPIO 2.0.8
When interrupeted, the program output like this:
Starting demo now! Press CTRL+C to exit

Value read from pin 13 : HIGH

Value read from pin 13 : LOW

Value read from pin 13 : LOW

^C^CTraceback (most recent call last):

File “”, line 28, in main

while input() != "exit":


During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “”, line 34, in


File “”, line 31, in main


File “/usr/lib/python3/dist-packages/Jetson/GPIO/”, line 396, in cleanup


File “/usr/lib/python3/dist-packages/Jetson/GPIO/”, line 293, in _cleanup_all


File “/usr/lib/python3/dist-packages/Jetson/GPIO/”, line 283, in _cleanup_one


File “/usr/lib/python3/dist-packages/Jetson/GPIO/”, line 369, in event_cleanup


File “/usr/lib/python3/dist-packages/Jetson/GPIO/”, line 136, in remove_edge_detect



And this is my program:
import RPi.GPIO as GPIO

import time

Pin Definitions

input_pin = 13

output_pin = 12

def fun(x):

value = GPIO.input(input_pin)

if value == GPIO.HIGH:

    value_str = "HIGH"


    value_str = "LOW"

GPIO.output(output_pin, value)

print("Value read from pin {} : {}".format(input_pin,


def main():

prev_value = None

# Pin Setup:


GPIO.setup(input_pin, GPIO.IN)  # set pin as an input pin

GPIO.setup(output_pin, GPIO.OUT)

GPIO.add_event_detect(input_pin, GPIO.BOTH, callback=fun, bouncetime=20)

print("Starting demo now! Press CTRL+C to exit")


    while input() != "exit":




if name == ‘main’:



When the program gets stuck, I tried to read pin value directly using “cat /sys/class/gpio/gpio14/value”. It worked well and can read the value correctly when I press or release the button.

hello 806615569,

it might related to pd strength not enough, please refer to Topic 115752 for the reference,