Charge/Low Voltage Sensing Circuit: Will This Fry a Pin? Do I need the schmitt?

I cribbed this charge-sensing circuit from an old (~70s) book on electronics and robots, and since I had the parts, I wired it up.
It works perfectly -- I get a logic 0/1 on PIN when the charger is hooked up to my bot, and I've bench tested the short-circuit diode (D1) and fuse protection.
However, before I hook it up to an actual pin on my Stamp, I want to know if it's OK. I'm a little concerned that the R2 pull-up should be a higher value? and maybe I should put in a 220 protection resistor between the circuit and the Stamp pin? Any other possible problems? I'm still pretty much a newbie at circuit design.
I'm using this because eventually I'm going to have my bot seek out it's charger and then it needs to know that it's hooked up. I use a trickle charger and when the current drops to, well, a trickle, the output of this circuit goes back to logic 0. There are charging prongs on the front of the bot, hence the need for short-circuit protection across those terminals.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
Post Edited (Zoot) : 10/4/2006 10:51:26 PM GMT
It works perfectly -- I get a logic 0/1 on PIN when the charger is hooked up to my bot, and I've bench tested the short-circuit diode (D1) and fuse protection.
However, before I hook it up to an actual pin on my Stamp, I want to know if it's OK. I'm a little concerned that the R2 pull-up should be a higher value? and maybe I should put in a 220 protection resistor between the circuit and the Stamp pin? Any other possible problems? I'm still pretty much a newbie at circuit design.
I'm using this because eventually I'm going to have my bot seek out it's charger and then it needs to know that it's hooked up. I use a trickle charger and when the current drops to, well, a trickle, the output of this circuit goes back to logic 0. There are charging prongs on the front of the bot, hence the need for short-circuit protection across those terminals.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
Post Edited (Zoot) : 10/4/2006 10:51:26 PM GMT
Comments
I'll plug it into a pin with 10K resistor and try it out. Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
I have a few questions because I realized that while the circuit works great, I don't understand everything about it.
- do I need the Schmitt inverter that goes to my low voltage pin if I account for invalid logic levels in software (i.e., a kind of "debounce" or count on the pin before declaring that a real low voltage state on my battery exists)?
- if I omit the schmitt inverter, would I need to put a limiting resistor between the Norton IC and my Stamp pin?
- related -- if you use the output of a Schmitt, do you never need a limiting resistor between the inverter output and a Stamp pin? I guess what I'm asking is if you had bad voltage/current on the input to the Schmitt, I guess you could fry the Schmitt, but you wouldn't fry the Stamp pin?
Any commentary or advice is greatly appreciated in advance.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1)···if· charger··=·· < 12.7V·····and · PIN= 5V····then· PIN·· outflows 5/470 amps and no current flows into battery
2)·· if charger =· >12.7V····· and·· PIN = 5V·· then·· PIN· doesn't source or sink current and there is unknown·current flow into battery from (+CHARGER)
3)·· if charger = < 12.7V··· and·· PIN = 0V·· then· nothing happens
4)·· if charger = > 12.7V and PIN = 0V·· then· PIN·· has a miniscule amount of sinked current·· ZD1 has exceeded breakdown voltage and is conducting
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
Regarding the Schmitt trigger, I think you can easily combine the comparator and the Schmitt trigger
with the addition of a single resistor. Take a look at the National LM3900 data sheet. It shows a Schmitt
trigger diagram.
However, a software Schmitt trigger will do the same job.
Regarding protecting a Stamp pin, I would suggest using a series resistor of at least 220 ohms whenever
you are connecting a Stamp pin to the output of another device, such as a comparator or logic gate. This will
prevent an accidental overload on the Stamp pin in case you inadvertently make Pin 14 an output.
DaveG
This answers such a basic newbie question for me, thanks again. I have been wondering why on some circuits I see there is protection between the Stamp and a TTL circuit and sometimes there isn't....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST