Author Topic: Motion Sensor Ciruit  (Read 2646 times)

0 Members and 1 Guest are viewing this topic.

Offline NeutronomanTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Motion Sensor Ciruit
« on: March 03, 2016, 04:19:58 pm »
Please comment on this circuit. It's not working, and I don't know why.  :-// The power supply is 5vdc. The motion sensor output is 3vdc. I thought 3vdc would be enough to turn on the 2n2222 transistor, but the led is barely lighting up.

My actual goal is to use a relay with a 5vdc coil and 120vac contacts to light up a porch light.  With the relay in place, if I bypass the motion sensor and put 5vdc to the transistor base my light bulb lights up just fine.

I switched to the led for testing purposes.
 

Offline Photon939

  • Regular Contributor
  • *
  • Posts: 111
  • Country: us
Re: Motion Sensor Ciruit
« Reply #1 on: March 03, 2016, 05:31:30 pm »
You should have a current limiting resistor on the base of the transistor. If you're using an NPN as the schematic shows, the transistor and LED should swap positions.

See http://www.electronics-tutorials.ws/transistor/tran_4.html down at the "basic NPN transistor switching circuit"


 

Offline NeutronomanTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Motion Sensor Ciruit
« Reply #2 on: March 04, 2016, 06:29:16 am »
I did as you suggested, and that helped a lot. Now I'm getting the full 5vdc through the transistor and the LED lights up brightly. So then I swapped the LED out for the 5vdc relay that I actually want in there, and I expected it to work, but it didn't. I can activate the relay using the 5vdc from the power supply, but not through the transistor. If I have power to the relay going through the transistor, I can jump start it using direct power, then remove that direct power, the relay will stay on until the transistor turns off.

It seems obvious that the problem is low current through the transistor. How can I fix that problem?

Thanks
« Last Edit: March 04, 2016, 02:06:51 pm by Neutronoman »
 

Offline Photon939

  • Regular Contributor
  • *
  • Posts: 111
  • Country: us
Re: Motion Sensor Ciruit
« Reply #3 on: March 05, 2016, 12:46:23 am »
I did as you suggested, and that helped a lot. Now I'm getting the full 5vdc through the transistor and the LED lights up brightly. So then I swapped the LED out for the 5vdc relay that I actually want in there, and I expected it to work, but it didn't. I can activate the relay using the 5vdc from the power supply, but not through the transistor. If I have power to the relay going through the transistor, I can jump start it using direct power, then remove that direct power, the relay will stay on until the transistor turns off.

It seems obvious that the problem is low current through the transistor. How can I fix that problem?

Thanks

I'm not sure how much current that output pin of the motion sensor is capable of, but you either need a lower value base resistor to allow more current or a darlington transistor setup to get enough gain to drive the relay.
 

Offline uncle_bob

  • Supporter
  • ****
  • Posts: 2441
  • Country: us
Re: Motion Sensor Ciruit
« Reply #4 on: March 05, 2016, 01:11:10 am »
Hi

How much current does your relay pull at 5V?

How much current can your transistor handle?

How much gain does your transistor have?

What kind of signal does your motion sensor put out?

What value base limiting resistor did you pick?

=======

Let's say that your relay pulls an amp (only a guess) to actuate.

Let's say that your transistor will handle 10A (again a guess).

Let's say your transistor has a gain of 10.

So you need 100 ma into the base of the transistor to get things to work (1A / 10 = 100 ma).

If your numbers are different, plug them in instead.

Say that your sensor puts out an HCMOS logic signal. Thus it has a maximum of 2ma that it will deliver. You need 100ma and you have 2ma. Now you need 50X the gain, so you need two more transistors (if they each have a gain of 10). That assumes that the base limiting resistor is not what bottlenecks things.

Again, if your numbers are different ....

Bob
 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
