Changes in Dimming Circuitry!

Im referring to this post >> http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1230333861/0 for getting my dimmer ready , the only thing i need to know is changes in the voltage regulator to handle 220-250Vac or something else added deleted from this circuitry.

Track down a 220-to-110 step-down transformer (a/k/a 110-to-220 step-up transformer)?

@ runaway pancake where ? i think in the mains for powering the arduino and other 5v circuitry only the transformer is needed or else the traics would be handling the current themselves

I guess that the resistors R2 to R5 will dissipate a lot of heat. Maybe a capacitor in series will help? I'm no expert, I just suggest what I read in this article: Marc's Technical Pages: Mains LED

the only thing i need to know is changes in the voltage regulator to handle 220-250Vac or something else added deleted from this circuitry.

What voltage regulator, I don't see any voltage regulator in the circuit? Just removing R3 and R5 and changing R2 and R4 to 47K 2 watt resistors should maintain the same led current for CK2 when running at 220vac.

Lefty

Why don't you just rig up one "switch" and see how that goes?
[Keep one hand behind your back at all times.]

I would approximately double the values of the 47K resistors and the 180 ohm resistors.

PS - that circuit isn't right. The top optocoupler should be one which accepts AC input, and the 4N25M doesn't.

I have changed the values and fitting in a 4N35optocoupler and not a 4N25 now

with the following circuitry:

@NI$HANT

I am doing the same thing here, except I will be using 1 channel ( one light ). The AC sampling circuit opto - 4N35 , in my opinion, I don't like it. Two possible circuit method : Telephone circuit method OR Transformer method. I am working on it at this time. I wil be using the Transformer Method, extract 120 Hz - not 60 Hz and place this pulse at the interrupt pin so I can sync with the main waveform so it is chop properly for proper light dimming. Just be aware that I live in Canada, so it 120 AC at 60 Hz.

As for the testing... I will breadboard the circuit and I will use 12 V AC from a wall wart transformer ( safer ) and use a 12 V light bulb. It should be the same effect. If work .... I will upgrade the circuit to operated with 120 V AC.

Parts depend on : opto-coupler transistor & triac - Power Triac <-- look at the datasheets and design accordialy

PS: I am sorry for your "incident"

Ok... NI$HANT... what is the TRIAC part number ? Need to find Ig max. Vpeak and Imax And what is the peak voltage <-- main side ? What is the max voltage of the opto-triac - M1 - M2 ?

In my case : opto-triac MOC3010 - Vpeak of 250 V AC <-- fine for me. Not you.
Power Triac - Q4008L4 Vpeak - 400 V AC - Imax - 8 A - Ig - 35 mA <-- fine for me. Maybe fine for you - your are 353 Vpeak - close by 50 V ac. :roll_eyes:

Thanks a lot sir, i will give you whole information about the TRIAC and other things:

The OPTO Traic here is MOC3023 - 247Q Vmax is 400V,ATTACHED - Datasheet

The Power TRIAC here im using is the BTA 12-600B , so 12 Amperes of power handling and 600 v max handling of current , i think is pretty nice solution, i also have a BT136 here.

I have found another very simple working circuit that also im attaching, please check it and tell should i use it for 220vac@ 50 hz here , i have modified the circuit to have 100K 1 watt resistors that i have checked definitely light up the LED in the 4n35 and interrupts happen flawlessly and im just caring about values to use in with the circuits resistor to be used at triac side , however im using 2 series 1/2 watt resistors that are about 1k.

MOC3023.pdf (176 KB)

AC CONTROLLER.sch (46 KB)

The OPTO Traic here is MOC3023 - 247Q Vmax is 400V

The Power TRIAC here im using is the BTA 12-600B , so 12 Amperes of power handling and 600 v max handling of current , i think is pretty nice solution, i also have a BT136 here.

You are fine. Ig for the power Triac is 50 mA. Set to 25 mA. Or follow the datasheet circuit of the MOC3023 to connect to a 240 AC system. I saw one in the Motorola datasheet.

It look like you insist to use the LED solution to sample the AC pulse. Which I call the "Telephone Ringer Method" You will get a 50 Hz pulse at the output of the opto-coupler. That is what you want ? I prefer the "transformer Method" it is safer in my opinion. You are dealing with 240 V AC for LOL ! :astonished: Did you have any power adapter - wall wart available ? Like 240 --> 6 - 12 V AC ? As a matter of fact, I do have one - from the garbage - of course... I am keeping it, BTW.

