# Arduino high side driver with up to 30V

I am experimenting with the circuit for an Arduino high side driver from Nick Gammon:

I need the circuit to work with a voltage range from 22V up to 30V and ideally stay cold. Everything else is fine, the MOSFET handles high currents without problem, but my problem is with the npn-transistor - it just gets extreme hot, especially at 30V. I am using 2N2222.

Can the circuit be adjusted in such a way that there will be no need of heat sinks or more powerful elements?

EDIT: After the suggestions of @Nick and @Edgar I changed R1 with 1.2K and R2 with 4.7k. Now the circuit is running for ~45 min without a problem, and is much cooler, I can even touch the transistor :)

I maybe had to better explain what I meant by 'extreme hot' - after a couple of minutes the thermal shutdown kicked in. That hot.

I am also considering switching to MOSFET-only solution, based on Figure 3 site 2 in this application note from Vishay:

Setting the divider to 4.7k/15k should give me less than 2mA through the N-MOSFET (according to TINA I made it and it works like a charm!) so this should be even more cooler. It also should be able to handle even higher voltages without the zener, but I suppose it doesn't hurt to leave it as a surge protection.

## migrated from arduino.stackexchange.comMay 16 '18 at 11:33

This question came from our site for developers of open-source hardware and software that is compatible with Arduino.

• Is there any reason for using high side switch other than experimenting? Maybe some opto-isolated transistor + 7909 (negative voltage regulator) would be better – KIIV May 16 '18 at 8:32
• As this is a purely electronics question I am going to migrate it to Electronics Stack Exchange. – Nick Gammon May 16 '18 at 11:32

## 3 Answers

The current through the transistor is controlled by R1 so I would suggest increasing that somewhat in this case. Perhaps to 1k or 2k. If D2 conducts then you will have a (roughly) 30V drop over 330Ω which would be 90 mA, and therefore 2.7W of power dissipation, which is more than the transistor is rated for.

• Actually I think the above explanation is slightly flawed, however I still think that increasing the value of R1 would be a good way to go. – Nick Gammon May 16 '18 at 8:13
• Increasing R1 will lower the current through both the transistor and R2, potentially preventing Q2 to fully turn on at 22 V. I would increase R2 by the same factor as R1 to be safe. Maybe something like R1 = 1.5 kΩ and R2 = 4.7 kΩ, to stay within the E6 series. – Edgar Bonet May 16 '18 at 8:17
• I can confirm this - with 2k the transistor does not switch and with 1k was still hot. Will try as soon as possible the new suggestion. – Vladimir May 16 '18 at 8:23
• @Edgar is right regarding the fact Q2 could not turn on if R1 is too high. However, increasing R2 has a limit too, because at some point the zener will take over. Actually, this zener stuff isn't really appropriate and will prevent you to size things correctly. What should be done is 1) completely remove the zener 2) put R1 between Q1 and R2 (this way you have a resistor divider with R1 and R2, and the emitter of Q1 is directly to ground) 3) size R1/R2 so that the gate voltage stays within the FET ratings (e.g.: R1 = 3xR2 should be fine), 4) size R1+R2 so that the current is just a few mA. – dim May 16 '18 at 11:46
• To make it more explicit: something like that, with a PFET instead of the Q2 PNP. Simpler, IMO. – dim May 16 '18 at 11:52

Following on suggestions from @dim I propose an alternative schematic:

In this case, if Q1 is conducting, then R2 and R3 form a voltage divider:

Vout = (30 * 3300) / (1000 + 3300)
Vout = 23V


Thus Vgs on Q2 is 7 (30 - 23).

Current through Q1 (Ic) would be only 7 mA so it wouldn't get hot. Current through the base would be about 0.5 mA which is well within spec for a microcontroller output pin.

The NPN transistor Q1 would need to be chosen such that its collector-emitter voltage (Vce) was in range. The 2N3904 has a absolute maximum of 40V, so 30V there (if Q1 was not conducting) would be acceptable. A PN2222 would be marginal (its maximum Vce is 30V) however the PN2222A could be OK (Max Vce of 40V).

I need the circuit to work with a voltage range from 22V up to 30V ...

The above would be a bit marginal at 22V because the output of the voltage divider would be:

Vout = (22 * 3300) / (1000 + 3300)
Vout = 17V


Thus Vgs on Q2 is 13 (30 - 17). The MOSFET quoted (FQP47P06) should be OK as it has a maximum Vgs of 25V.

Q1 acts as a switched current source, supplying either 0 or 4.4V/330R = about 13mA to ...uuuh, R2D2 ... defining the voltage across Q2 gate (assuming Q1 base is connected to 0V or 5V).

This 13mA is pretty much independent of your variable 22-30V supply, which is a nice feature of the design.

As R2 is 1K and would drop 13V, D2 turns on, limiting Vgs to -10V (passing 10mA through R2 leaving 3mA for D2).

This means, at 30V in, Vce in Q1 is 20V-4.4V, call it 16V for a power dissipation of over 200mw; probably tolerable but worth reducing.

Obviously increase R1 : but if you increase it to 1kilohm you only have 4.4mA split between R2 and D2. Let's say you're willing to drop the zener current to 2.2mA (which will reduce Vgs slightly; look up the I-V curve for a zener in its datasheet) leaving 2.2mA through R2 : at 10V that means R2=4.545K - call it 4.7K.

If you decide you need 3mA in the zener, you can't reliably increase R1 so much without losing safety margins; double it to 680R giving 6.5mA, 3-ish for the zener and 3-ish for R2; making R2 somewhere around 3.3K.