On an Arduino Uno, the PWM pin 3 is connected to the gate
pin of an N-channel MOSFET STP16NF06L. The source pin is connected to ground of a 12 V power supply and drain pin connected to a multimeter. The other end of the multimeter is connected to the positive terminal of the power supply.
Question: When Arduino varies its PWM output from 0 to 255, the multimeter reading goes from 11.50 V to 12.10 V. Why isn't it 0 to 12 V?
When the FET gate is connected to the Arduino pin that outputs either 0 V or 5 V, the multimeter reading is as expected at 0 V and 12 V respectively.
3 Answers 3
Assuming you have a suitable FET You should have a circuit in line the following. http://elinux.org/RPi_GPIO_Interface_Circuits#Using_a_FET
You should have some kind of load (a multimeter will have too high an impedance). Use a resistor 4.7k or smaller. You should also have a resistor on the gate
-
It works! Whats the reason for using a resistor at the gate?Nyxynyx– Nyxynyx2015年02月24日 19:16:56 +00:00Commented Feb 24, 2015 at 19:16
When the FET is saturated (pin 3 is high), I would expect the instantaneous voltage to be the full 12 v. When pin 3 is at 0v, there should be no connection across the FET; I would expect the voltage to fluctuate randomly. you might see the same if you measure voltage with nothing touching the probes, especially if the probes move relative to each other.
I'm fairly new to FETs, so I may be on completely the wrong track.
Also put a LED with a resistor connected trough drain, then you read the voltage across the resistor and also have visual feedback with the LED. Resistor should be with 0V when your pin is LOW. It's easier to work with transistor knowing if there is current or not.
digitalWrite
, the multimeter is able to read 0 or 12V, but not when using PWM withanalogWrite
?