Maker Pro
Maker Pro

PIR LED 12V light circuit recommendations wanted.

Sidecar Bob

Dec 19, 2021
193
Joined
Dec 19, 2021
Messages
193
I bought some HC-SR501 type PIR units to experiment with. Knowing nothing about this technology I assumed that if I use a 12V power supply I could run a 12V LED light from it but that didn't work. I did some research and checked the spec sheet again and learned that regardless of the supply voltage the PIR unit has 3.3v (TTL) output.
I did a bit more research and it indicated that I could use a transistor to drive the LED, which would have been easy for me to figure out 30-40 years but but over the decades I've forgotten a lot.

Can someone please recommend a simple circuit for this?
 

Bluejets

Oct 5, 2014
5,881
Joined
Oct 5, 2014
Messages
5,881
Simpler to use a logic level mosfet like an IRLZ44N........
Here is a circuit using a IRL540N ......same same....5v supply replaced by your 12v naturally.
R1 about 100R....R2 around 10k....common the negative on both supplies.

IRL540N.jpg
 

Sidecar Bob

Dec 19, 2021
193
Joined
Dec 19, 2021
Messages
193
I've never worked with mosfets (or any other kind of fet) before but I have a pile of regular transistors so I'd rather use what I have if I can.
 

Martaine2005

May 12, 2015
4,291
Joined
May 12, 2015
Messages
4,291
What LED light are you wanting to use?
Can you post the specs.

Martin
 

Bluejets

Oct 5, 2014
5,881
Joined
Oct 5, 2014
Messages
5,881
I've never worked with mosfets (or any other kind of fet) before but I have a pile of regular transistors so I'd rather use what I have if I can.

Well then, like Martin says, you're going to have to supply some more details.
Circuit I showed would work straight up, transistors will need some working out based on your reply.
 

Sidecar Bob

Dec 19, 2021
193
Joined
Dec 19, 2021
Messages
193
It is a generic eBay/China side marker light similar to these. I have low voltage (12V DC) lights on the side of the garage that run dusk to dawn and I bought a bunch of these a few years ago to mount inside the garage and connect to it (I figured at the time that it cost less to run half a dozen of these all night every night than it would to turn on the main lights for a minute a few times per week).
https://www.ebay.ca/itm/384327257796

That eBay listing doesn't give any power or current specs and to be honest I have never measured the current to one of them. The closest I've come was plugging the 12V supply in with my plug in power meter and comparing as I added them to the circuit; At the 110V AC mains plug each one increased the power by 0.5W.
I also mounted 4 of them on the bottom of the cabinet in the basement kitchenette to light up the counter, powered by a 12V 1A supply and the power meter said 0.5W for just the supply and 2.5W for the supply + 4 lights.

I figure that works out to about 42 mA per light but I can connect one to a supply and confirm that when I am in the shop later today and let you know.

For this project I need to use 1 of these lights but it would be nice if I could add another later on.
 

Sidecar Bob

Dec 19, 2021
193
Joined
Dec 19, 2021
Messages
193
How about that. The actual current I measured with the 12V supply I want to use and the light I've already mounted in the box (next to the sensor) is only 26mA (measured with 2 meters to make sure).
 

Sidecar Bob

Dec 19, 2021
193
Joined
Dec 19, 2021
Messages
193
I'm not in the shop right now so I can't list them all but I have a bunch that are equivalent to 2N2222.
 

Cirkit

Oct 28, 2015
145
Joined
Oct 28, 2015
Messages
145
The specifications for the HC-SR501 seem to suggest it will operate from 12V. So you can connect the TTL output via a 1k resistor to the base of your transistor and drive a fair few of your LEDs in parallel.
 

Sidecar Bob

Dec 19, 2021
193
Joined
Dec 19, 2021
Messages
193
The HC-SR501 will definitely work with a 12V supply. When I was trying to figure out what was going on I had one connected to the 12V supply I want to use for this with a 3mm LED + resistor on the output and left it running on the end of the bench for a few days
 

Sidecar Bob

Dec 19, 2021
193
Joined
Dec 19, 2021
Messages
193
I'm in the shop now and looking at my bin of transistors. I have
- a bunch of "generic" TO-5 types with numbers like CK913, CK914, 2n414, RCA 40595, a lot that aren't marked and a bunch with IT ID GA stamped into them.
- some TO-46 marked 267819
- some TO92 marked 70C 7427 and 70C 7411
- an RS-2021 brand new in Radio Shack package (says 2N2907 on the back of the card but the card shows a TO-18 and this is a TO-92)
- a few other plastic/epoxy types with numbers like 636ge, 886GE, 2N3393, GE5128 and an assortment of unmarked ones (for some reason I have it in mind that some of these are equivalent to 2N2222)
 

Sidecar Bob

Dec 19, 2021
193
Joined
Dec 19, 2021
Messages
193
I came across this circuit that looks promising. He posted a link to a video of it turning on LEDs on his stairs. What do you think?
https://i.stack.imgur.com/7tT4P.jpg (The thread asked how to add an LDR so the lights wouldn't come on in daylight but that doesn't matter for my project).
7tT4P.jpg
 

Sidecar Bob

Dec 19, 2021
193
Joined
Dec 19, 2021
Messages
193
I just realized that the link in post #14 is to the drawing, not where it came from. Here's the correct link
https://electronics.stackexchange.c...-controlled-by-pir-want-to-add-ldr-to-project

I also realized that the transistor's terminals are not labelled. Based on other similar circuits I see online I think it is safe to assume that the emitter is connected to the negative line.

Once I removed the switch, indicator LED and 7805 that I don't need it looks like this. Is this all I need to do?
PIR LED 12V.png
 

Sidecar Bob

Dec 19, 2021
193
Joined
Dec 19, 2021
Messages
193
I have the circuit above in a breadboard with one of the unmarked TO92 transistors on the bench as I type this. I verified that the transistor is NPN with the multimeter and I know that the middle terminal is the base but I'm not even 100% sure which is collector and which emitter but it works perfectly and the transistor isn't getting hot so I'm not going to change it.
I can't believe how simple this turned out to be.
 
Last edited by a moderator:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
12,613
Joined
Nov 17, 2011
Messages
12,613
I also realized that the transistor's terminals are not labelled.
They don't have to be. The symbol is well defined:
Emitter is where the arrow is, collector is opposite the emitter. Base is the single contact to the bar that connects E and C.
I know that the middle terminal is the base but I'm not even 100% sure which is base and which emitter
The second "base" here should imho read "collector", shouldn't it?
Anyway, when you swap emitter and collector of a bipolar transistor (such as this NPN), the transistor will still work, but current gain will be drastically reduced.
The circuit you show in post #16 uses a 200 Ω base resistor. The pir sensor has a 3.3 V output. With a base-emitter voltage of 0.6 V for the NPN, the resistor limits the base current to IB = (3.3 V -0.6 V) / 200 Ω = 13.5 mA.
As the light operates with only 26 mA (post #7), a current gain of 2 would suffice to drive the LED. In this case it won't matter if you swap emitter and collector.
However, you could save on energy by mounting the transistor correctly (the datasheet will tell where E, B and C are) and making use of its gain of 50 or higher. With 26 mA collector current and a gain of 50, the required base current is only ~0.5 mA. Let's use 1 mA (for some headroom), the the base resistor becomes RB = (3.3 V -0.6 V) / 1 mA = 2.7 kΩ.
Admitted: 1 mA vs. 13.5 mA is not a big saving in this application, but looking at the overall current consumption (excluding the pir as it is not affected by this change) current drops from 39.5 mA to 27 mA which is ~ 30 % in energy saved and accordingly your battery will last about 30 % longer.
 

Sidecar Bob

Dec 19, 2021
193
Joined
Dec 19, 2021
Messages
193
The transistor's terminals aren't labelled in the drawing in post #14, which represents the transistor as a rectangle with 3 leads.
I used a proper transistor symbol in my version and I assumed that it should be a common emitter configuration.

Yes, I meant to say collector. Unfortunately this forum doesn't allow you to edit posts or I would correct that.

The transistor I used is unmarked so I couldn't look up which lead is which. I'm only sure that it is NPN and which is the base because of testing with the ohmmeter.
45 years ago when I was fresh out of college (Electronics & Acoustics) I might have thought of measuring the current with it connected each way to determine which is base and which collector. Now that you have refreshed my memory I'll try to remember to do that the next time (I have a feeling that re-learning some of this stuff is going to be harder than learning it the first time).

Re the 200Ω base resistor, I'm not even sure if that is necessary because the HC-SR501 has a 1K resistor in series with the output but resistors aren't expensive and in this case it worked out that the resistor's stiff leads support the transistor.
A total of 1.2KΩ in series with the base would mean that the current would only be 2.25 mA so any saving would be truly minimal, especially since I am powering it from an AC adapter.

BTW: I have installed motion sensor LED light bulbs in all of the places where people don't normally stand still very long (hallways, closets &c), including at the bottom of the stairs just outside of the door to the shop, which you can see it through the doorway in the pic of my homemade PIR LED light installed. When you enter the shop there's a sort of alcove and a couple of steps to the light switch where the room becomes full width. This means that the light outside the door is always on when you enter the shop so finding the switch isn't a problem but leaving the shop involved turning off the light, finding the door in the dark and going past it far enough to activate the light outside without tripping on something.
With my homemade PIR LED light I can now see where I am going :)

The screw terminals on the side of the box are for adding more of the 6 LED lights if I decide to later on but I'm going to try it for a while with just the one first.
 
Top