Night light with LDR and PIR but no µC

Hi,

I already build a night light using a µC. But now I'm trying to build a circuit without µC. I searched the forum and found some related topics. Based on this I come up with modified schematics.
My night light should have three features:

  1. only light up when dark (see R3, R4 and Q1)
  2. when dark, the LED should dimly shine (R2) all the time
  3. when dark and movement, the LED should brightly shine (PIR, R1, Q2)

    The PIR trigger line has a 2k resistor, hence, I skipped the base resistor for Q2.

Will this work? Any suggestions for improvement?

Thanks for your feedback.
Best

That might work. I’d give it a try… I don’t think you need R2. I’d try it with a lower power LED and a higher value for R1 first.

And, it looks like you’re using a current-limiting resistor with a “high power” LED, which is cheap & easy but inefficient. Make sure the 27 Ohm resistor can handle the power/heat. (The LED probably needs a heatsink too.)

, I skipped the base resistor for Q2.

On a MOSFET it’s a “gate”, not a “base”. :wink:

Those MOSFETs are drawn the wrong way around (see body diode).

So the PIR is active high? Just asking... many are open drain (with or without pull-up resistor) so active low.

Consider replacing R3 with a 20-50k pot, so you can adjust the sensitivity of the night light.

What voltage is your Vcc?

And I hope you're good at soldering, the SI2302 appears to be available only as SOT23 package. It does look like a very suitable part for your application.

Thanks for your feedback. :slight_smile:

DVDdoug:
I don't think you need R2. I'd try it with a lower power LED and a higher value for R1 first.

When I remove R2 the LED lights up on movement only, right? But that's not what I like.

DVDdoug:
And, it looks like you're using a current-limiting resistor with a "high power" LED, which is cheap & easy but inefficient. Make sure the 27 Ohm resistor can handle the power/heat. (The LED probably needs a heatsink too.)

Oh, good point. Looks like I mixed up the resistance with another project where I used 2 LED in parallel. With one LED, 27 Ohm would result in way to much current for my 30mA LEDs. Thanks for saving my LEDs!

DVDdoug:
On a MOSFET it's a "gate", not a "base". :wink:

Thanks for clarifying.

wvmarle:
Those MOSFETs are drawn the wrong way around (see body diode).

Thanks for pointing that out.

wvmarle:
So the PIR is active high? Just asking... many are open drain (with or without pull-up resistor) so active low.

Yes, they are active high. And sorry for the lack of information. I will try harder to describe my projects properly and less biased.

wvmarle:
Consider replacing R3 with a 20-50k pot, so you can adjust the sensitivity of the night light.

Good idea, thanks.

wvmarle:
What voltage is your Vcc?

It depends. I'll try 2.8V (2*AAA), 4.2V (LiIon) and 5V USB.

wvmarle:
And I hope you're good at soldering, the SI2302 appears to be available only as SOT23 package. It does look like a very suitable part for your application.

I don't know if I'm good at soldering. However, I found SOT23 parts were not that hard to solder. Successfully soldered 50+.
I tried some tiny 3014 LED which were really difficult to solder. :wink:

Thanks & best

Schematic looks good - but both R1 and R2 depend on your actual Vcc value, and the forward voltage of your LED(s). In case of 2.8V your 27Ω could be a pretty reasonable value for R1, for 5V the 270Ω sounds quite reasonable. You may have to experiment a bit with it to get the brightness you want for your LED. Same for R2. If you have the values for one supply voltage it's quite easy to calculate the current in the LEDs, and with it the resistor values for the other voltages.

terraduino:
Oh, good point. Looks like I mixed up the resistance with another project where I used 2 LED in parallel. With one LED, 27 Ohm would result in way to much current for my 30mA LEDs.

Sharing resistors for LEDs in parallel is not a good idea (I do it often when testing, out of laziness, and as a result all LEDs have different brightness and influence one another - any final design will have separate resistors).

@wvmarle
Thanks again.
I'll test some Vcc and resistor combinations to find the best values.
In regards to shared resistors, you are probably right. However, all my projects are just for fun, hence, laziness wins :wink:

Best

I've build a prototype. The optimal resistance to recognize "darkness" was 47k Ohm. Unfortunately, the activated LED is not bright enough. Changing to 15k Ohm gave a bright LED but the night light was insensitive to daylight.

What's the best solution?
I thought about using a LDR that has a higher resistance (40k Ohm when bright).
But maybe I overlook a simple solution.

I appreciate your feedback.
Thanks & best

No need for that circuit.
Common HC-SR501 PIR sensors have two vias/holes for a small (~5mm) LDR onder the dome.

Solder an LDR in, and the PIR will be off during daylight.
See the BISS0001 PIR amplifier/processing chip datasheet (pin9).

Just connect the LED between PIR output and ground (no LED CL resistor, because there is already one in the PIR).

Logic level from the PIR is 3.3volt, so you might not have enough current for a ~3.3volt high brightness LED.
If so, then use an NPN transistor (no base resistor) or mosfet to drive the LED.
Leo..

Wawa:
No need for that circuit.
Common HC-SR501 PIR sensors have two vias/holes for a small (~5mm) LDR onder the dome.

Funny, I would've never thought about that. Thanks!

Wawa:
Logic level from the PIR is 3.3volt, so you might not have enough current for a ~3.3volt high brightness LED.
If so, then use an NPN transistor (no base resistor) or mosfet to drive the LED.

You're right. I thought Q2 is doing this job already.

Thanks & best