[SOLVED] LED strip w/PIR sensor and MOSFET - LEDs are blinking. What am I doing wrong ?

Thread Starter

doronb

Joined Jan 28, 2009
17
[EDIT FROM THE FUTURE : The problem was probably that the power supply was not capable of supplying the demand of the led strip]

I have created a basic (maybe too basic ???) circuit, using PIR sensor (HC-SR501), MOSFET (IRLB8721) and a 5 meters LED strip, which I have bought in EBAY, and I am not sure about it's specs exactly, I just know that it's 12vdc and that it was written on the package not to add more than 5 mts.
The idea of the circuit is to sense movement in the kitchen, and turn the LEDs on for a delay time, set in the PIR sensor.

What happens, is that when i connect the system to power (12vdc wall old charger 1A), the strip starts to blink non stop, in a frequency of twice a second. This is not what I meant. It should leave the lights on.

down there you can see the circuit.
Have I missed some important detail/component in the circuit ?
Might it be because there is demand for higher current than the wall charger can supply ?

I am a hobbyist, so please be simple with your answers.

Thank you

Doronb
 

Attachments

Last edited:

AlbertHall

Joined Jun 4, 2014
12,338
If you connect the LED strip direct to the 12V supply does it still blink?
If so then the strip may require more current than the supply can provide so it powers up, detects the overcurrent and shuts down again. Repeat...
Does it say how much current the strip needs?
 

Thread Starter

doronb

Joined Jan 28, 2009
17
Yes, I did connect directly, and it also blinks the same.
In ebay...I think that it said 3A.

But, does the circuit look ok ?
No missing resistors ?

I will search for a more serious 12Vdc supply and check on it.
I will also check the current with multimeter.
 

Thread Starter

doronb

Joined Jan 28, 2009
17
well, I wasn't lazy, and took some cables off an old atx that was lying in the boxes.
It did work perfectly. I am so happy to start learning how to do the things, without using a micro controller aka Arduino.
Thank you.
(And I will check the current draw, just of curiosity and learning...)
 

MisterBill2

Joined Jan 23, 2018
18,061
Yes, I did connect directly, and it also blinks the same.
In ebay...I think that it said 3A.

But, does the circuit look ok ?
No missing resistors ?

I will search for a more serious 12Vdc supply and check on it.
I will also check the current with multimeter.
OK, the problem has become quite clear. The power supply is rated at ONE amp while the LED strip wants to draw THREE AMPS. And since the same blinking happens with out the motion sensor connected, it is clear that the power supply is being overloaded. So the solution is finding a power supply that can deliver over three amps.
 

Reloadron

Joined Jan 15, 2015
7,480
Power aside I would add a 10K resistor from MOSFET gate to ground. That just being a good design practice and what it does is make sure when the gate goes low the MOSFET is Off.

Ron
 

Thread Starter

doronb

Joined Jan 28, 2009
17
Thank you very much to all of you.
I am going to get a decent power supply.
About the resistor - that's exactly what I am interested in - to get the intuition for electronics.
So I tried to build the simplest circuit, no resistors at all... to see if it works... and it works (COOL !!!!).
I have seen in a lot of opportunities this drop down resistor. But I wasn't sure what it is there for...
 

MisterBill2

Joined Jan 23, 2018
18,061
Power supply ratings do matter a lot. I once got a very nice garage-stereo setup that a guy built and then discarded "because it didn't work." I was happy to get it, and when I investigated I found that he had used a small wall wart power supply, 12 volts at 300mA for power, and nothing worked. With a 12 volt 8 amp supply it plays very well.
 

ElectricSpidey

Joined Dec 2, 2017
2,754
Is it good design practice to add components that are not needed?
Is it good design practice to waste current?
If a PIR uses a low side switch and a pull up resistor to go high, is it a good idea to create a voltage divider with a pull down at the gate lowering the available voltage to that gate?
 

Thread Starter

doronb

Joined Jan 28, 2009
17
Is it good design practice to add components that are not needed?
Is it good design practice to waste current?
If a PIR uses a low side switch and a pull up resistor to go high, is it a good idea to create a voltage divider with a pull down at the gate lowering the available voltage to that gate?
I have read your words 3 times and still don't get what you tried to say.
would you explain it a little bit simpler ?
As I am not sure from your words should I change anything in my circuit or not.
(I am still not fluent in the Electronics language)
Thnx
 

djsfantasi

