Connect RPI3 B+ to drive 24V Relay that Drives AC Resitive load

Thread Starter


Joined Jan 7, 2022

Question: How do I drive a 1A/24V relay which switches an AC resistive load ?
Attached: My block diagram with detailed pns of componentsblk digram0.JPG Flow/Notes/Issues/:
1)I cannot change the 24V EM relay pn, it is fixed, everything else is flexible.

Design Flow=
The '244 buffer boosts the RPi GPIO current and voltage aprox 3.0V.
The opto isolator module is used to isolate the AC load switching from the DC RPI control.
The 24V voltage doubler is required to generate the 24V required for the fixed relay
The N channel MOSFET (IRLB8721Pbf) is used as a switch, so when RPI GPIO goes high, the 24V/AA is switched onto the 24V relay

Circuit does not seem to be working.
2)Is the block diagram correct ?
3)If not, then how can I easily switch on 24V/1A to the relay ? What is a better design?
4)If the 24V relay is connected to the mosfet at the drain will the 24V from voltage doubler always be on or will it actually switch on/off depending on GPIO high/lo?

-The MOSFET datasheet has Fig 3 which shows at Vgs =2.5V, Ids = 1A of current. So I expected the mosfet to turn on at 2.5V.
Vgs is also specd at +/- 20V.

My expectation for mosfet to turn on at 2.5V may be an incorrect assumption.

thanks for your advice


Joined May 7, 2016
Please could you post a picture of how you've wired this? It looks like there's no way for the optocoupler to output 3V, but I may be missing something.

By "244 buffer", do you mean a 74HC244 kind of thing? And if so do you have the output enable pin correctly connected (pulled down I assume in this case)? You don't really need this part to be honest, the optocoupler board you have has a 220 ohm resistor in series with the input, so max 15 mA at 3.3V, so always inside RPI current capacity.

To answer your question 4, the 24V will always be on, but both sides of the relay will be at 24V until the mosfet turns on and pulls one side to 0V, allowing current to flow.

panic mode

Joined Oct 10, 2011
why is only relay the "fixed" part of the design? you can drive heater using SSR with 3V 10mA input and all the 12V/24V/Mosfet circuitry falls away... show your circuit, not block diagram.


Joined Feb 20, 2016
And, why have a buffer, opto, FET then relay?
The Pi can drive the FET used to switch the relay as long as you use a logic level FET, and that one looks to be ok.