-1

So, I got a Raspberry Pi 4 Model B, and I'm trying to make a project using relay boards. Turns out, when I turn on my Pi, one of the pins is already active and the indicator turned on partially. I took a tester and kept on the GPIO pins just to find that they were active without any script activating them. Is my Pi defected or is it a built-in feature to keep the GPIOs on?

Please let me know. Thanks!

this

2

2 Answers 2

0

This has NOTHING to do with the Pi or GPIO.

These lousy modules are unsuitable for use with the Pi (they are poor for Arduino).
They can only be turned off by putting 5V on the inputs (or by setting GPIO to INPUT)!
Using with the PI risks damage!

NOTE there are hundreds of similar Questions by others who have problems with these.

See Can you use a 5V Relay Module with the Pi?

PS the module DOES NOT indicate the state of the Pi GPIO. To reliably check see GPIOreadall

3
  • But I have followed various tutorials, and I have literally implemented the exact same replica of the tutorial. Here is one of the main ones I followed. Link Oct 18, 2021 at 12:42
  • @bruhboi123345123: In that case, you should probably consult the author of the tutorial. The sad truth in today's marketplace is this: If you buy generic Chinese products without a data sheet or tech support, you will often be disappointed.
    – Seamus
    Oct 18, 2021 at 20:12
  • The linked project DOES NOT use the same crummy modules; it uses a transistor not an opto coupler to drive the relay.
    – Milliways
    Oct 18, 2021 at 21:46
0

All the GPIO are pulled high or low at power-up. GPIO 0-8 are pulled high to 3V3 the rest low to ground.

The pulls are quite weak (about 50k). If you need a different default you need to add external pulls.

See page 102 of datasheet for the default pulls.

See pinout for the mapping of pins to GPIO.

2
  • So should I transfer my GPIO pins that are present between 0-7 to a higher number like 17, 18, 19, etc? Oct 18, 2021 at 12:43
  • That's one way of ensuring the GPIO you use are low by default.
    – joan
    Oct 18, 2021 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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