Joined Apr 11, 2010
9,155
Thank you very much to all of you.
I am going to get a decent power supply.
About the resistor - that's exactly what I am interested in - to get the intuition for electronics.
So I tried to build the simplest circuit, no resistors at all... to see if it works... and it works (COOL !!!!).
I have seen in a lot of opportunities this drop down resistor. But I wasn't sure what it is there for...
Is the resistor you mentioned the 10kΩ drop-down resistor Reloadrin mentioned?

I’ll try to explain. MOSFETs are capacitive devices, switched by voltage. BJT Transistors are different and switched by current.

Since they are capacitive, when they are switched off, it takes a discrete amount of time for their charge to dissipate. This may be ok for slow switch times, but if it must be switched quickly, adding a resistor from the gate to ground allows the charge to dissipate faster.

The first time I had to use this resistor was when multiplexing many lights. An earlier circuit just operated a relay and slow switching was ok. The relay mechanical time was larger that the off time.
 

ElectricSpidey

Joined Dec 2, 2017
2,754
And what makes you think the PIR isn't already pulling the gate to ground?

And what happens when a gate that already has a lower voltage then ideal gets pulled even lower with a pull down resistor?
 

djsfantasi

Joined Apr 11, 2010
9,155
And what makes you think the PIR isn't already pulling the gate to ground?

And what happens when a gate that already has a lower voltage then ideal gets pulled even lower with a pull down resistor?
I don’t. I made a mistake! I was concentrating on the MOSFET and not what was driving it.

But knowing why a 10kΩ resistor is used in this manner will help the hobbyist TS in the future.
 

wayneh

Joined Sep 9, 2010
17,495
Power aside I would add a 10K resistor from MOSFET gate to ground. That just being a good design practice and what it does is make sure when the gate goes low the MOSFET is Off.
+1

If a PIR uses a low side switch and a pull up resistor to go high, is it a good idea to create a voltage divider with a pull down at the gate lowering the available voltage to that gate?
The state of the signal from the PIR may not always be fully high or low. There is always a finite probability of it being undefined, such as if connection is lost, power is failing, whatever. Pulldown resistors are placed on the gates of MOSFETs to protect against that possibility, to turn off the load quickly. This protects both the MOSFET and potentially the load as well.

Adding one component to protect another is always a judgement call. You weigh the cost versus the expected benefit. You don't use a $1 fuse to protect a 5¢ resistor. Trouble is, you rarely know enough - the odds of the bad event - to really make a calculation. So you follow good practice based on the experience of others. I've seen many sage and experienced designers mention that a gate pulldown resistor is good form, and so that's what I do too if at all possible.
 

ElectricSpidey

Joined Dec 2, 2017
2,754
I make my circuit decisions based on what they actually do, not what they "might" be doing.

I don't believe in one size fits all circuit design.

If I need a pull resistor I put it in, if I don't then I don't, good design is knowing the difference.

That's all I'm going to say here before this gets out of hand.
 

Reloadron

Joined Jan 15, 2015
7,480
I have read your words 3 times and still don't get what you tried to say.
would you explain it a little bit simpler ?
As I am not sure from your words should I change anything in my circuit or not.
(I am still not fluent in the Electronics language)
Thnx
Rather than just run off at the mouth let me try to explain a little. Gate to ground resistor, gate resistor in series with the gate drive? I guess most would depend on what is the gate source or what is driving the gate. Keeping in mind a MOSFET unlike a BJT transistor which is current driven is a voltage driven device, not like we need to figure base current. When I make a statement like "It is generally a good idea... or It is generally good engineering practice..." It should be self explanatory but I would be remiss if I did not state why doing something is a good idea, in most cases anyway. Things like it's a good idea not to use a burning match to illuminate the fuel fill on a car or truck. That should not require explenation.

It is generally a good idea to include a gate resistor to avoid ringing. Ringing (parasitic oscillation) is caused by the gate capacitance in series with the connecting wire's inductance and can cause the transistor to dissipate excessive power because it doesn't turn on quickly enough and hence the current through drain/source in combination with the somewhat high'ish drain-source impedance will heat the device up. A low ohm resistor will solve (dampen) the ringing.
A high value resistor to ground is a good idea to avoid capacitive coupling driving the transistor when it is otherwise not connected.
Gate Resistors.png

Will the above circuit work less R1 and R2? Likely yes but I would include them in a design. My design career ended about 15 years ago and my retirement followed 6 years later. During my career I tried to instill good design practices and instill good work habits to those in my charge. I had very good leadership and wanted to be a good example to those who worked for me. The resistors go in if it is left to me to decide. I likely would use 10K or 100K verse 1 MEG but 1 Meg is fine.

Ron
 
Top