I'm working on a LED lighting project. The LED's consume more power than a Arduino can handle, so I'm using a IRL520 MOSFET to control the lights.
The first phase of the project is simple on and off, the second phase will PWM the MOSFET for brightness of the LED's. Third phase is 3 MOSFETS each controlling a different color bank of LED's for tonal control.
What we have working in phase 1:
+12vdc to 3 white LED's in series with a 120 ohm resistor
This configuration was determined using the LED Wizard at http://led.linear1.org/led.wiz
The next step was to insert a IRL520 MOSFET is series with the LED's, between the resistor and ground. The Drain (pin2) connects to the resistor, the Source (pin3) connects to Ground. The Gate (pin1) can be tested by connecting to +12v (momentarily, not good to exceed 10v) and Ground, alternately.
What have we discovered? The output (LED output) toggles with the gate connection. When we touch +12 momentarily, the LED's light up, and stay lit even after the Gate is no longer touching +12v. When the Gate is grounded, the LED's go out, and stay out, until Gate touches +12v again. We need to connect a 10k ohm resistor between Gate and Ground, so that the LED's are off unless power is applied to the gate, which will be +5v from Arduino pin 13 in the next example.
Schematic generated in SchemeIt, a free online schematic tool.