How to use Sparkfun Beefcake relay from Raspberry Pi

I would like to use a Sparkfun Beefcake for mains switching. I have seen conflicting reports that say I could connect the +5 on the Beefcake to the +5 on the PI, and Gnd to Gnd. And that I could use one of the 3.3v GPIO pins on the PI to switch the signal on the Beefcake.

Some links talk about needing to switch using an additional transisitor.

I would be grateful for your guidance in this.


The point of the kit is that it is self-contained, I would have thought… it certainly already includes a transistor on-board to be switched by the control pin.

That said, there may be additional requirements depending on the project - if you post the links where people have used additional external components here, I’m sure someone more knowledgeable will confirm the reason it may be necessary to do so.

My confusion is that I thought this kit was designed for an Arduino type? And aren’t the IO pins higher voltage than the Raspberry Pi? (5V vs 3.3) ?


PS happy to dig out the other discussions - they are mostly about other mains relay boards, not the beefcake

Here’s one, from the raspberry where they were using a level shifter:

and here’s one from your forum:

More later…

Yes, the raspberry GPIO pin will only output 3.3v and it’s entirely possible that wouldn’t be enough to trigger the relay. I can’t find a precise BOM for the beefcake but I’d certainly give it a try before I’d look into level shifting.

BOM ? Sorry to be so stupid


The Bill Of Material, namely in this instance you’d need to know the exact part number used in place of the BJT and refer to its datasheet to see whether 3.3 is above the gate voltage.

On the schematic it says the control requirements are:
Relay On above 2.6 volts
Relay off below .9 volts

And it says the Transistor is a 2N3904.

Then, you should be fine.

Thank you so much!