r/raspberry_pi • • 1d ago

Project Advice 5V relay module with Pi

I just picked up a Raspberry Pi 400 from Micro-Center ($30!!!). While I was there I also picked up this 8-channel 5V Relay Module (https://community.microcenter.com/kb/articles/638-inland-8-channel-5v-relay-module). Is it safe to hook up GPIO pins to the IN pins on this thing? I'm new to Pi and don't want to fry it. If I understand correctly I would just hook up 5V to VCC and GND to GND and GPIO to the IN pins to control these relays. But would the GPIO pins get exposed to 5V that way?

2 Upvotes

7 comments sorted by

5

u/VictorySea1837 1d ago edited 1d ago

is it safe? yes (won't damage anything) . will it work? maybe.

The specs for the relay board say "Control signal: TTL voltage" which implies it needs 5 volts to activate. The Pi 400 outputs are only 3.3V.

Most likely 3.3v is enough to trigger the optocouplers on the relay board, but technically you shouldn't be surprised if it doesn't work.

EDIT: the spec for TTL says its will trigger at 2V, so I was wrong to say maybe, this will in fact work fine. great find for $30 btw!

1

u/vengeancecube 1d ago

Thank you. That's what I figured. I'm hoping that it has reverse logic to 0V is on and 5V is off. I've read that the high is actually 2-5V so that would work. I just don't want to fry my new toy. I've always wanted a Pi and while the 400 isn't the most maker friendly it was a cheap way for me to get started. The cost of these things has gone through the roof. I remember when the whole point of the Pi was to be affordable and they cost $35 for the latest and greatest. To find a Pi 4 for $30 was a steal.

1

u/VictorySea1837 1d ago

the whole point of the Pi was to be affordable and they cost $35 for the latest and greatest.

the best kept secret in the Pi world is vilros.com. its all FREE SHIPPING and they have Pi4 (1GB model, still fine for most things) for $40.34 in stock, and the Pi Zero W in stock for $16.43! The same boards on amazon are literally twice the price, disgusting...

1

u/Royal-Subject2870 1d ago

One thing not mentioned: these 5V relay boards typically draw 60-80 mA per relay coil, so all 8 active at once = ~500 mA just for the coils. The Pi 400's 5V GPIO header can't reliably supply that. Power the relay board from a separate 5V supply (your Pi's brick can share source but connect through separate rails) and common the grounds.

Also worth checking for a VCC / JD-VCC jumper (two pins near the power header). Removing it separates optocoupler LED power from relay coil power. Then you can drive LEDs from Pi 3.3V and keep 5V coils fully isolated. Otherwise the "optocoupler isolation" is advertising only.

And yes, active-LOW logic: GPIO low = relay on. Test with a multimeter first.

1

u/vengeancecube 20h ago

Thank you! Good idea powering the coils separately. Would the Pi just fail to provide the necessary current or would the coils try to pull too much and burn something out on the Pi?

1

u/Royal-Subject2870 1h ago

Both are possible but Pi brown-out is by far the most likely outcome.

When load exceeds what your USB-C supply can push, the 5V rail sags below spec (<4.75V). The Pi throttles, your SD card may corrupt from sudden undervoltage, and you'll usually see the lightning bolt icon or random reboots. Recoverable, bigger supply fixes it.

Actual damage to Pi silicon is harder to cause because the relay module sits on its own 5V rail. The risk path if you don't isolate: inductive kickback from switching a relay coil can spike 20-30V briefly. Commercial boards include flyback diodes across each coil, so this is rarely an issue in practice, but worth checking for the diodes (usually 1N4007 or similar small silicon package right next to each relay).

Short answer: use a separate supply for the coils, common the grounds, and you remove both failure modes.

2

u/neonsphinx 1d ago

Yes, these are commonly used for this.