Marechiare ha scritto: >[...] > Why not some simple scheme with Zener diode and an optocoupler to send > a signal to the PIC when the peak voltage is higher than some certain > level? > > Two voltage dividers and the optocouple between them. One divider > would have a Zener instead of the bottom resistor. Select the resistor > values the way that the shortest signal would correspond to the bottom > value of the desired voltage range. Measuring length of the signal you > could figure out the peak voltage. Hmmm, a nice approach :) I used that circuitry - actually with a .47nF 630V capacitor - to make up a "220V presence sensor" which alerts me of when mains goes away (you know, interfacing to the UPS is never easy :) because of protocols etc; and anyway I wanted a more generic method). I'd like to try your method of "measuring the peak width in order to get the peak amplitude", I'll check it... Still, using some "large" resistors (or the large capacitor) is not that smaller (and maybe cheaper) than the transformer. but thank you ! -- Ciao, Dario -- Cyberdyne -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist