Uh, you cannot use PWM to control an AC lightbulb (at least not the same way you can PWM a DC LED). Traditionally, you should delay the phase angle at which the triac fires.Use the PIC to detect when the AC line goes to zero. Then have a variable delay that turns on the optoisolator after you detect the zero-crossing. The longer the delay, the dimmer the bulb. You might want to search the web for some application notes. there are plenty of example circuits out there. I suppose you could use PWM if you make the period very slow in relationship to the frequency of your line voltage. maybe 10 cycles? That would be 200msec. The idea is to turn the lightbulb on for a few cycles, then off for a few cycles. I have no idea what effect this would have on the life of the bulb, or if it would produce noticeable flickering. You'd still want to measure the zero-crossing point. I'll be happy to explain more off-list. -----Original Message----- From: Andre Abelian [mailto:engelec@EARTHLINK.NET] Sent: Wednesday, February 14, 2001 4:33 PM To: PICLIST@MITVMA.MIT.EDU Subject: [EE]: dimmer with pic can't make it work Hi to all engineers. I am making a simple light dimmer for my kids and I am having hard time to make it work with a triac. I am using pic16c72 hardware pwm , MOC3010, and Power triac. The pic works fine I checked it with scope when I connect it thru opto triac the lamp suppose to turn on low and go higher brightness all I see while PWM goes from 0-70 % blinks a few times and stays on on higher duty cycle for load I use regular 110 v lamp. when I connect any LED on PIC output I can see it slowly increases the brightness I am not sure if same thing happening inside of MOC3010. I do not know what is wrong with it any help will highly appreciated. attached is the schematic. Andre -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body