SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By dlotton
#177991
The resistor limits current into the base of the transistor. Mac probably picked the value based on previous experience with similar circuits. There are calculations you can do to figure out the 'optimum' value based on characteristics of the transistor and the output voltage of the sensor. That said, 1K will probably be fine.

The A-in from the DVR will not source enough current to supply the sensor. Aside from that, the transistor will basically short A-in to GND when the sensor is active(this is how it is signaling to the DVR that there was some kind of event). If you were powering the sensor from A-in, the sensor power will go to zero. You need to source power to the sensor from another place.
By Mee_n_Mac
#177993
IdahoMan wrote:What does the resistor do here? What values or factors did you use to decide on 1K?
It limits the amount of current flowing into the transistor's base, which looks like a diode, from base to emitter. 1k was just a good number given how little current I expect is needed through the collector. If you want I can go into more detail.

FWIW the PIRs datasheet seems to indicate that it might only be able to source ~0.27 mA. That's OK too.
IdahoMan wrote:If I understand the PIR sensor, it needs a constant power source connected to its GND(-) and Vdd(+). Then when triggered it outputs on the out(+). Looking at the diagram now shows the PIR without power. Is there no way to use the DVR A-In and GND terminals to power the PIR, or do I have to get it from elsewhere in the circuit (like off the mains)?
I didn't see any easy way to get 3.3 v power from the DVR. Certainly there exists some place on it's PCB that you could tack a wire to to get it. I just can't say where that is.

Your best bet is to use a simple 12 v to 5 v regulator to power the PIR. Perhaps a 7805 ?
https://www.sparkfun.com/products/107
It'll suck 6 mA just sitting there but that's small compared to the rest of your circuitry. If you ever reduce that consumption, then there are less power hungry regulators.
http://www.pololu.com/product/2831
By IdahoMan
#178000
Mac, dlotton,

Much thanks!

Just to be clear on the objective: When the PIR triggers, the DVR terminals (A-In and GND) should be momentarily connected. That's it. (Assuming the DVR's circuitry is sensitive enough that it will activate on even a split-second of the terminal's connecting,its programing and OSD can do the rest)