I am working on it... I use the "Transformer Method" and I just finish a simulation and I am ready for breadboard test. I already set-up my opto-triac and power triac circuit - 12 V setup... It switch ON and OFF just fine. 8)

Here the "sample" schematic. A simple rectifier to get a 120 Hz pulse, in your case 100 Hz, a comparator set very low ( around 0.1 to 0.2 V ) for Vref. When the pulse pass the ref point, it created a short pulse and it is buffer with a 74LS14 and the output of the buffer go to an interrupt pin. Oh, yeah, reduced the voltage AC in at least 3 V peak, no more than 4.5 V peak. <-- check the resistors ladder input circuit.

Thanks so much for your comprehensive definition.
Actually im just having problem at the Opto-Isolator Traic connection with Power triac and final connection with wallwart power. The rest im receiving the pulses successfully , i checked that and its fine.

I liked your idea of using 12v ac power supply ,well it helps keep FIRE works in control and thus things just do not fire out at you.
]:smiley:

Here an updated.

The inclosed schematic is not working. ( I tested last night ) I have no choise to modify my AC monitor circuit. Right now, I modify the circuit a bit. It is the same as the schematic, except I use dual-power line and I use an LM741. The pot is wire at + line, - line and the wipper to the - neg of the op-amp. I have a very sharp 120 Hz pulse. Just some adjusting the pot to get the right pulse width. Just need a extra circuit to place that signal into a TTL pulse.

Keep you posted...

OK... I DID IT !!! yes... My dimmer control code, circuit work just fine. 8)

I have to do a small modification to my circuit. At first, I received a 60 Hz pulse, try the code and ... nop... not working... :0

I did again with the input section, check to make sure I have a full rectifier waveform, and I have a 120 Hz interrupt pulse. :wink:

But it did not work... hum... I change the code --> from HIGH to LOW... to my surprise... IT WORK... it is dimming... :smiley:

Here the final code. Look simple. And a schematic.

/*
   Size : 1686
    
   A Dimmer AC control Program
  
   It simply control the intensity of a AC load.
  
   Need :  - AC Sampling circuit
           - Opto Triac and Power Triac 

   How it work :
   
   The sampling circuit make a pulse when a full wave rectifier
   signal reach close to zero. The sampling pulse are 120 Hz, being 
   taken by the interrupt pin, an analog voltage is being taken,
   calculate the Time OFF of the opto-triac to place in synchronazation
   with the AC voltage. And reset the state flag.
  
   By Serge J Desjardins
   aka techone / tech37
  
   Compiled, Tested and Calibrated
   Circuit tested with a 12 V AV voltage.
*/
// set the pins numbers
const byte sample_pin = 2;
const byte AC_pin = 12;
const byte set_pin = 1;

// for the interrupt flag
volatile boolean interrupt_state;

// pot output and the time off 
unsigned int pot_value;
unsigned int time_off;

void setup()
{
  // init analog reference, pins, interrupt and flag
  analogReference(EXTERNAL);
  // analogReference(INTERNAL(;
  pinMode(sample_pin, INPUT);
  pinMode(AC_pin, OUTPUT);
  attachInterrupt(0, detect_pulse_interrupt, RISING);
  interrupt_state = 0;
}

void loop()
{
  // check for the interrupt flag
  while( interrupt_state == 0)
  {
  
  }  
  // read pot value --> voltage
  pot_value = analogRead(set_pin);
  // convert the value
  time_off = map( pot_value, 0, 1023, 46, 8287);
  /*
     About 46 and 8287
    
     8.333 mS = 1 / 120 Hz or 8333 uS
    
     Half of a sine wave = 180 degree Full sine wave = 360 degree 
     
     46 uS = 8333 uS / 180
      
     8287 uS = 8333 - 46 uS 
  */
  digitalWrite(AC_pin, LOW); // AC off time
  delayMicroseconds(time_off); 
  digitalWrite(AC_pin, HIGH); // the rest of the time - AC on
  // reset the interrupt flag
  interrupt_state = 0;  
} 

// the interrupt routine
void detect_pulse_interrupt()
{
  // pulse is there - set flag to HIGH
  interrupt_state = 1;  
}

Here a picture of my set-up

And the waveform at the 12 V lamp

Dimmer_at_lamp.jpg

Here the waveform of the AC rectifier output VS interrupt pulse.

and here the waveform of the AC rectifier output VS Output pulse at pin 12.

That's really Great TechONe