-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

  • 1
    Does this answer your question? [Can you use a 5V Relay Module with the Pi?](https://raspberrypi.stackexchange.com/questions/118116/can-you-use-a-5v-relay-module-with-the-pi) – Milliways Oct 18 '21 at 11:32
  • Does this answer your question? [4 relay board weird behavior](https://raspberrypi.stackexchange.com/questions/92299/4-relay-board-weird-behavior) – Dmitry Grigoryev Oct 18 '21 at 15:33

2 Answers2

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.

joan
  • 67,803
  • 5
  • 67
  • 102
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

Milliways
  • 54,718
  • 26
  • 92
  • 182
  • 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](https://www.electronicshub.org/control-a-relay-using-raspberry-pi/) – bruhboi123345123 Oct 18 '21 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 '21 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 '21 at 21:46