Go Down

Topic: Problem Lighting LEDs from arduino (Read 804 times) previous topic - next topic

marawnaly

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?


vaj4088

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.


PaulRB

#2
Mar 25, 2020, 08:17 am Last Edit: Mar 25, 2020, 08:26 am by PaulRB
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).

marawnaly

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. 

Paul__B

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.

marawnaly

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.

Grumpy_Mike

Quote
I have researched about the ESP32 camera modules but I couldn't find a way to record videos
Correct there isn't.

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

marawnaly

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.


Paul__B

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.

Go Up