0
\$\begingroup\$

I attempted to power a 100mA LED with my Arduino. The power for the LED was provided by a battery (3.0V) - tge Arduino was connected via USB to a computer.

The idea was to use the Arduino PWM to regulate power from the battery to the LED.

Wiring the N-channel Mosfet (IRFZ44N) mostly as shown in the picture (taken from this guide) below (where the power supply is a battery.) For simplicity I connected the gate signal directly to the Arduino pin (without resistors.)

enter image description here enter image description here

I observed something that I couldn't explain:

The PWM signal (or 3.3V or 5V pin) from the Arduino seemed to have no effect. Connecting the gate wire to either + or - of the 3V battery circuit turns the LED off and on.

My (noob-level) concept so far was that MOSFETs are simply 'voltage controlled switches' and therefore this doesn't make sense to me.

Can someone explain (in layman's terms) why this is happening?

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

I will guess that you did not connect ground from the Arduino to ground for the MOSFET circuit. That is required.

I am assuming that the LED does light up when you close the switch.

\$\endgroup\$
4
  • \$\begingroup\$ Connecting the two ground wires of the circuits worked, almost magical to see that LED shine with immediate commands of micropython. Thanks! This answer didn't really explain a lot, but I'm guessing that just means it's too trivial to explain, I'll read more about basic circuits \$\endgroup\$ Dec 30, 2020 at 0:36
  • \$\begingroup\$ @user2305193 yeah the mosfet is controlled by the voltage from gate to source. This means you have to connect the source to ground and the gate to your IO pin or it won't work. In a sense, if you don't connect the grounds of the two circuits together, the mosfet doesn't really feel the voltage at the gate. When you ground the source, it is forced to feel it. \$\endgroup\$
    – mkeith
    Dec 30, 2020 at 10:07
  • \$\begingroup\$ @mkeith Here's a doubt I'm having: if instead my mosfet driver battery would be something that is grounded simply with 'a wire to the ground (=physical floor)', and the USB of the arduino would also just be 'a wire to the ground (physical floor, 2-100m away)' - would you expect this to work? \$\endgroup\$ Dec 30, 2020 at 10:11
  • 1
    \$\begingroup\$ I would not expect it to work reliably. Ground in this context just means connected together. The point of the circuit that is defined to be 0V must be connected together for the MOSFET to work properly. Using some piece of earth or a floor in a house or whatever as a conductor in your circuit is unwise. If you need two circuits to have a common ground, run a wire between them. \$\endgroup\$
    – mkeith
    Dec 30, 2020 at 10:20

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.