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?
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.
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.
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.
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
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.
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.
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.
I suggest that you start with mains synchronization. Required just make = a dimmer produce consistent results. Then worry about many channels. Then the fancies.
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.