Harold M Hallikainen wrote: > > It's a pretty sophisticated light dimmer you > > have there! ;o) > > It's sold to dentists for curing composites used to fill teeth! Excellent! Top-dollar medical market with no chance of killing someone if your product fails! You've go it all worked out... ;o) > > Did you get any phase shift problems measuring > > zero cross at the isolated secondary of the > > transformer? > > No problem. Recall that we're detecting a negative edge on the RB0 > input, so we're a little before zerocross. I've also used this technique > in another product (the Shoebox dimmer at http://www.dovesystems.com). I really like that! A pre-zero cross if you like. This avoids all the switching hash on the mains that occurs on or just after the zero cross. It also means that your triac'd load is always on at the end of the cycle when you detect, not at the start where your load may or may not be on. Brilliant! :o) > >What about when the triac switches > > and current is drawn from the transformer... > > To reduce transformer size, it's an autotransformer. The lamp is driven > thru the triac off the 30V tap on the primary. A separate isolated > secondary powers the PIC and allows detection of zero cross and > measurement of RMS. Yep I got that, I was worried that the triac turn-on might affect the zero cross but your clever pre-cross system eliminates that. Good project. Hope you sell heaps. :o) -Roman -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics