0
\$\begingroup\$

I am using a mosfet and an Arduino and I want to control the Source-Drain current of the mosfet by adjusting PWM to the Gate.

If I apply zero value to the PWM, the current doesn't stop (I checked the PWM output with voltmeter and it's zero volts). When I manually connect the gate to the ground with a wire, the current stops.

How can I stop the current with PWM output that connected to the gate?

Here's my circuit. I common all the grounds with wire and put mosfet and hall effect sensor on two separate breadboard.

Also, I'm powering the Arduino with a printer cable that's connected to my laptop.

Schematic

\$\endgroup\$
  • 1
    \$\begingroup\$ Show the schematic and a clear picture of the physical implementation. It's possible you've damaged or miswired the MOSFET. Also explain how you are measuring the current. Also try configuring the pin as a simple output driven low, not a PWM and see if you get a different result. \$\endgroup\$ – Chris Stratton Aug 5 at 17:19
  • 1
    \$\begingroup\$ .... and don't forget to clearly show how and where power and Arduino grounds are connect \$\endgroup\$ – carloc Aug 5 at 18:02
  • 3
    \$\begingroup\$ Connect a resistor - maybe 10k- between gate and source. That'll fix your problem. \$\endgroup\$ – Kripacharya Aug 5 at 18:27
  • 2
    \$\begingroup\$ With PWM set to zero, measure voltage from Arduino +5V to the MOSFET Gate. What do you get? \$\endgroup\$ – Bruce Abbott Aug 5 at 19:48
  • 1
    \$\begingroup\$ The glaring problem with your circuit is that you've interchanged the proper positions of the inductive load and the MOSFET. Q1's source needs to be grounded, directly or at most through a small sense resistor. Beware that some cheap bench supplies have truly nasty turn on and turn off behavior with huge voltage spikes. Plus a MOSFET sitting on top of an inductor could easily result in exceeding the gate oxide's quite low maximum voltage rating. You should rebuild the circuit with the FET and load in proper positions, a reverse catch diode across the load, and you may need a new FET. \$\endgroup\$ – Chris Stratton Aug 6 at 15:28
0
\$\begingroup\$

the source of your MOS-FET needs to be connected to the reference of the 5V supply of the arduino, your schematic does not show this connection.

without it the gate voltage is floating so it will be very unlikely to ensure turn off while floating.

You always apply voltage as a differential so a single connection, the gate needs the output, but also the source needs to be connected to the 5V reference.

Sadly, this is not a good design you do not want the reference of the Arduino to have an inductor leading to ground right after and not be connected to ground.

I have a couple ideas from the top of my head.

Re-design the circuit so the source goes to ground and you can connect the Arduino reference to source also

use a DC-DC converter to isolate the arduino from your 5V power line then there is no issue with connecting the source to the 5V reference.

\$\endgroup\$

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.