Light/Dark battery protection?
Archiver
Posts: 46,084
Original Message
From: <orthner@s...>
To: <stamps@p...>
Sent: Saturday, March 11, 2000 5:23 PM
Subject: [noparse][[/noparse]STAMPS] Light/Dark battery protection?
>
> Hi,
> I've been working on this circuit for some time and it just isn't
> working the way I want it to. I have a battery operated circuit that I
want
> to switch off in total darkness. At anything less than that (even v. low
> light levels) I want the stamp to run. Right now I have the power line of
> the stamp switched by a NPN darlington with C to +5v, E to stamp and Base
> connected to +5v through a photocell. This lets power to the stamp at
> moderate light levels and turns it "off" in darkness but the threshold is
> wrong. The problem is that I need it to run even at low light levels and
> shutdown completely in darkness. The stamp is being switched on by an
> external reset and then runs it's program and turns itself off via another
> NPN darlington that switches the ground (-) line. Even at moderate light
> levels, the resistance of the photocell (~90K) is too great to pullup the
> base of the transistor...it only drops to a low enough value when flooded
> with light.
>
******* Duncan: *******
Darlingtons are great for current gain, but they are bad for voltage drop.
I suspect that part of the problem is too little voltage getting to the
stamp because of the darlington drop. Try connecting a PNP; E to +5, C to
stamp, and drive the base with your NPN darlington as follows: Ground the
darlington E, connect the darlington B to +5 thru the photocell, and connect
the darlington C to the PNP base thru 1k. A 2N2907 or 2905 would be a good
PNP.
>"via another NPN darlington that switches the ground (-) line." <<---
This is another concern. If the ground line of the stamp is grounded thru
another darlington, you are losing ~1V here. If this is the case, and you
must switch the gnd, use a single transistor like a 2N2222 or 2219.
Good luck,
Ray McArthur
Comments
>I've been working on this circuit for some time and it just isn't
>working the way I want it to. I have a battery operated circuit that I
want
>to switch off in total darkness. At anything less than that (even v. low
>light levels) I want the stamp to run. Right now I have the power line of
>the stamp switched by a NPN darlington with C to +5v, E to stamp and Base
>connected to +5v through a photocell. This lets power to the stamp at
>moderate light levels and turns it "off" in darkness but the threshold is
>wrong. The problem is that I need it to run even at low light levels and
>shutdown completely in darkness. The stamp is being switched on by an
>external reset and then runs it's program and turns itself off via another
>NPN darlington that switches the ground (-) line. Even at moderate light
>levels, the resistance of the photocell (~90K) is too great to pullup the
>base of the transistor...it only drops to a low enough value when flooded
>with light.
>There has to be a better way...any ideas?
Ray replied:
>Darlingtons are great for current gain, but they are bad for voltage drop.
>I suspect that part of the problem is too little voltage getting to the
>stamp because of the darlington drop. Try connecting a PNP; E to +5, C to
>stamp, and drive the base with your NPN darlington as follows: Ground the
>darlington E, connect the darlington B to +5 thru the photocell, and
connect
>the darlington C to the PNP base thru 1k. A 2N2907 or 2905 would be a
good
>PNP.
> >"via another NPN darlington that switches the ground (-) line." <<---
>This is another concern. If the ground line of the stamp is grounded thru
>another darlington, you are losing ~1V here. If this is the case, and you
>must switch the gnd, use a single transistor like a 2N2222 or 2219.
>Good luck,
>Ray McArthur
Duncan,
The darlington itself is a high-gain transistor, but the "emitter
follower" circuit you are using has a voltage gain of less than one. That
makes the turnon threshold sluggish as you observed. I agree with Ray that
you should be using a PNP transistor in a common emitter configuration,
allowing you to set your threshold as desired down to very low light
levels. The emitter not the collector is connected to +5 volts. Do not
use a darlington transistor, due the the extra voltage drop it would
introduce. Best to use a supergain transistor like the ZTX series. It has
to turn on real good to bring the collector solidly up to +5 volts to power
the stamp. For even higher gain and sharper turn-on, use a
photo_transistor_ instead of a photoresistor.
PNP ZTX1149
+5-o
e /
power to stamp
|
c
| | b
'-/\/\--o
R | choose R for threshold
|
/
\ photo resistor or xistor
/
\
|
common
I wondered about your "NPN darlington that switches the ground (-) line"
too.
-- Tracy Allen
Electronically Monitored Ecosystems
http://sss.emesystems.com
Original Message
From: Tracy Allen <emesys@c...>
To: <basicstamps@egroups.com>
Sent: Sunday, March 12, 2000 11:10 AM
Subject: [noparse][[/noparse]basicstamps] [noparse][[/noparse]STAMPS] Light/Dark battery protection?
Duncan wrote:
>I've been working on this circuit for some time and it just isn't
>working the way I want it to. I have a battery operated circuit that I
want
>to switch off in total darkness. At anything less than that (even v. low
>light levels) I want the stamp to run. Right now I have the power line of
>the stamp switched by a NPN darlington with C to +5v, E to stamp and Base
>connected to +5v through a photocell. This lets power to the stamp at
>moderate light levels and turns it "off" in darkness but the threshold is
>wrong. The problem is that I need it to run even at low light levels and
>shutdown completely in darkness. The stamp is being switched on by an
>external reset and then runs it's program and turns itself off via another
>NPN darlington that switches the ground (-) line. Even at moderate light
>levels, the resistance of the photocell (~90K) is too great to pullup the
>base of the transistor...it only drops to a low enough value when flooded
>with light.
>There has to be a better way...any ideas?
Ray replied:
>Darlingtons are great for current gain, but they are bad for voltage drop.
>I suspect that part of the problem is too little voltage getting to the
>stamp because of the darlington drop. Try connecting a PNP; E to +5, C to
>stamp, and drive the base with your NPN darlington as follows: Ground the
>darlington E, connect the darlington B to +5 thru the photocell, and
connect
>the darlington C to the PNP base thru 1k. A 2N2907 or 2905 would be a
good
>PNP.
> >"via another NPN darlington that switches the ground (-) line." <<---
>This is another concern. If the ground line of the stamp is grounded thru
>another darlington, you are losing ~1V here. If this is the case, and you
>must switch the gnd, use a single transistor like a 2N2222 or 2219.
>Good luck,
>Ray McArthur
Duncan,
The darlington itself is a high-gain transistor, but the "emitter
follower" circuit you are using has a voltage gain of less than one. That
makes the turnon threshold sluggish as you observed. I agree with Ray that
you should be using a PNP transistor in a common emitter configuration,
allowing you to set your threshold as desired down to very low light
levels. The emitter not the collector is connected to +5 volts. Do not
use a darlington transistor, due the the extra voltage drop it would
introduce. Best to use a supergain transistor like the ZTX series. It has
to turn on real good to bring the collector solidly up to +5 volts to power
the stamp. For even higher gain and sharper turn-on, use a
photo_transistor_ instead of a photoresistor.
PNP ZTX1149
+5-o
e /
power to stamp
|
c
| | b
'-/\/\--o
R | choose R for threshold
|
/
\ photo resistor or xistor
/
\
|
common
I wondered about your "NPN darlington that switches the ground (-) line"
too.
******** Tracy: ******
I like the simplicity of your circuit. I am going to check out the ZTX
series.
Ray McArthur
I tried both of your suggestions and they worked fine (I especially
liked being able to 'tweak' the light threshold in Tracy's design).
However, I didn't have a ZTX PNP on hand so I tried a 3906, both schemes
showed some small current leakage at moderate light levels *after* the
stamp had powered down at the end of it's program. Right now I have a NPN
transistor (ZTX449) switching the stamp power with the base connected to
+5v through the photocell, C to +5v, E to stamp. The solution to varying
the resistance was a <kludge>, but works very well. I used two photocells
in parallel, thus cutting the 'light on' resistance down. This allows the
stamp to run at all but the lowest light levels. Then I switch the stamp
ground with one of the I/O pins at shutdown using another ZTX449. The end
result is ~10uA drain while awaiting reset during daylight, and even less
in the dark. And it won't power up if reset in the dark.
Does any of this sound reasonable? I apologize for my poor grasp of
transistor theory...
Best, Duncan
Original Message
From: <orthner@s...>
To: <basicstamps@egroups.com>
Sent: Sunday, March 12, 2000 11:11 PM
Subject: [noparse][[/noparse]basicstamps] Re: Light/Dark battery protection?
>
> Thanks Tracy and Ray,
>
> I tried both of your suggestions and they worked fine (I especially
> liked being able to 'tweak' the light threshold in Tracy's design).
> However, I didn't have a ZTX PNP on hand so I tried a 3906, both schemes
> showed some small current leakage at moderate light levels *after* the
> stamp had powered down at the end of it's program. Right now I have a NPN
> transistor (ZTX449) switching the stamp power with the base connected to
> +5v through the photocell, C to +5v, E to stamp. The solution to varying
> the resistance was a <kludge>, but works very well. I used two photocells
> in parallel, thus cutting the 'light on' resistance down. This allows the
> stamp to run at all but the lowest light levels. Then I switch the stamp
> ground with one of the I/O pins at shutdown using another ZTX449. The end
> result is ~10uA drain while awaiting reset during daylight, and even less
> in the dark. And it won't power up if reset in the dark.
>
> Does any of this sound reasonable? I apologize for my poor grasp of
> transistor theory...
>
> Best, Duncan
*** Duncan: ****
<< both schemes showed some small current leakage at moderate light levels
>>
I assume that most of the leakage current you refer to is the current
through the photoresistor. I don't know your shutdown ckt, but it sounds
like it is stamp controlled. How about shutting down by using Tracy's ckt,
except ground the photoresistor through an NPN, (not darlington). Connect
the photoresistor to collector, emitter to gnd, and base to stamp control
pin thru 1K. If the stamp lowers this pin, the NPN should turn off and
power-down your stamp. You would have to raise this pin to get the circuit
powered-up. This should eliminate the leakage current. Ground the stamp
gnd pin in the "normal" way.
If this is a usable suggestion and you try it, let us know how it works.
Ray McArthur
>I assume that most of the leakage current you refer to is the current
>through the photoresistor. I don't know your shutdown ckt, but it sounds
>like it is stamp controlled. How about shutting down by using Tracy's ckt,
>except ground the photoresistor through an NPN, (not darlington). Connect
>the photoresistor to collector, emitter to gnd, and base to stamp control
>pin thru 1K. If the stamp lowers this pin, the NPN should turn off and
>power-down your stamp. You would have to raise this pin to get the circuit
>powered-up. This should eliminate the leakage current. Ground the stamp
>gnd pin in the "normal" way.
The self shutdown circuit is essentially the same as this ie. NPN, B to
stamp I/O pin, C to stamp, E to ground. The last line of the program (low
pinX) effectively kills the power to the stamp. Then when the stamp is
reset (wakeup), the first line of code restores power (high pinX). This
works well...but I will try using it <high side> with Tracy's circuit when
I get a chance.
Thanks, Duncan