1
\$\begingroup\$

I need to control a 5V 60mA load from an Arduino pin, but as the load has an output (tacho) that I will be reading from the Arduino, it seems I need to connect it as a high-side switch. What would be the best way to do it? I guess I need a P-MOSFET but would I need another NPN or N-MOSFET to control it?

(I have searched but mainly found ways to connect higher voltages, 12V or so... Couldn't find anything related directly to controlling 5V high-side, or couldn't understand it... noob in electronics).

An schematic would be great.

\$\endgroup\$
  • \$\begingroup\$ Schematic would be great, yes. But understanding when to use P- or N-channel MOSFETs and how to control them would be greater. You saw schematics for 12V high side switches (it's nice that you've done preliminary research, cheers for that). Here then are a few Socratic questions. Why does the 12V switch need the second transistor? Will the switch designed for 12V work for 5V? \$\endgroup\$ – Nick Alexeev Oct 19 '14 at 23:56
  • \$\begingroup\$ Thanks nick, yes I understand that with a typical high-side switch for switching 12V for example, i need the first transistor to be able to put the required voltage on the gate of the pmosfet, (as the arduino pin is just 5V), right? my problem is i still cant really understand how everything works (I mean, to really understand just looking at the schematic what currents and voltages will there be at any point of the circuit when i put 5V on arduino pin, or when its 0v, and so on...) \$\endgroup\$ – patsy Oct 20 '14 at 14:29
0
\$\begingroup\$

You could use a P-channel MOSFET, as long as you choose a part that has a low gate-source threshold voltage so that it switches on with 5V. Then you don't need another driver to control it, either, as long as you're fine with the control signal being active-low. The schematic below has a 100Ω resistor on the gate just to be safe, but that's not strictly necessary.

You can also use a PNP transistor, which may be easier to find in a junk bin, or cheaper to buy anyway. Shown below is a circuit using the venerable TIP42C power transistor. A small and common 2N3906 could handle the 60mA, but it would have a collector-emitter voltage drop of around 0.2V at that current (which may be fine), but the TIP42C only drops about 0.05V.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • \$\begingroup\$ thanks Rennex, that makes sense. i was hoping there could be a way to make it active high without using another transistor (maybe with a pullup resistor on the gate or something). \$\endgroup\$ – patsy Oct 20 '14 at 14:12
  • \$\begingroup\$ wait, but how do you choose the resistors values? \$\endgroup\$ – patsy Oct 20 '14 at 14:56
  • \$\begingroup\$ The FET's gate resistor just protects the Arduino pin against an accidental short circuit. I kind of pulled it out of my sleeve, and it may be a bit low; 1k might be better (but if you go too high it slows down turning the FET on and off). For the PNP transistor, the hFE (DC current gain) is at least 30 in the TIP42C, so it needs a base current of 2mA for a collector current of 60mA. When the Arduino pin is low, there's about 4.3V across R1 (5V minus the Vbe, i.e. 0.7V). So that 2.2k may be cutting it a bit close actually, some 1.8k would be better :-) \$\endgroup\$ – Rennex Oct 21 '14 at 1:31

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.