Have you ever wondered how to use an Arduino to control more powerful lighting, like the 12V LED strip you have
at home? Even though Arduino operates on 5V, we can control much more powerful devices with a simple trick.
Why can't it be connected directly?
Arduino pins are like small switches that can only handle about 20-40mA of current. An LED strip "consumes" much
more and also requires 12V of voltage. If you connected it directly, the Arduino would burn out. The solution?
A MOSFET transistor.
Wiring instructions for the IRLZ44N MOSFET:
G (Gate - pin 1): Connect to Arduino Pin 9.
D (Drain - pin 2): Connect to the negative (-) terminal of the LED strip.
S (Source - pin 3): Connect to Arduino GND and the negative (-) terminal of the power supply.
Project Logic: The MOSFET acts as an electronic switch. The Arduino tells it to "turn on,"
and the MOSFET allows 12V current from the power supply to flow through the LED strip. Simple and safe!
What do you need?
Arduino (Uno or Nano) – The brains of the system.
12V LED strip – Your light source.
MOSFET transistor (e.g., IRLZ44N) – The electronic intermediary.
12V Power Supply – The energy source for the lights.
Wiring in three steps:
GND: Connect the Arduino GND and the 12V power supply negative (-) terminal together
(this is essential!).
Control: Connect Arduino Pin 9 to the "Gate" (first leg) of the MOSFET.
Power: Connect the LED strip between the +12V power supply terminal and the "Drain" (middle
leg) of the MOSFET.
Below is the code that will make your strip flash at one-second intervals.
Result: Once you upload the code to the Arduino, your 12V LED strip will flash at one-second
intervals. This is the foundation for all future projects involving the control of higher-power loads.
// 12V LED strip flashing
// Author: Borut Bukovnik - vadnica.org
int ledPin = 9; // MOSFET Gate pin
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin, HIGH); // Turn on the strip
delay(1000);
digitalWrite(ledPin, LOW); // Turn off the strip
delay(1000);
}
We use cookies to ensure a better user experience and website functionality.