Driving an optocoupler from 28V AC? - Page 1
Forum section: electronics / beginners

author: Dave Wave
author_rank: Contributor
timestamp: August 29, 2012, 04:41:56 pm
content: I want to drive an optocoupler from a 28V AC source that will output a signal to an Mega8 microcontroller so I can read if the source is off or on.I am assuming the 28VAC will be noisy as it direct from a transformer and driver relays that are switching 120vac, hence the optocoupler.My intital thoughts are use a full wave rectifier to convert to DC, then a small resistor to drop the current for the optocoupler. I assume this is going to be wasteful with the resistor radiating a couple watts or so.Is there a more elegant solution to my issue?Thanks for the help,-Dave

author: SeanB
author_rank: Super Contributor
timestamp: August 29, 2012, 05:59:25 pm
content: Single IN4148 diode in reverse across the IR diode in the optocoupler, then a resistor to allow 2-3mA to flow in the optocoupler. 10-12K rated at 0.25W resistor will do. You can also get an opto with AC input, it has 2 diodes in the device connected in anti parallel. To filter you take the output and use a RC filter to get the signal and remove the 50/60Hz hum on it.

author: Dave Wave
author_rank: Contributor
timestamp: August 29, 2012, 09:48:03 pm
content: Quote from: SeanB on August 29, 2012, 05:59:25 pmCan you explain the RC filter a little more? Do I want a notch filter at 60hz?Thanks!Dave

author: PSR B1257
author_rank: Frequent Contributor
timestamp: August 29, 2012, 10:34:21 pm
content: QuoteNo, just a lowpass.Try this circut.The Output-Signal is inverted off course do to the open collector output of the optocoupler, but that shouldn't be a problem I think.

author: David_AVD
author_rank: Super Contributor
timestamp: August 30, 2012, 12:07:58 am
content: That circuit looks overly complicated. All you need on the AC side is a series resistor and the reverse diode. You can add a capacitor across the opto output to get rid of the ripple. The value of the capacitor will depend on the pullup resistor value of course. Maybe try 1uf and a 10K pullup to start with.

author: PSR B1257
author_rank: Frequent Contributor
timestamp: August 30, 2012, 06:24:55 am
content: QuoteThat's right, there is no need for D1.QuoteSure, but where is the difference to have the capacitor on the one or the other side?QuoteLT Spice gives a 3V outputripple for this RC-combination. With 22µF and 10kOhm only 300mV.

author: David_AVD
author_rank: Super Contributor
timestamp: August 30, 2012, 07:43:32 am
content: Quote from: PSR B1257 on August 30, 2012, 06:24:55 amThere's more than one way to do this of course. The capacitor on the output side can often be lower voltage. The OP can try these circuits for real and adjust R/C to taste.

author: ttp
author_rank: Regular Contributor
timestamp: August 31, 2012, 04:04:44 am
content: Quote from: Dave Wave on August 29, 2012, 04:41:56 pmIf you rectify 28Vac it will give you about 40Vdc, set a current of 5mA for the optocoupler and the power is less than 0.2W. If you add a cap to filter the DC (doesn't have to filter very good, just enough to keep the LED in optocoupler going to the next peak) you get a steady signal at the optocoupler output.I hope you realize that using just a diode and resistor you'll get a pulse train on the output when the AC is on.

author: David_AVD
author_rank: Super Contributor
timestamp: August 31, 2012, 05:06:13 am
content: I've used 47K as the input resistor to the opto-coupler before. A 1uF capacitor across the opto's output worked well in conjunction with the pull-up resistor on a PIC chip.