Go Down

Topic: dimmer circuit idea for ac? (Read 2 times) previous topic - next topic

Runaway Pancake

#10
Nov 28, 2012, 01:29 am Last Edit: Dec 01, 2012, 01:54 am by Runaway Pancake Reason: 1
So, I had a "great" idea this morning to get around the TRIAC and the holding current.
I couldn't wait to get home to try it out.
What's the deal?
Don't use the TRIAC!    :)
Just use the triac driver.  It can handle the low current demand of one LEDlight string.  Don't push it; it's one each.
And works pretty good it does, I must say.
Before anyone gets too excited, it still needs a zero-cross reference (see my blog.)
And it can't be triggered on like a TRIAC, the logic input must be kept active throughout.
So, I still delay from the zero-cross then I turn on the MOC3023 and hold that for nearly all of the alternation.  Then it goes back and waits for another zero-cross.

Here's the modification

See more at my blog
http://incredulist.blogspot.com/2012/11/ac-phase-control-triacs.html

Here's the youtube demo:
http://www.youtube.com/watch?v=nce830WBTjM

Here's my coarse fading sketch:
Code: [Select]

//   MOC3023_HolidayFade_02
//   re-write, using better names
//   and derived from
//   ***  Triac_03  ***
//   running one light string
//   directly from the
//   output of the MOC3023
//   This works better
//   no TRIAC holding current

byte MOC_logic = 3;  // alias output
byte Intensity;      // conduction angle
byte startPosition;  // delay time till start
int index = 0;
volatile boolean zeroCrossed = false;  // Flag

void setup()
{
 pinMode(MOC_logic, OUTPUT);
 attachInterrupt(0,cueStart,RISING); // Ext_Int on D2
}

// ***** ***** ***** ***** //
void loop ()
{
 if (zeroCrossed == true)
 {
   enableOutput();
 }
}
// ***** ***** ***** ***** //

// ----- The Interrupt -----
void cueStart ()
{
 zeroCrossed = true;   //  !!!
}
// ---- ---- ---- ---- -----
// ---- ---- ---- ---- -----
void enableOutput ()
{
 fade();
 startPosition = (8 - Intensity); // "delay angle"
 // startPosition + Intensity must = 8 (8 msec)
 // because ea. alternation of 60 Hz is 8.333 msec
 // haven't looked at this on the scope yet
 // maybe using delayMicroseconds could drag the end
 // of Intensity closer to the end of the half-cycle
 // what's unknown is "instruction time" usage
 delay (startPosition);
 digitalWrite(MOC_logic, HIGH);  
 delay (Intensity);               // "conduction angle"
 digitalWrite(MOC_logic, LOW);
 zeroCrossed = false;  // Reset
 index ++;
 if (index > 240)
 {
   index = 0;
 }
}
// ---- ---- ---- ----
void fade ()
{
 // not a lot of difference between
 // Intensity = 6 and Intensity = 7
 if (index < 30)
 {
   Intensity = 6;
 }
 else if ((index >= 30) && (index < 60))
 {
   Intensity = 5;
 }    
 else if ((index >= 60) && (index < 90))
 {
   Intensity = 4;
 }  
 else if ((index >= 90) && (index < 120))
 {
   Intensity = 3;
 }
 else if ((index >= 120) && (index < 150))
 {
   Intensity = 2;
 }
 // Intensity = 1 is very low
 // fade up  
 else if ((index >= 150) && (index < 180))
 {
   Intensity = 3;
 }  
 else if ((index >= 180) && (index < 210))
 {
   Intensity = 4;
 }
 else
 {
   Intensity = 5;
 }
}

I'm sure that it could be made smoother by using delayMicroseconds or incorporating millis().
When you guys work that out, please post about it here.

Hey, people, please keep your wits about you and respect the power of the juice always!

> > > Came back and took some lines out, vestigials from my original (TRIAC-rel'd) code.
> > > Modified circuit to direct connect Neutral to socket and bring in Line through 3023
> > > No Replies.  Bummer, Dude.

> > > 30NOV2012 New & improved code, with up/down fade.  New youtube demo.
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Runaway Pancake

I got out my TRIAC circuit and ran it with the sketch above and it worked great.
One low current, same as in the latest demo.
The difference is that it keeps the Gate on throughout the conduction angle, dropping out just before the alternation ends; it does not merely trigger (pulse) the Gate at the beginning of the conduction angle.
A TRIAC can handle more current, so you can do more strings (or bundles, or strands, or whatever you've got.)

http://incredulist.blogspot.com/2012/11/ac-phase-control-triacs.html
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Runaway Pancake

#12
Dec 01, 2012, 05:13 am Last Edit: Dec 01, 2012, 05:21 am by Runaway Pancake Reason: 1

I got out my TRIAC circuit and ran it with the sketch above and it worked great.
One low current, same as in the latest demo.


> > > I have to walk that back some.  I had put the scope away, but I decided to bring it back out and have a look.  Despite improved fading over the way it was before, I saw on the scope that it was only conducting on one alternation, asymmetrical.  Then I plugged the 40W lamp in with it and it looked even better than with the MOC3023.  It's totally textbook with the lamp plugged into it.
So, one "strand" isn't enough to do it with the TRIAC.  My strand takes 20ma.  My TRIAC's (BCR8N) holding and trigger current are both 100ma, which means a load of at least 12w (ballpark). Maybe 5 would do it to it, but I don't have that many to confirm.
Still, the MOC3023's aren't a bad way to go for this application.
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Go Up