0
\$\begingroup\$

I'm trying to switch power to a servo using a IRLZ44N MOSFET. I'm using a ATmega328P mcu running at 3.3V and a 8MHz crystal. The servo is rated 4.8-6V and draws up to 200mA to move. Following is the wiring diagram (hope I got the MOSFET's leads correct in the diagram - physical connections on my breadboard are correct as I'm using it to control power to another system).

enter image description here

The problem is servo is not responding very well. It moves in one direction (although much more slowly than without the MOSFET), in the other direction it doesn't move at all. I can feel the servo pulsating. So, it looks like the servo is not able to draw enough current? The voltage across the servo is 6V. When the servo moves, it drops to about 5.6-5.7V.

The specs of the MOSFET are:

enter image description here

This is my first time using a MOSFET. Can't figure out what to do. I tried changing the 1k resistor to 10k and 330 Ohm resistors, no luck. Why is this happening and how can I fix it?

\$\endgroup\$
3
  • \$\begingroup\$ Why do you want to switch off the servo at all? Are you aware that it cannot maintain the position when not powered? \$\endgroup\$ Commented Jun 19 at 5:52
  • \$\begingroup\$ Why do you switch the low side? Are you aware that the PWM control line gets pulled up to the servo's supply while the power is off? \$\endgroup\$ Commented Jun 19 at 5:54
  • \$\begingroup\$ Did you measure the current with and without the MOSFET? Did you use an oscilloscope to see the transients? Motors take (as a rule of thumb) 10 times of their normal current on the start. \$\endgroup\$ Commented Jun 19 at 5:55

2 Answers 2

3
\$\begingroup\$

I have been a victim of your badly arranged schematic. I thought that the MOSFET was being operated as a high-side switch, which is not the case. Please try better in future to arrange the schematics to show clearly the architecture of the design.

The long answer I wrote below might be moot, but there are potential issues with using a low-side switch for your servo. When "off", the servo's unloaded PWM input will be close to +6V, well outside the MCU's pins' permissble range of potentials 0V to +3.3V. This may or may not be a problem, depending on a few things, including the internal circuitry of the servo itself. In any case, the solution below is still valid, and alleviates the problem.

You can use the N-channel MOSFET in this "source follower" configuration, but to switch it fully on will require \$V_{GATE}=+6V + V_{GS(TH)}\$ to obtain \$V_{SOURCE}=+6V\$. To put this another way, source potential is:

$$ V_{SOURCE} = V_{GATE} - V_{GS(TH)} $$

For the IRLZ44, \$V_{GS(TH)} \approx 1.5\rm V\$, and might even be as high as \$V_{GS(TH)} = 2.0\rm V\$, so your servo is probably only seeing this supply potential:

$$ V_{SOURCE} = +3.3{\rm V} - 1.5{\rm V} = +1.8V $$

You could employ the +9V supply to obtain \$V_{GATE}=+9V\$, but that will need another transistor to translate levels from 0V/+3.3V to +9V/0V (note the inversion):

schematic

simulate this circuit – Schematic created using CircuitLab

A low MCU output will switch the servo on, so I have tied R2 to +3.3V to ensure the servo remains off when the MCU output is at high impedance during power-on initialisation.

Usually this kind of high-side switching would be performed by a P-channel MOSFET, but that would still require level-translation. You are only able to continue to use the N-channel IRLZ44 because you have access to a potential significantly greater than +6V, which I have exploited above.

Diode D1 might not be necessary, but it's never a bad idea to protect the switching transistor from potentially inductive loads.

That's not all. Even if you manage to switch the servo perfectly on and off, so it sees the entire 6V supply when on, you are still supplying a PWM signal of only 0V/3.3V. Are you sure that this is sufficient amplitude for a servo powered from +6V?


This is how to use a P-channel MOSFET as a high-side switch:

schematic

simulate this circuit

Both transistor stages are inverting, so now a +3.3V MCU output will switch on the servo. I have moved R2 to reflect this change. You still require M2, to translate from 0V/+3.3V to +6V/0V. There's no need to use the +9V supply, since M1 is connected common-source, and is no longer a source-follower.

\$\endgroup\$
8
  • \$\begingroup\$ Thank you for the very informative answer and sorry about the poorly drawn schematic. Could you share a schematic for how this would look like with P-channel high-side switching? I'm thinking of using IRF9540N. But the power supply for P-channel MOSFETs look more complicated (I need a dedicated supply for that?) \$\endgroup\$ Commented Jun 19 at 7:20
  • \$\begingroup\$ I can drive the servo with the 3.3V without issues. Also, I don't think I will use a 9V in the final project. I will probably use 4.9 or 5V for the servo and likely use a 7.2V supply. \$\endgroup\$ Commented Jun 19 at 7:26
  • 1
    \$\begingroup\$ @kovac I've added a circuit to employ the IRF9540 instead. \$\endgroup\$ Commented Jun 19 at 9:10
  • 1
    \$\begingroup\$ @kovac M2: low power signal transistor, it's carrying less than a milliamp of current. Low \$V_{GS(TH)}\$ compared to the MCU's supply of +3.3V, since that's the maximum gate potential, and should be sufficient to switch on M2. No other deep considerations. 2N7000 or 2N7002 are the "jellybean" components every engineer has in his parts box. Another is BSS138, with even lower \$V_{GS(TH)}\$. \$\endgroup\$ Commented Jul 7 at 8:59
  • 1
    \$\begingroup\$ @kovac You've been kind enough to recognise my efforts, this is thanks enough. All accepted, I'll treat my next coffee as if it were from you. \$\endgroup\$ Commented Jul 27 at 11:31
1
\$\begingroup\$

I tried to unwrap your drawing and by the looks of it, you have placed the MOSFET in the GND path of the buck and motor.

To activate a N-channel MOSFET as in your case, gate needs to higher be than the source, by at least the threshold voltage of the MOSFET. This is difficult in your case because it is placed in the GND path. When you raise the gate voltage, the drain voltage will start to be applied to the source, but this is at GND so it will never turn ON.

Instead use a P-channel device in the VCC path. My primitive drawing is missing a N-Channel activated by the GPIO, to active the P-channel device.

enter image description here

My suggestion.

enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ I will try with a P-channel MOSFET and report back. Could you recommend a part (low RDS) that is similar to the N-channel one I'm using? \$\endgroup\$ Commented Jun 19 at 6:05
  • \$\begingroup\$ We tend to avoid product recommendations here because whatever we recommend today will be obsolete tomorrow (or next year). If you can get onto the DigiKey website, they have the best parametric search; Mouser isn't far behind. \$\endgroup\$ Commented Jun 19 at 13:56

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.