5
\$\begingroup\$

I would like to ask for best solution for my issue. I need high side switch for 24VDC 6mA (it is enable signal for a device). This device I want to control by Arduino (input 5 V 20mA).

What is the best solutions for this low current?

I tried to use Sziklai pair, but PNP transistor is still open. I don't know how to calculate resistors between NPN and PNP :-(. Do I have to use a sziklai pair or is there something else?

schematic

simulate this circuit – Schematic created using CircuitLab

Thank you so much

Lukas

\$\endgroup\$
1
  • \$\begingroup\$ Normally the emitter of the NPN of the sziklai pair is connected to the load, too. (just a detail). \$\endgroup\$
    – Ariser
    Commented Nov 29, 2015 at 12:59

3 Answers 3

9
\$\begingroup\$

Start by working back from the output. Collector current is only 4mA so suppose we allow base current to be Ic/Ib = 10 or 400uA. That will ensure it is well saturated. So R3 should be (24V - 0.7V)/0.4mA = 58K, so you can use 56K.

R2 is just to take care of leakage in Q2. It is 50nA maximum at 25°C. If we assume operation to 95°C and doubling every 10°C then we have to allow for 6uA. If the base-emitter voltage of Q1 should be less than 300mV with 6uA of leakage, the R2 should be 50K or lower. We can use 47K for R2. Might as well make R3 47K too and keep the values the same.

Collector current of Q2 is about 0.5mA. If we use the Ic/Ib = 10 again, and assume it should work with 4V input, then R1 <= (4V-0.7V)/0.05 = 66K. We can use 47K again and keep all three the same.

\$\endgroup\$
1
  • \$\begingroup\$ OMG, thank you for this quick and right answer. Now it is working. :-). \$\endgroup\$
    – kalu1
    Commented Aug 9, 2015 at 13:04
-1
\$\begingroup\$

Your circuit should work fine, although I have a couple of minor objections to it.

However, the main reason for this answer is that you got outright bad advice in a comment. No, you don't want to connect the emitter of Q2 to the output. That would make the whole pair a emitter follower, which would only allow the load voltage to go to about 4.3 V, not the 24 V supply. There is no place in engineering for knee-jerk answers and blind application of "rules" without actually understanding the reasons.

Also, here is a simpler answer that accomplishes the same thing:

The main difference is that Q2 is now a voltage-controlled current sink. The digital signal can directly drive the base of Q2, and the output of the current sink (the collector of Q2) can be tied directly to the base of Q1.

The load will draw 6 mA. Let's say Q1 can be counted on to have a gain of at least 50. That means its base current must be at least 120 µA. R1 will also take some current. Let's say worst case the drop on R1 is 750 mV, so the extra current needed for R1 is 75 µA, for a total of 270 µA needed to turn on Q1. When the base of Q2 is driven to 5 V, there will be about 4.3 V across R3. Most of the current thru R3 will come from the collector. We need this to be at least 270 µA, so R3 must be no more than (4.3 V)/(270 µA) = 16 kΩ. The value of 10 kΩ shown above leaves some margin.

Working forward, we have about 430 µA thru R3. 75 µA of that comes from R1, with the remaining 350 µA or so from the base of Q1. This means we require Q1 to have a minimum gain of (6 mA)/(350 µA) = 17, which is well within the capability of many small signal PNP transistors.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Yes a non saturated driver (Q2) indeed has some advantages, especially speed... but in this case it may also have some drawback. Leaving out Q2 base and/or collector resistors we only have one reverse biased junction between +24 and microcontroller output. This lets me feel rather unsafe, one single failure could destroy the micro and probabily anything else powered by the same +5V line. Having a series resistance at Q2 collector and/or a common emitter driver could be more reliable. \$\endgroup\$
    – carloc
    Commented Jul 30, 2016 at 17:56
  • \$\begingroup\$ @carloc: Frankly, that's just silly. Transistors very very rarely fail for no reason when they are not abused. Even in the extremely unlikely event that Q2 failed, you'd have a bad board whether it took out the micro with it or not. Many micros will act flaky when there is substantial current thru their protection diodes, so even with a base resistor in there and the transistor failing, it's probably still going to run the micro out of spec. You might as well worry whether the product will get hit by a meteor or something. \$\endgroup\$ Commented Jul 30, 2016 at 18:18
  • \$\begingroup\$ Sorry but I have to disagree. What is much worst then silly is not to take care of a possibly flaw when you know it's there and especially if you can deal with it with absolutely no drawback nor significant extra cost. Your hair looks white just like mine, how many times did you short something with a scope or multimeter probe? Just my two cents. \$\endgroup\$
    – carloc
    Commented Jul 30, 2016 at 21:40
-2
\$\begingroup\$

When responding to generic "Arduino" questions, we assume ATMega328p devices such as the Uno. This means every I/O has protection diodes. Ideally you don't use them but it is ok for down and dirty circuits. A single PNP with a current limiting resistor on the base can accomplish this switching task if you exploit the protection diode or use an external diode. To set "on" you set the I/O to low. To set "off" you set the I/O pin to input. This isn't best practice, but it does work.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ Please show a diagram what you mean. I don't believe it works, as (1) high side switching is needed and (2) you can't have high side switching with NPN, or if you do, it will be an emitter follower, which does not give you 24V output. And it did say in the question that "best" solution is needeed, and you said yourself your solution is not the best, and described it dirty as IO protection diodes should never be used as a part of a proper design. So I think this answer does not answer the question, but feel free to prove it does with a proper schematic. \$\endgroup\$
    – Justme
    Commented May 25, 2022 at 4:39
  • \$\begingroup\$ NPN was a typo, PNP is required. "Best" is in the eye of the beholder, sometimes down and dirty is the best answer. The OP clearly understands how to use a PNP but if you feel a schematic is needed for a 2 component circuit feel free to submit one. Thanks. \$\endgroup\$
    – Chisight
    Commented May 25, 2022 at 5:20
  • 2
    \$\begingroup\$ Drawing a Schematic could help yopu understand why your solution won't work. A PNP is basically a diode from collector to base. So you're suggesting a diode from 24V with a resistor in series wired to the output of the Arduino. Now explain why the arduino should be able to get it's output to 23.3V. You'll ned a second NPN transistor to convert the Arduino output to open collector. \$\endgroup\$
    – kruemi
    Commented May 25, 2022 at 6:52
  • 1
    \$\begingroup\$ EE:SE has an integrated schematics editor. You can access it while editing using CTRL+M. \$\endgroup\$
    – Velvet
    Commented May 25, 2022 at 8:36
  • 2
    \$\begingroup\$ @kruemi - Hi, FYI I have rejected your proposed edit. Polite, constructive criticism of an answer is allowed in comments, but you are not allowed to edit someone else's answer and insert your criticism there. Here is your image link for you to use in a comment. || In future, if you want to insert a schematic image in a comment, please follow this workaround. Remember to "discard" the draft answer you used in order to create the schematic. Thanks. \$\endgroup\$
    – SamGibson
    Commented May 25, 2022 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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