Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
For general optocouplers like 4N35, 4N25, PC817, etc where the optocoupler is designed to be driven by DC, you need to rectify the 230VAC to ensure that the optocoupler gets a DC voltage. You also need to limit the current to the optocoupler using a series resistor. Calculate the series resistance as R = (Vin - Vf)/If
Remember that if you do not rectify the input using a full-wave rectifier, the opto-coupler will be off for half the cycle.
There are optocouplers that can be fed with AC input (current must obviously be limited). One such common optocoupler is TLP620.
i am going to develope my own protocol for sending 24 bit at a time yesterday i tried for its starting that through usin simulation in proteus and programmed in pic therse a lot of timming problem happening
an iam going to develope it on single wire communication