I have several projects that involve sensing an end-user controlled voltage that can range significantly. Most commonly 120-240V AC or DC, but a few users have systems as low as 48V DC. My typical solution is a PS2505 optocoupler and a pair of 33k 1/2W resistors. The PS2505 has dual emitter diodes in a back-to-back configuration so it's polarity agnostic and it achieves saturation above about 5mA, but the LEDs can pass as much as 80mA safely. On one, I needed reliable sensing down to 12V. Sensing at low voltage isn't so much of a problem - limiting current at the high voltage is. I added a couple more resistors and a pair of zeners to limit maximum current to the opto. Works pretty well for zero-crossing detection as well - though I use a PIC and a bit of math to establish it more precisely. -Denny On Mon, Sep 16, 2013 at 5:33 AM, Carl Denk wrote: > I have a home project coming down the road mainly HVAC stuff of digital > inputs to a PIC probably a 18F??. THe inputs would be only to sense > on/off. The voltages would be 24 VAC, 120 VAC, and 240 VAC. I'm thinking > through an Opto isolator with a resistor and capacitor on the AC side. > Values ? Configuration? or something else? > > This is a low priority at the moment, but thought I would generate some > traffic for Bob. :) > > Thanks again. > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .