Here goes the "Optocoupler FAQ" again! Sean H. Breheny wrote: > Perhaps it's just me, but this doesn't seem like it would need an > optocoupler. Shouldn't, and it is a wasted component if the PIC will be powered from the same source as the electromagnet anyway. Optocouplers are for use in circuits where the supplies are isolated; that is *neither* terminal of *either* supply is common to the other. > I'd be tempted to solve the whole problem with a power darlington > (like one of the TIP series). Or a logic FET. > Add an additional 1.5k resistor from base to ground,to prevent self > turn-on. That may apply to the FET, but where would you find enough leakage current in your circuit, over the PCB or in the PIC to turn on a darlington? Of course once the PIC is initialised, it provides this function as the output pulls down (when you tell it to!). > I take it that the strike contains a motor? Not a door strike. You're thinking of the *real* security products; electric *bolts*. The ones that cost money! Byron A Jeff wrote: > I usually use the optocoupler not only for isolation but to bump up > the current. Only if you use one (darlington) with significantly greater than unity gain. The basic ones have a gain range between much less than unity and somewhat greater. Look, getting back to the isolation/ supplies thing, the critical part of this application is the layout of the wiring. It must be arranged so that the current/ voltage impulse cannot be coupled to the PIC circuitry. You certainly do not want the strike wiring using the same cable or in close proximity with input wiring to the PIC if at all possible. It will be assumed that the diode mentioned will be placed across the coil wires somewhere between the driving transistor/ supply and the coil itself. At the point of switchoff of the transistor, the current in the coil does not change but the voltage on the transistor collector moves suddenly from its saturation voltage (1V for a Darlington) to one diode drop above the supply. Such a transient could couple capacitively to a high-impedance PIC input so must be physically separate on the PCB. While the coil current changes only slowly due to the diode and its inductance, the current in the supply and the darlington stops abruptly. The traces carrying this current therefore must also be kept separate from the PIC circuit including its power supply. The PIC's regulator should have separate wires returning to the main supply capacitor (presumed that the supply for the strike is smoothed but not regulated) to achieve this. Finally, the line from the PIC to the darlington should probably have the base resistor at the darlington end and this line may be run in company with the PIC (regulator) supply lines but not the strike supply lines. It may be that the supply bridge and capacitor are on the same PCB with the Darlington, the PIC regulator and the PIC. If so, these principles apply to the PCB design and the order of arrangement of components should be just as listed. -- Cheers, Paul B.