2
\$\begingroup\$

I'm driving an IRFZ44N MOSFET from an Arduino Uno (pin D2) via a 220 Ω resistor.

On the drain, I have an LED with a protection resistor to +12 V, and the source straight to ground. The Arduino is getting 5 V via a buck convertor. The code just flips D2 between high and low every second. My issue is with the pull-down resistor.

If I use a 10 kΩ pull-down resistor and pull the gate straight to +12 V or +5 V, everything works as you'd expect. When I have the gate connected to my Arduino D2, the gate does not hit its threshold - it only gets about 1 V, even though the Arduino is putting out 5 V at the pin. I don't understand this behaviour.

I also noticed that when I put my multimeter between gate and ground (without a pull-down) it started working as expected. I swapped out the 10 kΩ resistor for 1 MΩ to match the meter's impedance and now it works just fine, and gets about 4 V at the gate.

If I move the pull-down to the other side of the 220 Ω to avoid it being a voltage divider, there's no change in behaviour irrespective of the pull-down's value.

I'm really confused and I feel like I must be missing something obvious.

Schematic

\$\endgroup\$
8
  • 5
    \$\begingroup\$ "So I swapped out the 10K resistor for a 1M..." - Are you sure the '10k' resistor is actually 10k ohms? \$\endgroup\$ Commented Jun 24, 2022 at 20:27
  • \$\begingroup\$ They check out - 9.8K and 217R. \$\endgroup\$
    – Harry
    Commented Jun 25, 2022 at 8:35
  • 1
    \$\begingroup\$ Then something you are telling us is wrong. Does the Arduino put out 5V when the 220 ohm and 10k resistors are installed? What voltage drop do you see across each resistor in this state? \$\endgroup\$ Commented Jun 25, 2022 at 22:23
  • \$\begingroup\$ A little less. I took these measurements, but I feel like I must be doing something wrong here - particularly given those values for the 10k and 1M, which I would have expected to be much more different. \$\endgroup\$
    – Harry
    Commented Jun 27, 2022 at 7:54
  • 2
    \$\begingroup\$ Do the Arduino and the mosfet share a ground connection? \$\endgroup\$
    – marcelm
    Commented Feb 1, 2023 at 16:13

1 Answer 1

3
\$\begingroup\$

Your gate threshold voltage Vgs for that FET is 2..4 V. Your Uno processor may run from a 5 V supply, but is probably outputting a bit less. You don't want to be too close to the threshold, or you may get less current than you think.

Your voltage measurements belie this, though. You say you only get 1 V at the gate with a 10K resistor. If you put 5 V in, you should get about 4.8 V at the gate. This makes me think one of your resistors is not the value you think it is. Measure the 220 and the 10K (out of circuit) to see if those values are correct.

During power-up and Uno reset, the Uno I/O pin will be configured as an input until your software changes it to a driven output. So the I/O pin will be high impedance and can float to a high level. You should add a pull-down resistor to ensure the FET is off during that time. The resistor value can be calculated from the I/O pin's input leakage current, which is 1 uA max. from the datasheet of the ATmega328p MCU used on the Uno. That 1uA through a 47K pull-down produces a 47 mV drop and that 0.047 V at the FET gate will switch it off.

\$\endgroup\$
7
  • 5
    \$\begingroup\$ A pull down still strikes me as a good idea for initial startup of the Arduino before the pin is configured as an output. \$\endgroup\$
    – andrewmh20
    Commented Jun 24, 2022 at 21:01
  • 2
    \$\begingroup\$ That statement's the opposite of reliable design: a pull-down is definitely needed. During power-up and reset, the I/O pin will be a hi-Z input. That's a basic of MCU I/O, been around for decades, so downvoting I'm afraid. \$\endgroup\$
    – TonyM
    Commented Jun 24, 2022 at 21:25
  • \$\begingroup\$ They check out - 9.8K and 217R, and 4V on the output pin of the Arduino when disconnected from the circuit. \$\endgroup\$
    – Harry
    Commented Jun 25, 2022 at 8:35
  • \$\begingroup\$ @TonyM You're right, what I meant was that in operation a lack of pulldown wouldn't prevent the circuit from working. I'll update it. Harry, what is the voltage on the Arduino output and at the gate when all are connected? \$\endgroup\$ Commented Jun 27, 2022 at 16:54
  • \$\begingroup\$ @CristobolPolychronopolis - 4.92 at the Arduino and 4.9 at the gate, with the 1M installed. That .02 may just be error on my meter though. \$\endgroup\$
    – Harry
    Commented Jun 27, 2022 at 19:45

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.