> I have a voltage source which is the voltage drop across a dorr > bell button. The bell is an electronic type requiring a diode > across the button so what you see, there, is half-wave DC > ranging from mostly 0 volts up to around 7 with a lighted button > and this will jump up to about 17 or 24-volts peak when the > little incandescent lamp burns out in the button which is > guaranteed at some future date. >=20 > This is nice dirty half-wave DC at power line frequency > and I want to know when someone presses the button by detecting > the absence of the signal. >=20 > The plan is to use an opto-isolator with the pulsating > DC driving the LED through a current regulator so that the LED > will see about 15 milliamps over as much of the curve as > is practical. >=20 > One way to keep the parts count down might be to use > either a 7805 (5-volts) or a LM317 regulator with a couple of > resistors to set it to around 3 volts and then connect the LED > through the optocoupler through an appropriate current limiting > resistor. The circuit will provide a pulsating flat-topped wave > so the output of the optocoupler will need to be cleaned up but > my question is whether this pulsating input to the voltage > regulator will cause unforeseen problems or whether I should > just build a current regulator out of a single transistor, a LED > and resistor? One of the lowest parts count current regulator circuits is an LM317 with o= ne=20 resistor (circuit in most LM317 data sheets as an application example or se= arch web=20 images for LM317 current regulator). Resistor from Vout pin to Adj pin, app= ly Vin to=20 Vin, your LED or optocoupler from Adj pin to GND. R1 is approx =3D Vref/Iout =3D 1.2V/0.015A =3D 80 Ohms. How about swapping out the lamp in your door bell switch with an LED (will = last=20 forever then) and put in series with the optocoupler so it gets regulated c= urrent as=20 well? --=20 Brent Brown, Electronic Design Solutions 9 Titoki Place, Pukete, Hamilton 3200, New Zealand Ph: +64 7 849 0069 Fax: +64 7 849 0071 Cell: +64 27 433 4069 eMail: brent.brown@clear.net.nz --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .