On Sat, 10 Feb 2001 19:15:46 +1100 Roman Black writes: > There is a SPEC for the absolute max voltage allowable to > connect to a PIC pin and your 170 vdc peaks (not to mention > spikes) are way out of spec. All you need is a 5.1v 1w Zener > from the pin to gnd. This will give reverse voltage protection > (zener forward conduct) and will limit the max voltage that > can ever appear at the PIC pin to about 5v. Always use a > zener when there is a possibility that the volts could exceed > spec. I don't want to hear about internal clamp diodes, I > feel strongly about this like Bob does about overclocking > and Olin does about comments. Why don't you want to hear about internal clamp diodes? Are they not there? With the clamp and a reasonable current limit resistor, the voltage on the pin does not exceed max (nor does current into or out of the pin exceed max). I've never tried this trick with a 120VAC line, but I have thousands of units out there where we do zero cross detect from a transformer secondary being full wave rectified (peak voltage about +18V) and current limited into RB0. Why add a redundant zener? > > Also use a decent cap 0.1uF? across the zener. Adding a capacitor from the RB0 input to ground will add phase delay, possibly resulting in the zero cross being missed. >You can then > lower the 5mohm resistor to a more reasonable value like > 1mohm. Smaller resistors like 1/2w and 1/4w are rated at > 100v, like all small capacitors and unmarked voltage parts > are specced at 100 vdc max. A spec that many people ignore. > In TVs, they use a chain of 2 to 6 resistors for a voltage > divider with this voltage, and they still fail after a few > years. Use 2 Rs of 470kohm and of 1w size or bigger if you > can. > I agree that people often do not pay attention to the voltage rating on resistors... > Well designed units will have 10nF 500v ceramic caps across > each diode in the mains rect bridge. Also put a 1 ohm 0.5w > fusible resistor between the bridge and VB409, if VB409 goes > short this may save the user from electrocution, it may > also save the PIC and of course you have a good glass fuse > before the bridge? > I haven't seen the capacitors across diodes in any of the switching supplies I've looked at. I guess that's an attempt to protect them from excess reverse voltage during a line spike? I think a diode can generally tolerate overvoltage (it turns into a zener), but fails due to the high power dissipation with reverse conduction. This could possibly be prevented with overcurrent protection on the incoming line IF it can be made small enough to protect the diodes and still power the circuit. The VB409 is a non-isolated regulator (see http://www.st.com/stonline/books/pdf/docs/6941.pdf), so care against electrocution must be taken in any case. I've never built a PIC circuit that's connected directly to the line. I don't plan to... > Some tips for getting max reliability. Use series resistors > before anything critical, like the bridge, the VB409, etc. > Put a cap after the series resistor, this will give a RC > filter for spikes. The idea is to dissipate spike energy > into the series resistor and cap, and not the load, which > is a delicate semiconductor. Make the series resistor > as large as sensible power losses allow, I like 5% or more > if possible. You show no cap on the bridge, if the VB409 > requires full-rect unfiltered dc, you should still use a > small cap of 0.33uF or so across the bridge. Coupled > with the mains series resistor of 2.2ohm or so this > gives a pretty good spike filter. > Hope all this helps. > -Roman > > AND that 5.1v zener!!!!!!! I've pretty much designed glass fuses out of all our products. I'm now using PTC thermistor overcurrent protection (see http://www.bccomponents.com/Uploads/Datasheets/mID_4594_cID_3568_ptcts140 .pdf). The PTC is a self resetting overload device. Its cold resistance also provides some spike protection. It can even provide overtemp protection for your product! It's interesting, however, that no matter what I did, I could not get our safety lab to accept this for overcurrent protection for CE compliance, though they approved it for UL and CSA. So, we have to go back to glass fuses instead of this superior product (manufactured in Europe) on the products we ship to Europe... Oh well... Harold ________________________________________________________________ GET INTERNET ACCESS FROM JUNO! Juno offers FREE or PREMIUM Internet access for less! Join Juno today! For your FREE software, visit: http://dl.www.juno.com/get/tagj. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu