LED Strips with MOSFET Will This Work?

I've just started getting into arduino and wanted to get opinions if this circuit would work and if the code seems alright. The project is to have motion sensor LED light strips that come on. I have tested this without the MOSFET and it works for a single LED, I just want to make sure the LED strip acts the same way.

Picture of circuit: Imgur: The magic of the Internet (the unlabeled box is just a breadboard

LED light strip: http://www.amazon.com/Hitlights-Flexible-Ribbon-Adapter-included/dp/B005GL5R56/

int pirPin = 3;
int ledPin = 13;
void setup(){
Serial.begin(9600);
pinMode(pirPin, INPUT);
pinMode(ledPin, OUTPUT);
}
void loop(){
int pirVal = digitalRead(pirPin);
if(pirVal == LOW){ //was motion detected
Serial.println("Motion Detected"); 

digitalWrite(ledPin, HIGH);

delay(2000); 
} else {
digitalWrite(ledPin, LOW);
Serial.println("Motion Off");
delay(2000);
}
}

Read the how to use this forum sticky and modify that post so the code is posted correctly.

I have no idea what that box in the middle of your schematic is.

Sorry, I believe I fixed it. Also the unlabeled box is a breadboard.

In short, yes. You can use a MOSFET to supply power to your LED strip.

If you could redraw your circuit a little neater it'd make it easier to make sure whether or not you have it set up correctly.

Why you have 1 "wire" from the Led Strip to the Vin in the Arduino?

Remember you have to provide the Led Strip with 12Volts.

And you have to keep those 12V away from any arduino pin. That's what the Mosfet does I think, you apply a signal to the Gate and in will allow the leds to turn on. I'm not sure how to explain it, and all the considerations you have to have in mind, but anytime you are unsure, place a 10Kohms resistor on any pin sending signals from arduino, I think that helps.

PS: For making tests you can run a programm like this one http://www.crocodile-clips.com/

It will burn the things for you, avoiding burning them in real life :stuck_out_tongue: LOL

In all reality, you should use the Arduino to control a Mosfet that turns on/off a relay. This way you can make the LED strip as long or short as you want without having to worry about complex calculations of current through your Mosfet.

kuade:
In all reality, you should use the Arduino to control a Mosfet that turns on/off a relay. This way you can make the LED strip as long or short as you want without having to worry about complex calculations of current through your Mosfet.

Is something like this a good schematics example?

The light simulates the 12 Volts led strip (In a real strip, I think the 100ohms resistor wouldn't be necessary)

The push button from the 5V simulates an Arduino pin going high.

If you want to use an Arduino to control an LED strip, I am assuming you would like to control dimming? The key thing to remember is the arduino pins can supply a MAX of 40uA. Use ohms law... the biasing of 5 volts through a 10k resistor is 500uA

American2020:
Why you have 1 "wire" from the Led Strip to the Vin in the Arduino?

Remember you have to provide the Led Strip with 12Volts.

I was using what I read on Adafruit to help me with the design. Usage | RGB LED Strips | Adafruit Learning System So I should provide separate power to the LED and to the Arduino?

[ADDED] If I use separate power for the LED what would control whether it was on or off since the LED strip only has Voltage and GND wires?

kuade:
If you want to use an Arduino to control an LED strip, I am assuming you would like to control dimming? The key thing to remember is the arduino pins can supply a MAX of 40uA. Use ohms law... the biasing of 5 volts through a 10k resistor is 500uA

It's mainly to turn on when I walk into a hallway, dimming would not be needed.

American2020:
Is something like this a good schematics example?

It's been a few years since I've looked at schematics, hence why mine wasn't drawn the best. I'm unfamiliar with the 5mW symbol.

I just removed two of the MOSFETS for simplicity

Takachsin:

American2020:
Is something like this a good schematics example?

It's been a few years since I've looked at schematics, hence why mine wasn't drawn the best. I'm unfamiliar with the 5mW symbol.

That symbol was there just to simulate the Led Strip, its a light bulb.

What I think you have to do is provide the 12V to the led strip, and the ground, you control it, through the MOSFET, that when it gets the 5V from some pin in the arduino, on it's gate, will allow the Led Strip to turn on.

I'm not an expert, but I think that's the basic concept.

Take a look in here for a better concept.

What has confused me was explained here

Connect a 9-12V power supply to the Arduino so that Vin supplies the high voltage to the LED strip. If you want, you can also just use a separate wire that connects to a power supply that provides about +12V. Make sure to connect the ground of that supply to the ground of the Arduino/MOSFETs!

I didn't knew Arduino was able to provide the 9 to 12 Volts a Led Strips needs.

kuade:
I just removed two of the MOSFETS for simplicity

That helps seeing it that way. Just so I know if I'm understanding it correctly, the 12V power supply would provide a full 12V to the LED strip, and 9V to the Arduino via the Vin pin?

I was using this 9V power supply. http://www.amazon.com/gp/product/B003XZSZWO/ref=wms_ohs_product?ie=UTF8&psc=1
Can this power be provided through the Arduino board, or can only 5V be provided?

Ahh ok, no, then you are probably right, I forgot that.

I think that can be made. All power from the same source.

That power supply you linked from Amazon will not work, it only provides 650mA at 9V. You need 2.5A at 12V.

or

kuade:
That power supply you linked from Amazon will not work, it only provides 650mA at 9V. You need 2.5A at 12V.

http://www.amazon.com/Ledwholesalers-Power-Suppply-Driver-Transformer/dp/B0034GUEY4/ref=sr_1_5?ie=UTF8&qid=1366322676&sr=8-5&keywords=12+volt+adapter

or

http://www.amazon.com/Adapter-Power-Supply-LCD-Monitor/dp/B003TUMDWG/ref=sr_1_15?ie=UTF8&qid=1366322676&sr=8-15&keywords=12+volt+adapter

Will a smaller power supply work but the LEDs are dimmer?

And just for future knowledge the Arduino is rated at 5V to power it's other devices, that's why the max voltage pin is 5V correct?

A lower voltage power supply will work. However, the lower current supplied will reduce the number of LED's that you can have. That 3M LED strip has all the LED's wired in parallel.

5V.This pin outputs a regulated 5V from the regulator on the board. The board can be supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it.

Read the specs at http://arduino.cc/en/Main/ArduinoBoardUno

Will a smaller power supply work but the LEDs are dimmer?

Basically no.
You need the 12V for the strip in order to supply enough to turn the
LEDs on. You need the current to drive them.
If the power supply can not cope with the current demanded by the LEDs then it will either over heat or shut down or reduce the voltage output.

You can power the arduino with the same 12V you power the LEDs from. Use the power in jack.

Well I think with all of that I have a better understanding how things work and can finish this project.

Thanks to everyone for their help.