PIC - PCF8574 - MOC3020 - TRIAC

I am designing a mains voltage light show controller, for controlling

40 channels of lights. Need some advice please. I am programming in PicBasic using the IC2 and the PWM routines. The PIC I will use will have a IC2 port. My question is, will the PWM function work for dimming the lights?
Reply to
Anti-Spam
Loading thread data ...

PWM isn't applicable to AC; for dimming AC lights, you use "phase control:"

formatting link

(OK, admittedly, at least one of these sources compares phase control to "AC PWM," but I've never used the terms interchangeably.)

Hope This Helps! Rich

Reply to
Rich Grise

You use a zero crossing detector and sync the pwm period to the mains half cycle. It'll work well enough for jazz.

Reply to
Raveninghorde

On a sunny day (Fri, 11 Mar 2011 08:55:34 +0100) it happened Anti-Spam wrote in :

Thats is an opto-triac, and once on, it will stay on for the rest of the period. So, no. You need to find the zero crossing and then count until you fire the triac. Very basicaly the PWM will only work if your lights runs from a DC source, and you drive them with a MOSFET or transistor of sorts.

Reply to
Jan Panteltje

Which PIC has an IC2 port ???

hamilton

Reply to
hamilton

Is IC2 better than I2C?

Reply to
linnix

I can add a Zero Crossing Detector, reasonably easily. Scrub using PWM and do my own timing to trigger the Triacs.

Because the MOC3020 (as I understand it) has a zero crossing detector buit in, I assume I will have to use a different device without ZCD?

But will the time it takes for the PIC to issue a IC2 command, and for its content to hit the output port of the PCF8574, not be a problem?

Reply to
Anti-Spam

I thought many of them have???

Reply to
Anti-Spam

OK, show me at lest one.

hamilton

Reply to
hamilton

Sorry, I got the terminology wrong, feel better?

Reply to
Anti-Spam

So how about driving a MOSFET inside a bridge, to control AC lights then?

Grant.

Reply to
Grant

On a sunny day (Mon, 14 Mar 2011 23:36:31 +1100) it happened Grant wrote in :

period.

That will work, but you may get aliasing between the PWM and the mains frequency, I had a similar aliasing problem using 3 independent PWM generators for RGB, and fixed it by using a common clock for 3 PICs.

formatting link
So if you want to do that, then you may need to lock your clock with a PLL to the mains.

Reply to
Q

period.

frequency,

the mains.

Quite possibly, I remember a sound to light project I made as a teenager that aliased bass notes with the mains frequency to create a flashing light instead of the expected steady light. It was three bandpass filters feeding three TRIACs for lo, mid and hi frequencies (musicolour, an EA magazine kit from early 1970s).

I've seen an SCR used inside a bridge, but not a MOSFET. At least putting the switch inside a bridge means you're not running high voltage DC around the lighting fixtures and stuff not rated to quench a DC arc.

Grant.

Reply to
Grant

period.

you can do that, I've seen it done on reverse phase angle dimmers, i.e. instead of turning on during cycle and off at zero crossing, it is turned on at zero and off during the cycle. I guess you could do "real" pwm too

also seen back to back nfets used as a switch for mains

with a fet you can get quick turn off so if you measure the current and add that to the control you could make it pretty much short circuit prof

-Lasse

Reply to
langwadt

period.

That sounds like a big plus :) An idea for later, at the moment I'm doing low voltage LED lighting, although a recent prototype runs >100V to 50 LEDs in a series string. Powered from 12 or 24V DC.

Grant.

Reply to
Grant

Before i read any others posts; i suppose you could do it that way. You would have to have 40 PWM outputs though (one per channel). Plus some = way to synchronize them with the mains, otherwise the triacs would = effectively be firing randomly.

Bluntly, the triacs are PWM outputs, with mains timed start pulses and = off at the end of every half-cycle.

Reply to
josephkk

Forty channels, across phases too? Take care synching to the correct phase ;)

Grant.

Reply to
Grant

OK, did not really think the Dimming problem through. So have decided not to use the PCF8574, and use a PIC in its place. In fact will drop I2C altogether in favour of Serial Comms, and use a PIC with a UART port instead. Will also drop the MOC3020, for a opto/triac isolator, with no Zero Crossing detector. Will do my own zero crossing detection, with a opto isolator, going back to the PIC.

I am thinking on the lines of having 5 slave boards (each having 8 lamp output channels), each slave having its own unique address (set by DIP switches), but all the SERIN inputs of the 5 slaves, wired in parallel.

I read somewhere that a PIC UART can only hold 2 bytes of data, so the Master controller board would send 2 Bytes of data, for each lamp it wants to control. The 1st byte would would contain the address of the board/lamp it wants to switch and the 2nd byte stating how long the fade up/down time should be, for that lamp.

Am I now thinking on the rights lines?

Reply to
Anti-Spam

I suggest that you start with mains synchronization. Required just make = a dimmer produce consistent results. Then worry about many channels. Then the fancies.

Reply to
josephkk

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.