2

I want to be able to activate three 5 V relays using one Arduino Uno. I'm afraid the Uno won't be able to supply enough current (or voltage?) to activate the relays, so I will need an external supply. I still want to use the digital pins on the Uno for control, so using transistors might be appropriate. However, I am unsure how to design the circuit. Would something like this work?

schematic

simulate this circuit – Schematic created using CircuitLab

where D1, D2 and D3 are the Uno's digital pins (either HIGH or LOW). I have designed very few transistor circuits before. Do I need any resistors in series with the MOSFETs? If so, how can I calculate the values? Should I use MOSFETs or BJTs for this purpose?

Carl
  • 3,646
  • 1
  • 14
  • 33
  • 1
    Please change from high side MOSFETs to low side and add a diode in anti-parallel across each relay coil to make your life simpler. – winny Apr 03 '23 at 12:48
  • how much current is needed by each relay? – user253751 Apr 03 '23 at 12:54
  • provided the current is okay, You can look up how to control a relay with an Arduino and just make 3 copies of that circuit. It is not quite the same as what you've drawn here. – user253751 Apr 03 '23 at 12:55

1 Answers1

3

Your approach won't work well, because MOSFETs are driven relative to their source. Since the source needs to be at 5 V to turn-on the relays, the gate would need to be at a higher potential of about 10 V. UNO's outputs don't go that high :)

Instead, use those N-MOSFETs as low-side switches:

schematic

simulate this circuit – Schematic created using CircuitLab

Each MOSFET needs an anti-kickback diode directly between the coil terminals:

schematic

simulate this circuit

  • Thank you very much for this good answer. Just to be sure, the Uno and the external supply has to have same ground, right? Also, could you clarify why a 1uF capacitor is needed in parallel with the relay and MOSFET? – Carl Apr 03 '23 at 13:00
  • 1
    @Carl Yes, the UNO and 5V coil supply grounds need to be connected. The coil voltage can also be higher than 5V - that will make the coil currents smaller. E.g. if you have 12V available and 12V relays, then the circuit doesn't change at all. – Kuba hasn't forgotten Monica Apr 03 '23 at 13:07
  • @Kubahasn'tforgottenMonica could you comment about the pros/cons of this vs BJT version eg https://electronics.stackexchange.com/a/386124 – jonathanjo Apr 03 '23 at 13:10
  • 1
    @Kubahasn'tforgottenMonica Why would he coil currents be smaller for a 12V relay than a 5V relay? Does this have something to do with the coil resistance of the different relays? – Carl Apr 03 '23 at 13:25
  • 1
    @Carl Yes. Usually a given size of a relay has a fixed power rating of the coil. So the higher the coil voltage rating, the higher the coil resistance, and the lower the coil current. – Kuba hasn't forgotten Monica Apr 03 '23 at 17:24
  • 2
    @jonathanjo One less thing to worry about with an NMOS - no need to put base resistors or buy transistors with base resistors. – Kuba hasn't forgotten Monica Apr 03 '23 at 17:25
  • Other than the base resistors, are there pros/cons or would you say they are pretty much equivalent for this type of circuit? – jonathanjo Apr 03 '23 at 18:09