Motion detector lamp for my dog, which transistor config is suitable?  - Page 1
Forum section: electronics / projects

author: FBMinis
author_rank: Regular Contributor
timestamp: October 24, 2018, 06:18:21 pm
content: Here is an illustration of what I've tried so far:https://ibb.co/mXHY0qGenerally understanding how mosfets, PNP and NPN transistors may work as switches (and using google images for examples), I've tried using IRF520, BS170, PN2222, 2N3904, BC547, etc, but I can get the LED's to be at full power.I must be doing something fundamentally wrong and I'd like to ask for some advice.I'm trying to make the LEDs turn ON as my dog passes by to use the tray at night. She's got congestive heart failure and takes diuretics daily, therefore her peeing frequency has increased, including during the night. Gladly she was thought to use the tray since she was pup..Thank you in advance

author: alsetalokin4017
author_rank: Super Contributor
timestamp: October 24, 2018, 07:32:34 pm
content: The PIR module isn't intended to work alone as a switch or transistor driver. It is intended to be used with a microcontroller or other digital interface, before you can switch an external circuit with it.So you need a little more hardware. The easiest path to your goal is probably going to be using a 3.3 volt Arduino to receive the signal from the PIR module and provide an output signal to switch a mosfet which will switch on your LEDs. The Arduino will allow you to control how long the light stays on, whether it simply comes on at full brightness or fades on and then off, how to ignore false triggering (require PIR signal to be HI for at least x seconds before turning light on) and so on.This video may help:So you would basically do this, except the output of the Arduino would drive a logic level mosfet gate through a 10 ohm resistor. The mosfet switches the power to the LEDs.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: October 24, 2018, 07:37:35 pm
content: You might be able to get it to work in your original simple circuit idea if you use a logic level mosfet, but my confidence level isn't very high. If I could find my PIR module I'd check this out for you... if only. I know it's around here somewhere....

author: alsetalokin4017
author_rank: Super Contributor
timestamp: October 24, 2018, 07:38:16 pm
content: .

author: HB9EVI
author_rank: Frequent Contributor
timestamp: October 24, 2018, 07:39:12 pm
content: wouldn't it be easier to get a mini led beam with built in motion detector?PIRs are nice gadgets but to start up programming mcus for this simple project, seems to me quite an overkill - unless, of course it's maybe your dedicated wish to do so

