Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PIC - PCF8574 - MOC3020 - TRIAC

233 views
Skip to first unread message

Anti-Spam

unread,
Mar 11, 2011, 2:55:34 AM3/11/11
to
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?

Rich Grise

unread,
Mar 11, 2011, 4:04:41 AM3/11/11
to
Anti-Spam wrote:

PWM isn't applicable to AC; for dimming AC lights, you use "phase
control:"
http://www.google.com/search?hl=en&source=hp&q=%22phase+control%22

(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

Raveninghorde

unread,
Mar 11, 2011, 4:21:03 AM3/11/11
to
On Fri, 11 Mar 2011 01:04:41 -0800, Rich Grise
<ri...@example.net.invalid> wrote:

>Anti-Spam wrote:
>
>> 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?
>
>PWM isn't applicable to AC; for dimming AC lights, you use "phase
>control:"
>http://www.google.com/search?hl=en&source=hp&q=%22phase+control%22

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

hamilton

unread,
Mar 11, 2011, 8:39:43 AM3/11/11
to

Which PIC has an IC2 port ???

hamilton

linnix

unread,
Mar 11, 2011, 1:15:26 PM3/11/11
to

Is IC2 better than I2C?

Anti-Spam

unread,
Mar 11, 2011, 1:22:26 PM3/11/11
to

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?

Anti-Spam

unread,
Mar 11, 2011, 1:23:01 PM3/11/11
to
On Fri, 11 Mar 2011 06:39:43 -0700, hamilton <hami...@nothere.com>
wrote:

I thought many of them have???

hamilton

unread,
Mar 11, 2011, 4:08:23 PM3/11/11
to

OK, show me at lest one.

hamilton

Anti-Spam

unread,
Mar 12, 2011, 10:22:35 AM3/12/11
to
On Fri, 11 Mar 2011 14:08:23 -0700, hamilton <hami...@nothere.com>
wrote:

>On 3/11/2011 11:23 AM, Anti-Spam wrote:
>> On Fri, 11 Mar 2011 06:39:43 -0700, hamilton<hami...@nothere.com>
>> wrote:
>>
>>> On 3/11/2011 12:55 AM, Anti-Spam wrote:
>>>> 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?
>>>
>>> Which PIC has an IC2 port ???
>>>
>>> hamilton
>>
>> I thought many of them have???
>
>OK, show me at lest one.
>
>hamilton

Sorry, I got the terminology wrong, feel better?

Jan Panteltje

unread,
Mar 11, 2011, 4:24:04 AM3/11/11
to
On a sunny day (Fri, 11 Mar 2011 08:55:34 +0100) it happened Anti-Spam
<An...@Spam.com> wrote in <7kjjn6dnucuvdds8q...@4ax.com>:

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.

Grant

unread,
Mar 14, 2011, 8:36:31 AM3/14/11
to

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

Grant.

Q

unread,
Mar 14, 2011, 9:07:52 AM3/14/11
to
On a sunny day (Mon, 14 Mar 2011 23:36:31 +1100) it happened Grant
<o...@grrr.id.au> wrote in <ir2sn6lt1ditdeta2...@4ax.com>:

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.
http://www.panteltje.com/panteltje/pic/ethernet_color_pic/
So if you want to do that, then you may need to lock your clock with a PLL to the mains.

Grant

unread,
Mar 14, 2011, 8:14:43 PM3/14/11
to

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.

lang...@fonz.dk

unread,
Mar 14, 2011, 8:42:39 PM3/14/11
to
On 14 Mar., 13:36, Grant <o...@grrr.id.au> wrote:

> On Fri, 11 Mar 2011 09:24:04 GMT, Jan Panteltje <pNaonStpealm...@yahoo.com> wrote:
> >On a sunny day (Fri, 11 Mar 2011 08:55:34 +0100) it happened Anti-Spam
> ><A...@Spam.com> wrote in <7kjjn6dnucuvdds8qrkmdrarfvkt606...@4ax.com>:

>
> >>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?
>
> >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.
>
> So how about driving a MOSFET inside a bridge, to control AC lights then?
>
> Grant.

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

Grant

unread,
Mar 15, 2011, 5:03:47 PM3/15/11
to

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.
>
>-Lasse

josephkk

unread,
Mar 19, 2011, 8:12:23 PM3/19/11
to

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.

Grant

unread,
Mar 20, 2011, 5:34:02 AM3/20/11
to

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

Grant.

Anti-Spam

unread,
Mar 21, 2011, 7:16:13 AM3/21/11
to
On Fri, 11 Mar 2011 08:55:34 +0100, Anti-Spam <An...@Spam.com> wrote:

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?

josephkk

unread,
Mar 22, 2011, 9:55:47 PM3/22/11
to

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

0 new messages