Let's look at my original diagram (PIC1):
PIC1.jpg
-If it is in standby (no motion), then there should be 3.3v being applied to E & C of the transistor and Vdd & GND of the PIR, yes? (The PIR specs is min:3v-max:6v, I don't know what transistor to use)

-And when triggered (motion), there should be 2.8v(3.3v - 0.5v) at 100uA coming from the PIR's Out to the B of the transistor.

-The transistor will activate and all the power will then flow from DVR GND to E, through the transistor, and from C to DVR A-In. Consequently, the closing of DVR GND and A-In would deprive power from the PIR and deactivate the transistor. Am I getting this?

This would all happen in the blink of an eye (hopefully just enough to activate the DVR) and everything would be reset until the next motion trigger? :? That's my hope anyway. Or is something in this write-up going to cause the power to be directed/jerked-around/rapid-banged in a way I can't see or won't anticipate and cause some kind of damage, or just not work? :?
You do not have the required permissions to view the files attached to this post.
By Mee_n_Mac
#178002
IdahoMan wrote:Just to be clear on the objective: When the PIR triggers, the DVR terminals (A-In and GND) should be momentarily connected. That's it. (Assuming the DVR's circuitry is sensitive enough that it will activate on even a split-second of the terminal's connecting,its programing and OSD can do the rest)
Correct. The transistor effectively becomes a short between it's collector and emitter, thus grounding A-In to start the recording.
IdahoMan wrote:-The transistor will activate and all the power will then flow from DVR GND to E, through the transistor, and from C to DVR A-In. Consequently, the closing of DVR GND and A-In would deprive power from the PIR and deactivate the transistor. Am I getting this?
Not quite. Recall the underlined above. What would happen if you connected a jumper cable between your cars battery + and - terminals, aka shorted the + supply to car ground ?

Nothing good ! The battery would try to send gobs of current through the low resistance wire (Ohms law) and both would heat up. The battery might explode (literally) or the wire melt open (like a fuse) or both. Same thing here, the supply to the PIR (not shown but assumed above) would burn out or the transistor might blow open.

Now you might be thinking "Hey I measured 3.3 v at A-In. Why can't that supply power to the PIR, just as shown in my diagram ? No other wire or supply needed." The answer to that lies in (what I believe is) the A-In circuit. It's an input to some logic gate that can't source any current. To put that gate into a known state and prevent false triggers there's also a "pullup" resistor tied between the A-In input and Vcc (3.3v).
Image
That's why you measured 3.3v. But if you draw current from A-In, it must go through the "pullup" resistor and that means a voltage drop across that resistor (Ohms law again). Therefore the voltage at A-In is;
Va-in = 3.3v - I*Rpu ; I = current draw, Rpu = the pullup resistance, probably 10k to 50 k ohms.
It doesn't take much current draw (30 uA max) by the PIR to drop 3.3v below the min working voltage of 3.0v.

Besides if the transistor did short out the supply to the PIR (and not burn up), where would the voltage come from to drive the base of the transistor ? How could PIR-out go high and stay high ? The DVR stops recording when A-In becomes unshorted, at least that's what I get from the Chinglish.
http://www.foxtechfpv.com/product/minid ... manual.pdf
It'll record when grounding the point(Alarm_in), and stop record when undo.
Is this, if true, a problem ?
By IdahoMan
#178044
Same thing here, the supply to the PIR (not shown but assumed above) would burn out or the transistor might blow open.
Of course, if I was taking a raw supply straight into the diagram picture above, but that wasn't the case here. In the diagram, the power would be coming from the very terminals that we wish to close.

Well, one point I gather from your response is that -with all circuitry considered as whole (PIR/TRANS & DVR)- the voltage from the A-In and GND terminals would probably drop below usable levels for the PIR. I was afraid of that.

When I said I wanted to be clear on the objective, I wasn't asking a question, I was stating a fact. The fact is, if the DVR works the way I expect it to, it should start recording on even the slightest split-second connection or A-In and GND. Then, it should record for a set amount of programmed time (Ex: 30s, 60s, 5m, 10m, etc.). It should ignore any more triggerings until done recording. So all I need from the triggering device (in this case a PIR) is to cause a quick "shorting"/"closing"/"Connecting" of A-In and GND. Yeah, I'm reading between the lines of the Engrish too. lol.

It may be silly, but when thinking of the transistor as a physical switch, bellow is what was going through my mind:
PIC1.gif
Back to the drawing board..
You do not have the required permissions to view the files attached to this post.
By Mee_n_Mac
#178045
Well, one point I gather from your response is that -with all circuitry considered as whole (PIR/TRANS & DVR)- the voltage from the A-In and GND terminals would probably drop below usable levels for the PIR. I was afraid of that.
Well you can it a try. The datasheet says that the PIR should draw between 46 - 60 uA when not detecting and running off of 3 V. The worst that can happen is that it won't work, either due to low voltage (you can measure it w/a DVM) or because the trigger pulse doesn't act as a trigger, but more like a start/stop control. Perhaps the pullup is a lot less than I anticipate !

When the PIR does detect, the current draw will jump, if only to drive the transistor ... and perhaps there's enough capacitance in the PIR to drive the base until the transistor shorts the PIR power.

First thing to try is an experiment to determine how the A-In "trigger" works. Power up the DVR and use a wire to short A-In to GND for < 1 sec. See what happens.
By IdahoMan
#178048
The NaPion series of this PIR says 170uA + 100uA. The WL seems to say 1-6uA + 100uA. If I reading the Datasheet right.

Maybe I should have gone with the WL series. Oh well, I'll play around.
By IdahoMan
#178331
I'm going to test the PIR with an old 2SC945 Transistor and an LED.

Here are the specs for the transistor: http://alltransistors.com/transistor.ph ... stor=17343
Learning about transistor ratings: Here & Here(pg119)

Testing the LED with a 100Ω resistor and a 3v source, I measured the LED as V=2.2v/R=275Ω and 8ma through the circuit. (I'll have to up the voltage to 4.5V and up the resistor so 2.2v will be supplied to the LED(a 330Ω resistor?))

Looking at the transistor's specs, the "Maximum collector power dissipation (Pc)" is 0.25W.

From the links abouve:

"Power dissipation: When a transistor conducts current between collector and emitter, it also drops voltage between those two points. At any given time, the power dissipated by a transistor is equal to the product (multiplication) of collector current and collector-emitter voltage."

Collector current: ..Understand that this maximum figure assumes a saturated state (minimum collector-emitter voltage drop). If the transistor is not saturated, and in fact is dropping substantial voltage between collector and emitter, the maximum power dissipation rating will probably be exceeded before the maximum collector current rating. Just something to keep in mind when designing a transistor circuit!"


How would the transistor be dropping voltage if it were not saturated, "Reverse Voltage"? And when the transistor does drop voltage between C and E, it wouldn't be more than around 0.3v right, depending on the transistor? If I am only using .008A(8ma) here, would that be W=.008Ax0.3V?

Step1: As for how much current to apply to the base: If the "Beta(hFE)" is 75min, then let's say .008A/80=100uA needed?
Step2: The PIR Vout would be 4.5v-0.5v=4.0v. In the example in one of the links above, they subtracted 0.7v from the "control voltage" to get the right amperage into the base. I don't know if I have to do that here; the PIR says it outputs 100uA(lout).

Also, the PIR is running off the same source voltage . Assuming that it will be absorbing 0.5v when active, that would leave 4.0v for the LED, TRANS and RESISTOR to work with? And what of the BE(0.7v) and the CE(0.3v)?

This sound about right?
By dlotton
#178345
Image

Haven't re-read the whole thread, but If you're still trying to connect this in the configuration shown above, my years experience is telling me you are most likely doomed to failure. At best, you may get it to work(unlikely), but if you do it will likely be inconsistent and the beavior may change based on ambient conditions (e.g. temperature).

In the configuration shown above you are powering the PIR from a source that the PIR (and transistor) will be shorting to GND when it activates. The PIR is shorting out its own supply. The results will likely be one of two scenarios; 1) the circuit will oscillate, or 2) it will reach some quiescent state where the supply voltage (which is also the input signal to the DVR) is reduced, but not low enough for the DVR to see it as a logic low signal.