author: FBMinis
author_rank: Regular Contributor
timestamp: October 24, 2018, 10:14:37 pm
content: Quote from: HB9EVI on October 24, 2018, 07:39:12 pmUnfortunately I might not been clear enough in my initial post because the thread seems to be derailing:1) I do not wish to use the PIR as an Arduino sensor...which would then trigger a mosfet (I'm comfortable with Arduino programming).2) I would like to be given some advice on how to make the PIR trigger a suitable mosfet in order to turn on the 400mA load.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: October 25, 2018, 04:14:10 am
content: Well, you are trying to use something that only has a 2ma output at 3.3 v when in the HI state. You can try driving the gate of a logic level mosfet directly, but since you only have that tiny current available to charge the gate it might not work to your satisfaction-- as you have already discovered with the power mosfet and the bipolar transistors. Or you can interpose a logic level gate driver chip like LTC1157 and use that to drive an ordinary power mosfet.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: October 25, 2018, 04:18:44 am
content: Quote from: HB9EVI on October 24, 2018, 07:39:12 pmNo.QuoteThe programming required to use this PIR module with Arduino for the OP's application is trivial.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: October 25, 2018, 04:29:56 am
content: The application note for the BISS0001 chip shows an example with it directly driving an NPN transistor which is switching a relay. The problem there is that the transistor is switching 12 volts supply, and here we are only switching a 5 volt supply. And the 3.3 v output voltage of the PIR module isn't enough to properly switch a power mosfet fully on. (Although you should try IRF3205 before you give up).But the resistance of even a fully saturated NPN transistor is going to drop the OP's 5 volt supply and cause the LEDs to be not fully illuminated even when the transistor is fully on. So a higher voltage power supply is needed for the LED strip being switched by the transistor. But you want to run the PIR module at 5v. So...

author: Nominal Animal
author_rank: Super Contributor
timestamp: October 25, 2018, 05:07:40 am
content: Consider using something like a Digispark or a clone (ATTiny85 with USB bootloader), and a relay module to turn on the lamp.

author: JVR
author_rank: Regular Contributor
timestamp: October 25, 2018, 07:57:11 am
content: Just use a small signal transistor to switch on the MOSFET. Its not like you care about switching times, so use the first transistor for what it is, a current amplifier. This will give you enough grunt to switch the mosfet.

author: cdev
author_rank: Super Contributor
timestamp: October 25, 2018, 10:32:08 pm
content: A webcam makes a pretty good motion sensor and many of them are IR sensitive or have easily removable filters. Combined with a small cheap SBC with USB cost might be comparable to a PIR and the coverage zone and sensitivity might be much more amenable to fine tuning.

author: james_s
author_rank: Super Contributor
timestamp: October 26, 2018, 01:47:45 am
content: An arduino? That's a ridiculous suggestion. Has everyone forgotten how to use small signal transistors? You could use a Darlington if you want a single device with sufficient gain. This should be a trivial project.

author: Nominal Animal
author_rank: Super Contributor
timestamp: October 26, 2018, 09:27:32 am
content: Quote from: james_s on October 26, 2018, 01:47:45 amIt's just that having the lamp on while the doggo is moving, may not be sufficient, or comfortable. A delay of some sort is definitely preferred (in my experience with movement-sensitive lights). And I wouldn't want the light to go on for every little movement. So it was more about getting options for solving the underlying problem, rather than a suggestion for how to implement the circuit shown.Also, I did notice OP does not want to use an Arduino. An ATTiny85-based DigiSpark or a clone, is a compromise. It's the size of an USB connector, and has only 6 I/O pins, but being reprogrammable via USB (yes, in the Arduino environment) would allow fine-tuning the PIR sensor response to best work for the doggo. I personally would try to PWM (at the maximum frequency the ATTiny85 can do) the light-up and light-down, so that it is smooth, and not annoying, and does not cause an ultrasonic whine the doggo may dislike.But, if one has already decided to implement the circuit shown in the first post, and anything microcontrollery is verboten, then yes, the suggestion is ridiculous. Apologies if so.

author: FBMinis
author_rank: Regular Contributor
timestamp: October 26, 2018, 01:46:16 pm
content: Quote from: james_s on October 26, 2018, 01:47:45 amI agree with you, I have several microcontrollers and sensors here, part of the Arduino ecosystem, but my goal as always been to make a low part-count project using common components. I tried to make that clear in my first post but not clear enough. For example, this PIR can be set to remain HIGH for 5 minutes and to re-trigger only after those 5min or during them, no need for a microelectronic for timing.Thanks to suggestions like yours, of using a transistor to trigger the mosfet or use a darlington pair, I found these circuits which I'm trying to adapt to the components and power source I intend to use:https://electronics.stackexchange.com/questions/216446/lower-current-through-different-transistors

author: MK14
author_rank: Super Contributor
timestamp: October 26, 2018, 03:04:17 pm
content: Using the components you seemed to say you have (PN2222 and 2N3904).This should work, but I've not simulated or tested the circuit.Where it shows the LED, you replace it with the 5V USB Leds.EDIT: Updated circuit, to include (forgotten), current limiting resistor (100 Ohms).

author: FBMinis
author_rank: Regular Contributor
timestamp: November 02, 2018, 11:37:30 am
content: Quote from: james_s on October 26, 2018, 01:47:45 amQuote from: MK14 on October 26, 2018, 03:04:17 pmQuote from: JVR on October 25, 2018, 07:57:11 amThank you for your clear and concise suggestions. Luckily I found a bag of BC517 in the back of a drawer and was able to setup 4 lamps using minimal amount of components. Total cost of each is less than an Arduino Pro Mini on Ebay.

author: FBMinis
author_rank: Regular Contributor
timestamp: November 12, 2018, 04:23:22 pm
content: UPDATE"I must be doing something fundamentally wrong and I'd like to ask for some advice. " - first post.I found out what it was.Please look at the schematic or at your PIR device, there's a resistor just before the OUT pin. This is working has the BASE resistor, usually with a value of 1K or 2.2K, hence only 3mA available to turn ON the transistor of your choice.In my PIR sensors, I changed these to 220 Ohm, therefore now I can get 200mA Ic when using a 2n3904, or 300mA when using the BC337, for example.No need for micro-controllers in this project.Conclusion: these PIR devices already come with a BASE resistor.

author: ogden
author_rank: Super Contributor
timestamp: November 12, 2018, 04:37:57 pm
content: You are building IKEA Molgan LED lamp, Article Number: 602.637.29,5.99$https://www.ikea.com/us/en/catalog/products/60263729/

author: FBMinis
author_rank: Regular Contributor
timestamp: November 12, 2018, 04:42:41 pm
content: For 1/3 the cost and learning something while doing it, not just being a consumer: win-win-win.