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.
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.
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
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.
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?
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.
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.