Problem Lighting LEDs from arduino

I am currently trying to light up a 12V LED strip from the Arduino Mega 2560. I’m doing a home security system where the lights are turned on/off depending on the PIR sensor detects motion. The output voltage is 5V and the required is 12V. I was thinking of using an OP-AMP but was not sure if it would work or not and what kind should I use.

I also plan to use a 12V Rear Car camera to act as a surveillance of a mini home. I was wondering if this is a good idea or are there other modules that allow video recording?

That's a poor use for an opamp. A transistor (bipolar or MOSFET) and perhaps a resistor are all you really need. Oh yes, and a power supply of 12 volts or perhaps a little more as you will lose a little voltage with the transistor... but you would have needed this power supply and more to use the opamp.

It would be difficult to recommend a transistor without knowing how much current is used by the LED strip, or without at least a pointer to the LED strip.

As already said, op-amp completely unsuitable for this. Use an n-channel logic-level MOSFET such as stp16nf06l or similar, assuming your strip only draws a few amps. A low value resistor, e.g. 220R or 330R to connect it's Gate to the Arduino pin is a good idea, as is a pull-down resistor from the Arduino pin to ground, e.g. 10K. You have the option to dim the LEDs if you use a PWM Arduino pin.

As for the camera idea, you could investigate ESP32 based camera modules, or a Raspberry Pi Zero W with a camera module. Various Pi compatible modules are available with IR illumination, wide-angle lenses etc, even a custom version of the Raspbian OS specialising in surveillance camera projects (can't remember it's name).

sorry I'm a bit slow,

To clarify, I'm supposed to connect between the Gate and the arduino pin with a 330Ohm Resistor. Then take another 10Kohm resistor from the same arduino pin and connect is to the ground. If I'm mistaken, could you please help me with a circuit diagram.

What do I connect to the drain and the source of the MOSFET?
Will A 12V LiPo Battery work as a power supply for the MOSFET?

P.S. The LED strip draws 3Amps.

OK, this is the picture we commonly give to explain how to wire it.


OK, it shows a motor and a "kickback diode", but you just put your LED strip there instead.

You must connect both the Arduino ground and your battery (or power supply) negative to the FET source connection.

A 12 V LiPo should be OK for a 12 V LED strip.

I have researched about the ESP32 camera modules but I couldn’t find a way to record videos. It can be used as a surviellance camera (Video streaming) only.

I dont know if there is a type that has the capability of recording/storing the footage in a good quality.

By the way, thank you for the diagram. It really helped a lot.

I have researched about the ESP32 camera modules but I couldn't find a way to record videos

Correct there isn’t.

dont know if there is a type that has the capability of recording/storing the footage in a good quality

I do, there isn’t.

Hi all,

I was looking for this mosfet “stp16nf06l” but I couldn’t find it. I researched for an alternative and I found this IRF640. I was wondering if the IRF640 is suitable as an alternative and will it work or not?

Thanks in advance

P.S. I have attached the datasheets for both.

IRF640.pdf (107 KB)

stp16nf06l.pdf (337 KB)

marawnaly:
I was wondering if the IRF640 is suitable as an alternative and will it work or not?

Fairly useless. Not a “logic level” FET. Note the “Output Characteristics” graph for four volts VGS and taking parameter spread into consideration.