0

I have discovered that there are relays like these available on the market that trigger at 3.75 V and have coil resistance above 370 ohm. I assume this would mean about 14 mA or about that might be within allowed limits of Raspberry PI.

How good is the idea to drive these relays directly from GPIO, without the amplifying transistor?

There are few similar questions of the site but I think they do not address this group of relays. If not, I would build a circuit as described here but I need a quick and very reliable solution, so less components may help.

h22
  • 881
  • 6
  • 14
  • That all looks a bit risky. [This page](http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/raspberry-pi/gpio-pin-electrical-specifications) suggests that low may be as high as 0.6 V and high as low as 2.4 V. They don't specify what current those values are for so it could be worse at 14 mA. Pay particular attention to the section "Pi GPIO input voltage and output current limitations". The total current is limited to 50 mA. – Transistor Dec 31 '19 at 23:09
  • 2
    No. This is a very bad idea and it's silly to try to save the few cents of on a transistor. Also you definitely do not want to run a relay off the pi's very sensitive 3v3 rail. – Chris Stratton Dec 31 '19 at 23:19
  • Reliable, low cost: High drives relay: Jellybean NPN. 1k to 10k resistor say from I/O pin to base. Ground emitter. Relay collector to V+. Diode (eg 1N4148) across relay coil non conducting when relay on (Cathode to V+). || Low drives relay - use PNP. swap V+ and Ground connections to transistor. – Russell McMahon Jan 01 '20 at 19:41

2 Answers2

3

The "3.75V" types are designed for 5V nominal so forget those. They need about 4V to operate reliably and the RPi will give less than 3.3V.

The 3V nominal types have a 137 ohm coil and will draw about 20-24mA from a 3.3V supply. That's too much to drive safely from the Raspberry Pi GPIO output. You could use a CMOS buffer but it would make a lot more sense to use a small MOSFET or BJT.

Note: You could parallel two outputs configured to maximum (16mA) drive and it would probably be okay if you can ensure that the outputs are always in exactly the same state. Not a chance I would like to take. The relay would get about 2.8V minimum and they need 2.6 so they'd be okay.

Spehro Pefhany
  • 376,485
  • 21
  • 320
  • 842
  • I estimate 10mW dissipation driving 137 Ohms tied to 3.3V .WHy do you consider that unsafe? even the datasheet says safe to drive from CMOS logic direct – Tony Stewart EE75 Jan 01 '20 at 00:33
  • 2
    A Pi is NOT CMOS logic in this sense, and anyway the Pi (or rather the briadcom chip in it) datasheet is the only final authority. The parts you show state a guranteed drive current of 18 mA at 2.9V. Is that enough for the relay? – Wouter van Ooijen Jan 01 '20 at 01:26
  • @TonyStewartSunnyskyguyEE75 There are failure modes related to excessive current density in the metal conductors on the chip. Accentuated at at high temperatures, and that chip runs hot. Not immediate failure but over time. – Spehro Pefhany Jan 01 '20 at 04:02
  • @WoutervanOoijen The Zol proves they belong in the same CMOS family as all other 3.6V logic for the GPIO drivers – Tony Stewart EE75 Jan 01 '20 at 05:22
  • 1
    Who is The Zol and how can she know that Broadcom manufactures (and will continue to manufacture!) something that is not required by the datasheet they (Broadcom) publish? – Wouter van Ooijen Jan 01 '20 at 09:00
  • @WoutervanOoijen Why are all 18V CMOS made the same for Zol? ditto 5.5V and 3.6V CMOS design. Zol is the same as RdsOn for NCh and Zoh for Pch These are directly related to DC power. These specs are same, more or less as Arduino , which has a max drive current per "3.3V pin" = 50 mA. Why would expect the CMOS characteristics and wirebonding of Broadcom (nee Avago/Agilent/HP, ) to be any different. It is a limit due to Vdd/Vt tolerances to avoid cross-conduction (linear current at Vdd/2) that limits Zol,Zoh. minimum so never specified yet inherent to all CMOS. – Tony Stewart EE75 Jan 01 '20 at 19:35
  • Although I have not read, I am sure you find these design rules for any CMOS Foundry. – Tony Stewart EE75 Jan 01 '20 at 19:45
