Probably the safest bet would be to use an opto isolator. These are simple devices, that work like a switch. The input to the opto on the
24Vac side is an LED which gets turned on when the voltage is present. The output side is a transistor that gets turned on by the led. To make this work you would need a few simple components in addition to the opto. You would need to put a current limiting resistor in series with the 24Vac input and use a pullup resistor to your local power (I will assume +5v for this example) and then put a small cap to ground to filter out the glitches that occur when the AC input goes to zero. Basically the resistor and capacitor are in series between your power and ground with one side of the opto output connected between the two devices and the other leg at ground.. When no Vac is present, you will see your +5v at the component junction and when the Vac is present, this signal will go low (or pretty close to it - use a 1k or 10k pullup).- Vote on answer
- posted
18 years ago