How much power is a Triac Light Dimmer supposed to use from 120V 60Hz?

I recently put together a Robotdyn lamp dimmer and got my Arduino code to successfully control the dimming. However, when I check the voltage of the AC in/out part of the module I read 120V. But when I check the voltage of the load part of the module (what's actually being sent to the lamp), I'm only reading about 100V.

Is this normal? That would be about 83% efficiency correct? I'm pretty new to this so I don't know if that's a number to be expected or not. Maybe the code makes the triac fire at an improper time, but I decreased the firing delay to as little as I could before the switch wouldn't turn on. Thanks

This is the code that I am using:

//begin ac int routine

#define output_pin 4
int val;
void setup(){
pinMode(3,INPUT);
digitalWrite(2, HIGH);
pinMode(output_pin, OUTPUT);
attachInterrupt(0, acon, FALLING);
Serial.begin(9600);
}
void acon(){
int temp=(analogRead(0)*6)+1000;
delayMicroseconds(temp);//delay turn on

if (analogRead(A0)>800){
digitalWrite(output_pin, LOW);
}
else {digitalWrite(output_pin,HIGH);
}
//delay() wont work
delayMicroseconds(3);
//delay 200usec on output
//pulse to turn on triac
digitalWrite(output_pin, LOW);

}

void loop(){
Serial.println(analogRead(0));

}

Hi,

What load / power are you driving?

Two points:

  • After running a few minutes, power OFF/disconnect and check: How hot is the TRIAC? It that reasonable for 10% losses?

  • To be really accurate you need a meter that can read RMS Voltage. The waveform may be non-sinusoidal enough to affect your reading.

You should use Code Tags </> to present code, and format it properly. See the topics on top of the forum.

The ISR takes too much time, that's why the TRIAC can never reach 100%.

A pointer instrument will give better readings than a DMM. A scope will show the duty cycle perfectly.

I read 120V. But when I check the voltage of the load part of the module (what's actually being sent to the lamp), I'm only reading about 100V.

Is this normal? That would be about 83% efficiency correct?

First you must understand what efficiency is.

Assume you had an ideal switch turning on and off the power to a load. And as in your example the input voltage, before the switch, was 120 volts, and the switch opened and closed at a 50% duty cycle, the voltage seen by the load would be 120V x 0.50 = 60 volts. The power to the load would only be 50% of what it would be if the switch were continuously closed 100% of the time.

The load sees 50% of the power but that does not have anything to do with efficiency. Efficiency is comparing what the output power is compared to the input. And since it was an ideal switch (no power/heat losses) the efficiency is 100% even though the load is only seeing 50% of what could be possible.

A triac is a switch. Not an ideal on but it still is a switch. It turns on and off. When it is on it conducts as well as it can. When it is off it does not conduct anything (practically). When a triac is on it has has a voltage drop across it of about 1 volt. (roughly 1 volt) And that 1 volt is the part that causes most of the losses in a triac switched circuit. So if you are using a 120 volt ac input then the efficiency of the circuit will be about 99%. Once again, efficiency is related to power output compared to power input.

Now as far as the percentage of output to the load compared to the percentage of the input, that would depend on when the triac was fired (turned on). If the triac turned on at 90 degrees every half cycle then you would get half the power out to the load compared to the triac being on 100% of the time.

The problem that you have is that the triac is not on all the time when you want it to be. It is turned on further into the cycle, say at 15 degrees or more.

The triggering circuit is an important part of the minimum timing possible when controlling a triac. Just because you turned on the output of a port pin it doesn't mean that you have the conditions that allow the triac to fire. There has to be a minimum voltage present across the components before they can fire.

I don't remember what the maximum output can be. It has been a while since I looked at any of this stuff. But I would expect the maximum output to be 2-3 volts below what the input voltage is. If you are not getting that then I would look closer at the circuitry used to find out why.

I work for a company that manufactures speed control of motors, and dimmers for lighting, and heating controls, all with triacs.

1 Like

DrDiettrich:
You should use Code Tags </> to present code, and format it properly. See the topics on top of the forum.

The ISR takes too much time, that's why the TRIAC can never reach 100%.

A pointer instrument will give better readings than a DMM. A scope will show the duty cycle perfectly.

I guess the ISR I'm using is . Is there a different function I can use to make it output faster?

You can make the ISR faster by removing all code that makes it slow.

Phase control is a very common task for microcontrollers, but requires some hardware knowledge and low level programming (using timers...). Search the forum for related discussions and solutions.

I guess the ISR I'm using is .

You guess wrong. The attachInterrupt is the function that tells the compiler what function is called when the interrupt is fired.

I'm only reading about 100V. Is this normal?

Yes.

That would be about 83% efficiency correct?

No.

First off remember that the Triac is being pulsed so any voltage you measure is likely to be an average at best. Most multi meters do not respond well to pulsed wave forms and give false readings. The only way to measure the voltage correctly is to use an oscilloscope.

I guess what you mean to say when you use the word efficient is what is the maximum power you can get out of the circuit.
Without seeing the schematic of what you have it is hard to help any more.

1 Like

Schematic is attached here for the triac module: https://robotdyn.com/pub/media/0G-00005677==Mod-Dimmer-5A-1L/DOCS/Schematic==0G-00005677==Mod-Dimmer-5A-1L.pdf

-Triac is fired with digital pin 4
-Zero-cross is detected with digital pin 2
-Analog output from potentiometer connected to analog input A0

Should I use < attachInterrupt(2, acon, FALLING);> instead of < attachInterrupt(0, acon, FALLING);>?

Since 0 is the analog input from the potentiometer and 2 is the digital input from the zero-cross detection?

Thanks

1 Like

See attachInterrupt() in the Reference: it expects an interrupt number, i.e. 0 or 1, which maps to different pins on different controllers. You can use digitalPinToInterrupt() to map pins into interrupt numbers.

Also from the Reference: analogRead() expects analog input names, A0..., not pin numbers. It also tells that a single analogRead() takes 100µs, what increases the trigger delay accordingly.

No delays should occur in an ISR. Your code may work, somehow, but only if the controller has nothing else to do. You also could poll the zero-cross signal in loop() and do a delay() there. Get the pot input after every trigger pulse, so that nothing slows down the signal polling.

Schematic is attached here for the triac module: https://robotdyn.com/pub/media/0G-00005677==Mod-Dimmer-5A-1L/DOCS/Schematic==0G-00005677==Mod-Dimmer-5A-1L.pdf

That is an appalling circuit and a very bad design.
Nothing is labeled, there are no component values, there is nothing limiting the current into the Triac. You have an optically coupled triac firing a triac which is a bit silly and you can't see where the Arduino is nor the mains load.

The circuit diagram shows enough to know the digital interface. The only uncertainty is the raising/falling edge of the zero cross.

Where do you see a need for; and lack of; current limiting of the triac? BTW the opto coupled part is a diac, and it's there to allow for triggering the triac on both positive and negative zero transition with the same logic signal (active high).

Where do you see a need for; and lack of; current limiting of the triac?

Data sheet.

BTW the opto coupled part is a diac,

Then why is it not drawn as a one?

The D3 symbol shows a diac (2 legs), the only triac symbol (3 legs) is the power component Q1 at the right.

Still: where is the lack of current limiting? There are enough resistors all around.

This probably won't solve all of your issues but when you want 100% brightness you can stop "triggering" the TRIAC twice per cycle and hold it constantly-on.

...You'll still get a slight voltage drop across the TRIAC (maybe 1V?) but that can't be avoided.

DrDiettrich:
Still: where is the lack of current limiting? There are enough resistors all around.

On the triac's gate. With the total lack of any information about what triac it is, if you look at the data sheet for say the BT131 you will see the gate trigger current is around 7mA. And in the absolute limits we see the average gate power as 0.1W over any 20 ms period. There is also a peak gate power and current but the duty cycle is not mentioned.

A triac gate is powered only at ignition. Afterwards the voltage collapses to the saturation voltage of the triac, less the voltage on the (turned off) diac, with neglectable current and energy remaining. That's why a duty cycle is of no importance.

A compromise has to be taken between maximum gate energy, when the triac is fired at mains peak voltage, and the lowest possible trigger voltage when the gate current can reach the gate threshold.