Re: Motion Sensor Ciruit
« Reply #5 on: March 05, 2016, 01:12:33 am »
What is the part number of the sensor? We can check its datasheet to see how much current the output pin can provide.

Regardless of that, if you use a second transistor (in the Darlington arrangement mentioned above) this should solve your problem. Or better yet, use a logic-level mosfet instead of the second transistor.
The easiest person to fool is yourself. -- Richard Feynman
 

Offline NeutronomanTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Motion Sensor Ciruit
« Reply #6 on: March 05, 2016, 04:28:55 pm »
How much current does your relay pull at 5V?
How much current can your transistor handle?
How much gain does your transistor have?
What kind of signal does your motion sensor put out?
What value base limiting resistor did you pick?
=======
I tested the relay and it pulls 60ma at 5vdc.
The transistor is a 2n2222a and will handle 600ma.
Gain(hfe) on the 2n2222 listed on the package is 200.
I bought the small motion sensor module from Banggood and don't have a datasheet and have no information about the output current, and only know that it's 3 vdc.
The resistor is 48 ohms.

I had tried a Darlington transistor pair earlier and it didn't work. Now that I have other problems solved, the Darlington pair did work. For my own better understanding I plan to keep working on getting all the information you asked for and doing the math despite the fact that it already works without doing that.

Now I'm working on getting the photocell to shut off the circuit during daylight. Once I accomplish that I will be ready to put this project into service.

I greatly appreciate the help I have received here. Couldn't have done this without it.
« Last Edit: March 05, 2016, 04:30:48 pm by Neutronoman »
 

Offline uncle_bob

  • Supporter
  • ****
  • Posts: 2441
  • Country: us
Re: Motion Sensor Ciruit
« Reply #7 on: March 05, 2016, 04:54:35 pm »
Hi

Ok at 1V the gain of the 2N2222 is rated at 50 (gain goes down as voltage drops). Saturation likely will require a bit more current.

So: the 2222 should do the job with between 1 and 5 ma into the base. If the sensor pulls fully to +5V, about a 1K base limit resistor should work. Anything less than that is un-needed if it pulls to +5. It may work with a resistor as high as 4.7K.

Bob
 

Offline NeutronomanTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Motion Sensor Ciruit
« Reply #8 on: March 06, 2016, 04:18:25 pm »
Hmmm. I wonder why they didn't put the gain on the package. I would think that is important. I also checked the datasheet and didn't see that number. Datasheets are complicated and I have a hard time understanding them. But since it seems that hfe is not gain, then what is hfe?

I guess I need to watch some more instructional videos on transistors.

Thanks
 

Offline uncle_bob

  • Supporter
  • ****
  • Posts: 2441
  • Country: us
Re: Motion Sensor Ciruit
« Reply #9 on: March 07, 2016, 12:53:14 am »
Hmmm. I wonder why they didn't put the gain on the package. I would think that is important. I also checked the datasheet and didn't see that number. Datasheets are complicated and I have a hard time understanding them. But since it seems that hfe is not gain, then what is hfe?

I guess I need to watch some more instructional videos on transistors.

Thanks

Hi

Transistors, regardless of what you call the gain, have a number of things going on:

1) The current through the collector changes, the "gain" is different at different current levels.
2) The voltage between collector and emitter changes, the "gain" changes as a result.
3) The temperature of the device changes, the "gain" changes as a result
4) You buy 100 parts and look at them, some have more "gain" some have less
5) You buy the same part number from different vendors, again there is a difference in "gain".
6) You decide you want < 0.7V between collector and emitter, "gain" is different in this region.
7) You vary the frequency, the apparent "gain" gets lower as frequency goes up.

That's the "easy stuff" before you get into the weird part of things.

It is rare to find a transistor data sheet that characterizes the part under every possible condition. If you find a data sheet like that, it probably is on a part you can't afford. All of the common parts are fairly loosely spec'd. That makes them easy to produce. Easy = low cost. Low cost = we like to use them.


Bob

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf