In AC if you have a resistive load (with little or no inductance) like a light bulb when you switch ON just at the peak of the cycle you get LOTs of voltage (about 380 in a nominal 240V system) and as many amps as the system can supply because a cold lamp filament has a very low resistance. If you arrange to switch on close to the zero crossing time the filament warms up as the voltage rises and the current stays smallish all the way to maximum voltage. The filament doesn't get time to cool down between cycles, so its resistance remains high while it is on, even when pwm at low on times. In your house lighting you take 'pot luck' when switching bulbs on, and one time in every couple of thousand you blow a bulb's internal fuses or filament at switch on. This is an unacceptable risk in frequently switched lighting (like stage lights, traffic lights, or the lights in MY HOME). Zero detection is easy - a diode and a pair of resistors can reduce the AC to pulsing DC that rises to be high enough to be detected by a PIC at zero crossing plus about 16% of the cycle. [Note - always use 2 resistors in series for mains detection - most common resistors are rated at 300V, 2 in series can handle 600V continuous or up to about 5KV in short duration line noise glitches]. A little bit of monitoring and some maths gets the exact zero crossing point and eliminates false triggering from glitches (a CRO helps here). Alternatively, if your circuit has a mains transformer, then take the AC from the secondary through a diode and a much smaller resistor. Calculate the total resistor value to reduce the peak AC (not the nominal) to the 5V that the PIC wants (don't forget the diode voltage drop as well). Work out how much power is being dissipated in the diodes/resistors too, you will probably need 1W types for mains voltages. Bye. > -----Original Message----- > From: Edson Brusque [SMTP:brusque@FLYNET.COM.BR] > Sent: Wednesday, 8 December 1999 6:02 > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [OT]? Lighting Controllers > > RE: [OT]? Lighting Controllers>You don't actually need to use an > optoisolator, there have been several dimmer circuits >that have run > directly from the mains with no isolation at all. The mains voltage is > >fed > directly to a PIC input via a current limiting resistor to detect zero > crossing >points. However, if the dimmer is going to be wired to someones > PC for control then >obviously this little scheme has it's drawbacks. > (like > electrocution). > > While we're off topic, I want to make good use of the opportunity and > ask how all this "zero crossing" thing works, for what is this for and > examples of detection circuits. > > Thanks for all, > > Brusque > __________________________________________________________________________ > _ > | | || |\| | || || |\|\ Edson Brusque :-^= (brusque@flynet.com.br) > | | || ||| | || || |||| Musician, Tech Consultant, Programmer, Developer > | |_||_||| |_||_||_|||| Blumenau / SC / Brazil / Earth / Milk Way... > | \_\\_\|| \_\\_\\_\||| Giro In'Italia homepage: www.flynet.com.br/giro > | | | | | | | || C.I.Tronics Lighting Designers: > www.citronics.com.br > |__|__|__|__|__|__|__||----------------- ICQ# 15937748 > --------------------- > \__\__\__\__\__\__\__\| The SoundFont Users Group Mailing List is at > ----------------------| http://www.geocities.com/SiliconValley/Port/6619/ > -------------------------------------------------------------------------- > --