-1

I am testing my Raspberry Pi IO pin because I realize some of my IO pin is not functioning.

So I wrote this python program to test all the IO pin

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BOARD)
GPIO.setup(3,GPIO.OUT)
GPIO.setup(5,GPIO.OUT)
GPIO.setup(7,GPIO.OUT)
GPIO.setup(11,GPIO.OUT)
GPIO.setup(12,GPIO.OUT)
GPIO.setup(13,GPIO.OUT)
GPIO.setup(15,GPIO.OUT)
GPIO.setup(16,GPIO.OUT)
GPIO.setup(18,GPIO.OUT)
GPIO.setup(19,GPIO.OUT)
GPIO.setup(21,GPIO.OUT)
GPIO.setup(22,GPIO.OUT)
GPIO.setup(23,GPIO.OUT)
GPIO.setup(24,GPIO.OUT)
GPIO.setup(26,GPIO.OUT)
GPIO.setup(29,GPIO.OUT)
GPIO.setup(31,GPIO.OUT)
GPIO.setup(32,GPIO.OUT)
GPIO.setup(33,GPIO.OUT)
GPIO.setup(35,GPIO.OUT)
GPIO.setup(36,GPIO.OUT)
GPIO.setup(37,GPIO.OUT)
GPIO.setup(38,GPIO.OUT)
GPIO.setup(40,GPIO.OUT)
GPIO.setwarnings(False)

while(True):
    GPIO.setup(3,GPIO.LOW)
    GPIO.setup(5,GPIO.LOW)
    GPIO.setup(7,GPIO.LOW)
    GPIO.setup(11,GPIO.LOW)
    GPIO.setup(12,GPIO.LOW)
    GPIO.setup(13,GPIO.LOW)
    GPIO.setup(15,GPIO.LOW)
    GPIO.setup(16,GPIO.LOW)
    GPIO.setup(18,GPIO.LOW)
    GPIO.setup(19,GPIO.LOW)   
    GPIO.setup(21,GPIO.LOW)
    GPIO.setup(22,GPIO.LOW)
    GPIO.setup(23,GPIO.LOW)
    GPIO.setup(24,GPIO.LOW)
    GPIO.setup(26,GPIO.LOW)
    GPIO.setup(29,GPIO.LOW)
    GPIO.setup(31,GPIO.LOW)
    GPIO.setup(32,GPIO.LOW)
    GPIO.setup(33,GPIO.LOW)
    GPIO.setup(35,GPIO.LOW)
    GPIO.setup(36,GPIO.LOW)
    GPIO.setup(37,GPIO.LOW)
    GPIO.setup(38,GPIO.LOW)
    GPIO.setup(40,GPIO.LOW)    

    time.sleep(1)

    GPIO.setup(3,GPIO.HIGH)
    GPIO.setup(5,GPIO.HIGH)
    GPIO.setup(7,GPIO.HIGH)
    GPIO.setup(11,GPIO.HIGH)
    GPIO.setup(12,GPIO.HIGH)
    GPIO.setup(13,GPIO.HIGH)
    GPIO.setup(15,GPIO.HIGH)
    GPIO.setup(16,GPIO.HIGH)
    GPIO.setup(18,GPIO.HIGH)
    GPIO.setup(19,GPIO.HIGH)
    GPIO.setup(21,GPIO.HIGH)
    GPIO.setup(22,GPIO.HIGH)
    GPIO.setup(23,GPIO.HIGH)
    GPIO.setup(24,GPIO.HIGH)
    GPIO.setup(26,GPIO.HIGH)
    GPIO.setup(29,GPIO.HIGH)
    GPIO.setup(31,GPIO.HIGH)
    GPIO.setup(32,GPIO.HIGH)
    GPIO.setup(33,GPIO.HIGH)
    GPIO.setup(35,GPIO.HIGH)
    GPIO.setup(36,GPIO.HIGH)
    GPIO.setup(37,GPIO.HIGH)
    GPIO.setup(38,GPIO.HIGH)
    GPIO.setup(40,GPIO.HIGH)

    time.sleep(1)

Then I realize my Raspberry Pi have a lot of IO is not working, from pin 12 to pin 40 on the right column of the board and pin 11 to pin 37 on the left (ignore GND and other non IO pin). I tried to connect those IO that having issue to a relay module. If I set my relay module to trigger when IO is pulled down, my Pi able to switch it on.

However, if my relay module is set to trigger by active high signal, my IO pin is unable to trigger it.

Is my Raspberry Pi IO pull up transistor spoil? Did anyone experienced this?

1

The most likely explanation is your testing is faulty because the relay module is not suitable for the Pi (it may need more than a 3V3 GPIO to switch).

To test the GPIO try (my) GPIO test or wiringPi's pintest.

Nothing should be connected to the GPIO during either test.

  • Hi Joan, thanks for sharing your work. I had run the file you gave and it show failed user gpios as none. But the thing is, I am unable to switch on any LED with those pin. currently only working pin for light up LED is 3,5,33,35,37. – alpha91 Apr 23 at 8:51
  • Hi, can I ask is there any extra library i need to install in my Pi? i tested with another one Pi which giving the same result. I follow this link to install the GPIO library but still same. raspberrypi-spy.co.uk/2012/05/install-rpi-gpio-python-library – alpha91 Apr 24 at 1:55
  • If the GPIO pass the test that pretty much confirms the relay module is wrong for the Pi. – joan Apr 24 at 5:18
  • No. i am testing with the LEDs, it is same as well. only that few pin able to blink LEDs. Others all cant. – alpha91 Apr 24 at 5:46
  • You need to edit your question and add clear photos of the connections you have made. I can't match your comments to the question. – joan Apr 24 at 8:06
0

the problem is resolved successfully.

I had run an update on the GPIO with: pip3 install RPi.GPIO

And change the trigger command from "setup" to "output" as below:

From

GPIO.setup(16,GPIO.HIGH)

To

GPIO.output(16,GPIO.HIGH)

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.