How to connect an arduino to a 5V 20AMP relay

Hi, I need a more powerfull relay that the usual ones of 10AMP that come with an arduino module. So I bought the 5V 5pin version of this:

But I was wondering how to connect it. Because all the tutorials are about how to make a module for a 10AMP relay. But no one is saying anything about this ones.

Any help would be really appreciated.

I saw this tutorial that come really close to what I need:

https://maker.pro/arduino/projects/diy-relay-module

But, again, they are about the 10AMP version of the relay.

Regarding the link, I already have the diode, the resistance and the 2N2222 transistor.

But my question is: what size the resistor should be for the 20AMP relay?

(There's another link where they use a 2.2K resistor for a TIP120, but in the link I just wrote they use a 1K for a 2N2222. And, for what I saw in the relay specifications it's very similar to the TIP120. So... I don't know what to do.)

Thanks.

Ariel

The load current is immaterial. What matters is the switching current, i.e. the current drawn on the Arduino pin, which is probably 20ma max, and depends on the total load. around the rest of the board

I understand you are already using a 2N2222, so you just need to check it will handle the coil current of the new relay. I guess it probably will.

You should have bought the 30Amp relay module.

1 Like

Hi Ariel,
please, let me guide you with questions and thoughts.

What is a relay?:
a device with an electro-magnetic, acting on a mechanical switch (to connect a circuit).
The coil, the electro-magnet can be a called "primary", the stuff at or after the switch as "secondary" unit.
The "secondary" does not matter here (it is decoupled from the primary), but the "primary", here the coil (and electro-magnet) is the important thing to think about.

Raising questions:

  • you want to drive the relay from an MCU pin - fine.
    But what is the high level voltage (pin is set to "1" or "high" so that relay can switch)?
    is is 3V3 or 5V (BTW: you want to use a 5V relay - is it OK for a 3V3 pin?)
  • what is the resistance of the relay (coil)?
    how much current will it drawn (e.g. on 5V voltage over it)?

When I open and look at the datasheet - I get:

  • with 5V on the "primary" relay supply - it draws 119mA !!!
  • I think - and check:
    your MCU can NEVER drive 119 mA out - so, your MCU is too weak

You need a "driver":
As simple it is just a transistor, which acts also like a switch, but with much less current (e.g. 1 mA) and it will "translate" to feed 119 mA for the relay.
It can even translate the 3V3 voltage (provided by the MCU pin) to 5V (needed by the relay).

It means:

  • you have to "interface" the MCU to such a relay
  • check the parameters of both, esp. if MCU can "drive" such a device
  • if not: you need a level translator (for different voltage) and a driver (for higher current drawn by the relay)

BTW:
If you connect an "inductive load" to anything, a MCU pin, a transistor - you need a protection diode (protect the driver for "negative" voltages possible to get/see).

A series resistor (your 2.2K) is there just to limit the current: but if your relay wants to see 119 mA (with 5V, maybe 80 mA with 3V3 volt - but would 3V3 volt enough to let is switch?), such a "current limiter" will not solve your problem: you need much more current as MCU pin can provide, let's assume 20 mA - why to limit even more when 80 mA are needed?).
You need a relay driver (an external transistor driving the "primary" part of the relay).

Avoid tutorials that post Fritzing diagrams, rather than a schematic.

The relay coil draws about 120 mA at 5V. So you need about 12 mA base current to ensure NPN transistor saturation. A 330 Ohm base resistor/2N2222 would be OK for a 5V Arduino.

Do not power the relay from the 5V Arduino output.

1 Like

I agree! He needs a transistor as "driver".
But: 12 mA as base current on a transistor is not necessary. But it will work (with a transistor),
the BE-junction will limit anyway the current, even the series transistor on base is way too strong.

YES: do NOT drive a 5V relay with 119 mA taken from an MCU pin (directly).

Yeah, thank you. I didn't now that they existed. I just bought them.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.