I think you are spending a lot of effort on a scheme that is not likely to succeed.

If you don't like the idea of having a power source at the PIR, instead of running two wires between the DVR and the PIR, run three. One carries power, one is the 'ACTIVATE' signal, and one is GND. I assume you have a power source of some kind at the DVR, right?
How would the transistor be dropping voltage if it were not saturated, "Reverse Voltage"? And when the transistor does drop voltage between C and E, it wouldn't be more than around 0.3v right, depending on the transistor? If I am only using .008A(8ma) here, would that be W=.008Ax0.3V?
Think of the transistor as a variable resistance between C and E. The base current controls the resistance between C-E. Even at it's lowest resistance, the resistance is not zero. When current flows through a resistance, power is dissipated. That can either be expressed as the voltage across the resistor times the current through the resistor (V*I), or the square of the current through the resistance times the resistance (I^2*R), or the square of the voltage across the resistance divided by the resistance (V^2/R). Those are all equivalent terms P = V*I = I^2*R = V^2/R.

I don't mean to discourage your efforts, but as I said, I feel like your current approach has a near certain likelihood of failure. Just trying to save you some time and frustration in figuring that out.
By Mee_n_Mac
#178352
How would the transistor be dropping voltage if it were not saturated, "Reverse Voltage"? And when the transistor does drop voltage between C and E, it wouldn't be more than around 0.3v right, depending on the transistor? If I am only using .008A(8ma) here, would that be W=.008Ax0.3V?
Correct. I suspect that with this little current the Vce (sat) would be less than 0.3v, perhaps 0.1V. As for dropping voltage ... a transistor doesn't have to be saturated to work. In an audio amplifier there may be a large voltage across the C-E junction at the same time it's delivering a large current. That just isn't the case when used as a switch (as you're doing).
Step1: As for how much current to apply to the base: If the "Beta(hFE)" is 75min, then let's say .008A/80=100uA needed?
Step2: The PIR Vout would be 4.5v-0.5v=4.0v. In the example in one of the links above, they subtracted 0.7v from the "control voltage" to get the right amperage into the base. I don't know if I have to do that here; the PIR says it outputs 100uA(lout).
That's basically correct. You generally assume a low HFE and so drive the base harder than it might really need. That means the collector could sink more current than expected w/o coming out of saturation (and it's low Vce). The B-E junction (for a normal BJT) is just a diode, hence the ~0.7v drop used in the base calculation. The voltage across the base resistor will be the control voltage - Vbe (~0.7v).

