2
\$\begingroup\$

I'm new to EE so my theory isn't that strong. I want to trigger a srd-05vdc-sl-c 5v relay with my Arduino using a PN2222 transistor and a flyback diode. I plan on using the schematic below:

schematic

simulate this circuit – Schematic created using CircuitLab

Now my question is: If I'm powering the Arduino via USB, will the current draw be too much for the Arduino's Vcc pin, thus requiring external power? I believe I'm reading that the relay will draw ~90mA and the Vcc pin from the Arduino can handle up to 200mA total. However, the transistor drives how much current is actually drawn, correct? Which is a function of the digtal pin voltage, R1 and the Hfe rating of the transistor? So if you were to mess that up, the current flowing to the relay would be incorrect and would not trigger it?

Thanks!

\$\endgroup\$
  • 1
    \$\begingroup\$ The transistor is just a switch here, The relay will dictate most the current, but you need to add in the base current, which is about 4.3mA with 1k R1. NOt sure if Arduino can source that much though. \$\endgroup\$ – Trevor_G Feb 19 '18 at 22:23
  • 1
    \$\begingroup\$ And your 5V supply is upside down. \$\endgroup\$ – Trevor_G Feb 19 '18 at 22:24
  • \$\begingroup\$ If you search for the cheap quad 5V relay cards for Arduino you can study the design. \$\endgroup\$ – Sunnyskyguy EE75 Feb 19 '18 at 22:37
  • \$\begingroup\$ Thanks, guys. Also, I will have to check out that design. \$\endgroup\$ – Brock Feb 19 '18 at 23:57
2
\$\begingroup\$

You want the transistor saturated to turn on the relay. That way, the voltage drop across it is minimal.

The digital output apparently goes to 5 V when high. Figure about 700 mV drop B-E for the transistor, so that leaves 4.3 V across R1. That means the current into the base of the transistor is 4.3 mA.

You say the relay draws 90 mA with 5 V applied. That means the transistor must have a gain of at least (90 mA)/(4.3 mA) = 21. That should be easily doable for a small signal transistor like this at this current. However, you need to check this with the datasheet, if for no other reason than to learn to do it.

Given all the above, this circuit should work fine, assuming the digital output can source 4.3 mA at 5 V. Some can, some can't. You definitely need to check this in its datasheet.

1N4004 is inappropriate for a flyback catch diode, but will work here as long as you don't try to turn the relay on within a few 10s of µs of having turned it off. It should therefore be fine in normal operation, but PWM drive is out. 1N4004 is a power rectifier meant to work at normal power line frequencies.

\$\endgroup\$
  • \$\begingroup\$ Thank you for the detailed comment! I appreciate you walking me through the theory. \$\endgroup\$ – Brock Feb 19 '18 at 23:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.