Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

AC Dimmer circuit explanation

Status
Not open for further replies.

imraan

Newbie level 4
Joined
Apr 17, 2013
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,330
Could someone please provide me a little explanation on the workings of this circuit and how the components are used.

I have this project I would like to implement for school, but to be honest I lack a bit of understanding of it and would like to know a bit more why these components are used and how they integrate into the code instead of just buying them and using it.

It is an Arduino project, and wasn't sure if I should post it in that forum section, but I needed to grasp the electrical side too so that was my thinking of posting here.

Any help appreciated thank you.

Dimmer.jpg

Code:
/*
AC Voltage dimmer with Zero cross detection

Attach the Zero cross pin of the module to Arduino External Interrupt pin
Select the correct Interrupt # from the below table:
(the Pin numbers are digital pins, NOT physical pins:
digital pin 2 [INT0]=physical pin 4 
and digital pin 3 [INT1]= physical pin 5)

 Pin    |  Interrrupt # | Arduino Platform
 ---------------------------------------
 2      |  0            |  All
 3      |  1            |  All
 18     |  5            |  Arduino Mega Only
 19     |  4            |  Arduino Mega Only
 20     |  3            |  Arduino Mega Only
 21     |  2            |  Arduino Mega Only

In the program pin 2 is chosen
 */

int AC_LOAD = 3;    // Output to Opto Triac pin
int dimming = 128;  // Dimming level (0-128)  0 = ON, 128 = OFF
/* Due to timing problems, the use of ‘0’ can sometimes make the circuit 
flicker. It is safer to use a value slightly higher than ‘0’
*/
void setup()
{
  pinMode(AC_LOAD, OUTPUT);// Set AC Load pin as output
  attachInterrupt(0, zero_crosss_int, RISING);  
// Chooses '0' as interrupt for the zero-crossing
}
// the interrupt function must take no parameters and return nothing
void zero_crosss_int()  
// function to be fired at the zero crossing to dim the light
{
  // Firing angle calculation : 1 full 50Hz wave =1/50=20ms  
  // Every zerocrossing thus: (50Hz)-> 10ms (1/2 Cycle) For 60Hz => 8.33ms

  // 10ms=10000us
  // (10000us - 10us) / 128 = 75 (Approx) For 60Hz =>65
  int dimtime = (75*dimming);    // For 60Hz =>65     
  delayMicroseconds(dimtime);    // Off cycle
  digitalWrite(AC_LOAD, HIGH);   // triac firing
  delayMicroseconds(10);         // triac On propogation delay
                                 //(for 60Hz use 8.33)
  digitalWrite(AC_LOAD, LOW);    // triac Off
}
void loop()  {
 for (int i=5; i <= 128; i++)
{
 dimming=i;
 delay(10);
 }
 }
 

Hi,

A forum is not meant to replace school. You need to learn the basics on your own.
We are here if you have problems with circuit details.

* first read how a dimmer works.
Then you will know why there is the need for a zero cross detector circuit.
One detail here, that is not included in a general dimmer circuit, are the optocouplers.
The optocoupler just is a safety device to isolate dangerous line voltage from safe arduino voltage

Klaus
 
  • Like
Reactions: imraan

    imraan

    Points: 2
    Helpful Answer Positive Rating
Thank you, that helps as well, knowing which topics to read up on.

Well I've never really been a physics student and tend to focus more on the coding side of things, so that's why I hoped to get an explanation of the the workings of the circuit to help my understanding and know what I should read up on.
 
Last edited:

Hi,

A dimmer is not complicated:
ZeroCross --> adjustable delay --> trigger
What did you understand so far.
And where exactly do you need help. Please ask a detailed question, not a global one.

Klaus
 

Well I do feel a bit out of my depth but lets see what I can figure out.
From what I can see 220v is applied through the bridge rectifier which converts it to DC, which is then fed through the opto coupler to detect the zero cross.

1) How does it detect the zero cross from a dc signal?

2) What is the purpose of the 30k resistors in this circuit?

3) The T1 Triac this seems to be doing the actual switching of the lamp? I'm a bit unsure of how it does this.

4) How would one choose a a suitable triac? The BT136 was proposed
 

1. The bridge converts the AC to DC but it has no reservoir of voltage so although the polarity is the same on each half AC cycle, it still goes from zero to peak voltage. That means that at zero voltage and voltages close to zero (but predictable) the LED in the optocoupler will not light up.

2. Like all LEDs, the one inside the optocoupler is a constant voltage device, if you apply excess voltage above it's Vf rating, the current through it will burn it out. The resistors are there to limit the current to a safe level. There is a compromise, if they pass too much current the LED is damaged, if they pass too little, the time when the LED isn't lit up becomes longer. The reason for using two resistors in series instead of one it it allows each resistor to be lower power rating and it give a slightly better degree of safety as both AC lines have a degree of isolation in them.

3. Think of the triac as a very fast acting switch. Normally, it is always off (not conducting) but when triggered it turns on and stays on even if the trigger is removed. The only way to turn it off is to remove the voltage across it but being driven with AC, that happens at the zero crossing point when the voltage goes through zero as it reverses polarity.

4. The choice of triac depends on the load you are switching. Obviously use one with sufficient voltage and current rating. Note that they are not perfect switches, they drop a small voltage when conducting and that means they produce some heat so you have to be aware of that and cater for removing the heat if necessary. Also note that they are prone to being triggered by rapidly rising voltages as might be caused by severe interference on the AC line so you may need to introduce a line filter to clean it up. The other problem is similar, if you are driving a highly inductive load (such as a large motor) you might need a 'snubber' network across the triac to absorb the spikes created by the current being turned on and off. The triac data sheet will detail all the above factors and suggest how to do it for the particular device.

Brian.
 
Hi,

I agree with Brian.

Just my comments:
1) I call the waveform after the rectifier "rectified AC" .. it is far away form being a constant voltage.

2) very very basic electronics: Ohm´s law.

3) there are many documents in the internet about TRIAC operation.

4) read a TRIAC datasheet. There you will find a lot of specificatoins. Like working voltage, current and so on.
Or: go to a TRIAC distributor or manufacturer and use the interactive selection guide.

Klaus
 
  • Like
Reactions: imraan

    imraan

    Points: 2
    Helpful Answer Positive Rating
Thanks for the response. had been away so could reply timely. You have given me alot to read up on and to understand.

A few other questions:

How do I determine the value of the voltage after the diode bridge that is going into the 4n25?

what is the need for the 10k resistor going to VCC
 

The voltage to the LED in the 4N25 is only it's forward conducting voltage (Vf) which the data sheet suggest is about 1.2V. Bear in mind that drops to zero at the AC zero crossing point.

The transistor side of the 4N25 works rather like a switch. The transistor doesn't conduct unless light from the LED falls on it. It doesn't produce any voltage of it's own so the 10K resistor is needed to pull it's collector voltage up to VCC when the LED is NOT lit up. The result is that the 'ZeroCrossing signal out' point goes to VCC when the AC is near zero crossing point and goes close to ground voltage at all other times.

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top