0

I use a simple python script (https://github.com/edus44/lakka-gpio-control/) for Lakka GPIO button input on a Raspberry Pi 4.

The script works perfectly: If I short wire one of the GPIO Pins to GND with a simple piece of metal, the respective output is generated. If I want to use one of those micro push buttons (https://cdn.sparkfun.com//assets/parts/9/0/00097-03-L.jpg), it does nothing even though the button works perfectly (wiring tested with multimeter) Is there anything I'm missing with resistance, wiring etc.?

[Edit] The pushbutton is directly connected to GPIO26 and ground. As the script sets GPIO.PUD_UP, this shut be it to enable input. As mentioned above, the multimeter showed correct behavior of the pushbutton wiring as well as short wiring GPIO26 and GND produced the command to shut the RPI down. my wiring

4
  • 1
    Post a photo of your wiring. – CoderMike Nov 2 '20 at 21:15
  • 2
    not connected properly ... the switch is wired like this when not pressed | | ... when pressed it is H – jsotola Nov 2 '20 at 21:34
  • 1
    The code has activated the pull up resistor, witch forces the pin to HIGH as default, and to change the state to LOW you need to ground the pin. And by that I mean that if the button doesn't work and a grounding it manually work, then it must be the button or the wiring. – MatsK Nov 2 '20 at 21:45
  • MatsK is right -- either something is not as you say/think it is, the button is faulty, or the Pi is haunted. Or (I did not look at the script), there is some de-bounce logic that isn't working properly. Testing with wire to ground will not produce contact bounce, and it is not something that will affect a multi-meter. – goldilocks Nov 5 '20 at 17:19
0

I thought, there is an internal pull up resistor that I could use but I read it wrong. Now it works following this sketch from https://www.elektronik-kompendium.de/sites/raspberry-pi/2006051.htm (it's german)

Schalter=Button Eingang=Input

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.