1

1) You chose the 5V Relay and not the correct 3V Relay. It should be 137 Ω and thus on low side drive + 22 Ω = 159 Ω so 3.3V/159Ω= 21 mA and Pd =21mA*3.3V = 68 mW of which 22/159Ω 14% is dissipated by the CPU GPIO port. The minimum voltage Umin = 2.25V, Umax= 8.8V so safe.

These Relays are designed for 3V, 5V CMOS logic "Directly triggerable with TTL standard modules such as 74ALS, 74HCT and 74ACT" (from spec) so which part are you concerned about?

Raspberry Pi uses the same CMOS as all other 3.6V logic such as those below; Which can easily drive the 3V Relay with a reverse flyback small diode to Vdd.

enter image description here

Although not widely documented , CMOS is made from FETs with RdsOn that depends on Vdd max to prevent excessive cross-conduction current during switching. It also increases max transition frequency due to fix load C and T=RC rise times. It also reduces static power dissipation with \$P_D=I^2R_{dsOn}\$ as higher current drivers. Normally the current limits are given to allow noise-free safe voltage margins for CMOS input threshold variations.

All 5.5V Logic families are designed around 50 to 66Ω nominal for Zol= Vol/Iol while Zoh is often the same but may be higher in some families and both have a worst case tolerance of 50% over temp.

Of course as in all CMOS & FETs when operated at lower voltage RdsOn will rise.

All 3.6 V Logic Families are designed around 22 to 33Ω nominal for Zol and Zoh may be the same or slightly higher for natural characteristics of same size PFETs.

Raspberry Pi's specs are below as you see are also consistent.

enter image description here

Tony Stewart EE75
  • 1
  • 3
  • 54
  • 182
  • "Directly triggerable with TTL standard modules such as ALS, HCT and ACT" but what is the Raspberry PI GPIO pin? – h22 Dec 31 '19 at 23:33
  • rPi is 3.6V logic which can drive more current than 5.5V logic – Tony Stewart EE75 Jan 01 '20 at 00:39
  • 1
    The incomplete datasheets for RPi were always source of frustration re GPIO limits, and Broadcom datasheets are under NDA, which is even worse. The common consensus within RPi users is 16mA per pin and 50mA total per 3.3V rail. This is definitely insufficient to drive 24mA relay safely. – Maple Jan 01 '20 at 02:29
  • @Maple the relays must activate with 16mA and they are designed for 5V logic which has twice the Zol. Try again. – Tony Stewart EE75 Jan 01 '20 at 05:47
  • The 5V relays wont activate from RPi GPIO, as you said yourself. The 3V relays should activate at 2.25V, drawing 16.4mA and dropping output voltage to about 2.3V. This already is over the maximum the pins can be configured for (see comment "c" at the bottom of the chart). Even if this works, it is not something I'd advise people to do. – Maple Jan 01 '20 at 08:08
  • @Maple How do you think they rate drive strength? fusing limit?, heat rise ? or ... input voltage threshold for CMOS noise power margin? So why does 16mA drive strength and 0.4V threshold not matter? Because you're not driving a CMOS gate with voltage margin. You're driving a relay current with adequate margin and not exceeding the 50mA thermal margin limit on the device. – Tony Stewart EE75 Jan 01 '20 at 12:11
  • 1
    It may fully be this may work, I eventually decided to put a transistor for piece or mind. – h22 Jan 02 '20 at 21:24
  • no problem.. but you can also drive LED's with 20mA for the same reason as logic margin rules dont apply. – Tony Stewart EE75 Jan 02 '20 at 21:27
  • @h22 for about the same price and in same or similar SOT package the relay driver (e.g. NUD3124) would be much better choice than BJT, eliminating the need in flyback too. – Maple Jan 03 '20 at 21:07
  • This is a good idea @Maple, I found the component. – h22 Jan 04 '20 at 15:10