Well I was pretty excited about the MOSFET and the LED strip I bought. The setup seemed straightforward but I've managed to have trouble anyways.
LED STRIP
MOSFET
Power adapter
And an Arduino Uno.
I have positive from the 12v power supply to the positive on the led strip.
Negative from the power supply to the Source on the MOSFET.
Drain on the MOSFET to the negative on the LED strip.
Gate on the MOSFET to pin 13.
Ground on the Arduino to the MOSFET Source/power supply negative.
The code is just turning it on and off every second for now. The on board LED is working correctly.
So, I checked this a ton and I'm pretty sure I have the circuit right (happy to find out I'm wrong) but the behavior is that after plugged in there's a slight delay, the LED powers up, then dims just slightly when it should be turning off entirely, then brightens back up when it should be turning back on. The dimming is faint but definitely there. It's like the LED is receiving power the entire time but the gate is just adding slightly more power.
I am more than happy to find out I'm an idiot and learn what I've done wrong. Thank you for the help!
Try removing the Arduino Pin 13 from the circuit and test the circuit manually. Just use a jumper wire from the MOSFET's gate, alternately switching it between the Arduino's +5V pin and GND pins. This, just to test the circuit ON/OFF switch function.
If you use another Arduino digital pin besides pin 13, you may need a 10K ohm resistor to pull the MOSFET gate LOW in order to turn off the LED. So connect this resistor between MOSFET gate and ground (GND). The Arduino will still be able to over power the resistors ground affect and drive the MOSFET gate HIGH to allow the LED to be turned ON.
Much easier to just buy an already-built MOSFET switch module from eBay. These modules already have the appropriate bias resistors or incorporate the use of an opto-isolator to protect the Arduino from high supply voltages (>+5V) which may be required by the load.
There are several YouTube.com videos on designing 5V logic level MOSFET switches.
did you connect a 10K ohm resistor from Gate to GND? That is normal practice to ensure the gate doesn't float and keeps it tied to ground when the pin is at 0.
silly_cone:
did you connect a 10K ohm resistor from Gate to GND? That is normal practice to ensure the gate doesn't float and keeps it tied to ground when the pin is at 0.
He did say his MOSFET gate was connected to pin 13. Pin 13 on UNO is also connected to ground through a 1K ohm resistor and LED. So, the MOSFET gate shouldn't float and should turn off the LED when Pin 13 state is LOW.
"300 LED strip" with a "2A supply".
They say "20W".
Post your sketch.
Troubleshooting:
Try a pin other than "13".
Try one LED (+ resistor) in place of the roll. See how that works out.
G - D - S
You'll definitely need a resistor form the gate to GND if the output goes Hi-Z. Once the gate voltage falls to the forward bias voltage of the LED on pin 13, the current will stop flowing and the diode will look more like a capacitor to the gate circuit (with some tiny leakage current). The forward voltage on the LED is likely to be higher than the threshold voltage on the MOSFET. Having said that, the IO pins on most Atmel chips can both source and sink current when configured as digital outputs which should mean that the resistor is not needed. If, for some reason, your code is changing the IO direction of the pin, then you would expect the described behavior.
Reiserer:
You'll definitely need a resistor form the gate to GND if the output goes Hi-Z. Once the gate voltage falls to the forward bias voltage of the LED on pin 13, the current will stop flowing and the diode will look more like a capacitor to the gate circuit (with some tiny leakage current). The forward voltage on the LED is likely to be higher than the threshold voltage on the MOSFET. Having said that, the IO pins on most Atmel chips can both source and sink current when configured as digital outputs which should mean that the resistor is not needed. If, for some reason, your code is changing the IO direction of the pin, then you would expect the described behavior.
The LED's forward voltage is a function of current through the LED. As the current approaches zero, the forward voltage approaches zero volts.
In a perfect world, I'd think the UNO pin 13 LED current would be zero when low, but there must be some leakage from UNO causing some amount of forward voltage that's preventing the MOSFET from turning completely OFF.
Have you tried changing the MOSFET?