Now it might turn out that the PIR output can only supply 100 uA. If that's the case and you setup the circuit to draw more, then the PIR output voltage will drop to less than the expected Vcc to Vcc-0.5.


Does the trigger input on the DVR act as you hoped; as a trigger and not as a run/stop switch ?
By IdahoMan
#178357
dlotton wrote:The results will likely be one of two scenarios; 1) the circuit will oscillate, or 2) it will reach some quiescent state where the supply voltage (which is also the input signal to the DVR) is reduced, but not low enough for the DVR to see it as a logic low signal.
Ok. That's kind of what I sensed would be the outcome.
dlotton wrote:I think you are spending a lot of effort on a scheme that is not likely to succeed.
No, just getting a feel for things here while learning electronics, and desperate for shortcuts.

As for the actual project (A trail-camera-ish covert field surveillance system)(See: other thread): They sell systems out there for that very purpose, but they are far over-priced and still don't do exactly what I want. They also sell multi-channel DVRs for vehicles. The biggest problem I am having is finding the actual equipment (DVRs,Cams,etc.). It's one of those things where you think "hey, they have trail cameras that last for months, and there are all the components out there, I'll just put my own together." But most of the stuff out there isn't what you think it is, and that's the discouraging part. And I can't build my own DVR.

Tempted to do something crazy like e-mail Reconyx and ask for their circuitry diagram for the heck of it. lol. Then hire some PCB manufacture to build a custom for me. Heck, for all this trouble I might as well buy the TrailCam, dismantle the components from the board(PIR/CAM/IR), and reassemble it to my liking. Quite "ghetto", but just simple enough to work.

Thanks again.


Sincerely,
IdahoMan
By IdahoMan
#178534
Mee_n_Mac wrote: Does the trigger input on the DVR act as you hoped; as a trigger and not as a run/stop switch ?
The PIR works great. I so much as breath and the test LED lights.

The DVR is unpredictable and not working as I had hoped.
By IdahoMan
#178557
While on the subject of transistor switches, are MOSFETs pretty much the same for the purpose?

What would you recommend for switching on a constant 21+Amp/12-16Volt load?
By IdahoMan
#181511
Alright,

I am going to need to power the PIR as illustrated in the upper-right of the picture below (ignore the bottom):
Image

But how..

Resistor?
Transistor-type doohickey?
"Buck Convert" thing?

It has to be extremely efficient. What kind of losses would I expect in mAs?


Sincerely,
IdahoMan
Last edited by IdahoMan on Sun Apr 26, 2015 5:54 pm, edited 1 time in total.
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]