relay modules?

Apr 10, 2024 Last reply: 2 years ago 12 Replies

Hi all. Two separate projects which will need a relay of some sort to run from a Pi or similar.



I'm really looking for something plug-and-go rather than build-your-own (especially item 2 below)



First is a dpdt relay to switch around 12-20 V at a couple of amps. spdt are easy to come by; the only dpdt ones I've found are on aliexpress, but their longevity is possibly open to question :-{



Second is something to switch mains safely - a full 13A to run a 3kW heater. I've drawn a blank: best I can think of is to butcher one of those wireless mains switch modules, which would at least provide a good isolation gap :-)



TIA for any ideas.


Mike,

You could take a peek at so-called "solid state relais". And as your heater is a resistive load, it should be no problem to control it with even a simple one (no zero-pass detection needed, as is needed for inductive loads).

One thing to check is what your heater pulls in the first seconds or so (up until its fully heated). That current might well be more than the 13A that it draws after those first few seconds.

The last thing to check is (ofcourse) the voltage those solid-state relays "switch on" on. The Pi's 3.3 volt is on the low end, so you will likely need something to connect it to a higher voltage. A simple open-collector transistor should work though.

Regards, Rudy Wieser

Try CPC (cpc.farnell.com), but you will probably need some sort of 'driver' between the Pi digital output and the relay coil. Alternatively, as suggested here, a solid state switch or even an opto isolator.

Again CPC will probably have something, but again you'll need something between the Pi and the 'whatever'.

Are there not ready made relay modules for the Pi?

Are you looking for a module to integrate into your own project, or something with an enclosure (ie a thing with a case and a handy USB cable or whatever?)

Relay boards for the Pi, either by GPIO or USB, are common. Look on ebay or the usual Pi retailers (PiHut, Pimoroni, Adafruit, etc). For DPDT look for 'reverse polarity switch'.

If you want something packaged then that's a bit harder, especially if you want an enclosure with mains inside. Those wireless switch modules are nice in that they provide all the isolation for you - just RF goes in.

Another option is a 'fire alarm relay' which come in a nice thing to fit a wall mounted mains backbox. Often the coil voltage is 12V or 24V though, and maybe only 5A switching current.

If you want to switch 3kW, I would look at either a solid-state relay (I would recommend a known brand like Crydom, since the Chinese ones often lie about current capacity) or a contactor. A DIN rail enclosure plus a DIN mount contactor solves the isolation problems.

Theo

I used a solid state relay to control an oven some years back - the Pi's 3.3v output was good enough to fire the relay although it's LED was rather dim.

The oven was only 2.2Kw though, but I used a relay rated for something like 40 amps (that's probably chinese amps, but it never failed in the

5 or so years I used it near daily when I was running my small bakery)

For a 3Kw project (Atmega, not a Pi) I used one of the SparkFun "Beefcake" relays. I think it did need a 5v signal though. You'll need a driver transitor from a Pi.

formatting link
I built that into a control system in a micro-brewery 'washing machine' about 5 or 6 years back and its still running today.

Gordon

I built my own, and have spare PCBS. It has buffers to drive the relays , led drivers and a built in mains power supply to run the pi as well.

Only switches 10A at 230V though. However a purely resistive load like a

3KW heater might well be OK

You can use *two* relays to do DPDT. :-)

Serious European made relays cost quite a bit.

Nearly all electronics these days comes ultimately from china.

Looking through my 'usual suspects' supply list it seems that solid state relays have overtaken big power contactors for switching high mains current.

What I would try to do is get a board with four low power relays on it, and use one to drive a big f*ck off panel mounted *solid state relay*. Two more do DPDT.

Won't be cheap though...

a bank of 4 SPST relays will do the job if you wire them thoughtfully. e.g.

formatting link

I use one of these to control my 3kW immersion heater to soak up excess solar power.

formatting link
They're reasonably easy to reprogram to run from your own wifi. e.g.
formatting link

There are, but most are lower power and SPDT.

Which is why I built my own...

BUT although it would be a fun project, even getting hold of big solid state relays is difficult.

I've got lots of the wireless mains plug/sockets. I felt that my competence level demanded a good isolation gap ;-).

Generally they have been good. A couple of caveats:

1) Try to get ones with Tasmota pre-installed (Some are flashable, but this can be difficult). i.e. This gives you control purely in your own LAN. You don't want to rely on some cloud service in China.

2) I have seen comments about them breaking at high wattage. I have used one on a 2.4 kW fan heater. It worked fine, but that was for short periods, not all day, every day.

Good find - the relay is available separately at a sane price.

I might try and source some

formatting link
Looking to make up some boards with mains relays on and PI Pico Ws and a mains PSU to go into the backbox of a UK mains socket to act as smart sockets...

That says a lot more than any ali-express recommendation.

:

I've used (an earlier model of) these

formatting link
for that purpose (though I've only been switching a few tens of watts, I

*think* these are 3kW rated)

John

Thanks all for comments.

The above looks very interesting, and I'd not seen the like before. I guess it could be persuaded to work with a pico instead.

For the dpdt low voltage stuff, I've opted for the ali-ex offering; if it blows up, at least it'll not take me with it :-}

Again, thanks to all.

They're pretty readily available through (for instance) Amazon:

formatting link
Make sure you get one that uses DC input to switch an AC output. I have one switching the 600W bed heater in a 3D printer. It's controlled by the 12V bed-heater output on the printer motherboard, but this one should be directly controllable by a Raspberry Pi GPIO pin. If that proves to not quite be the case, a transistor and resistor would let you switch the SSR with 5V instead of 3.3V.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required