AC light dimmer with 2x TRIAC
-
Thank You for Your help! Unfortunately I don't have oscilloscope so I can't check the signal either.
I will try to change dimtime constant values :)
Thanks!
-
I wanted to post this topic in the general discussion as I want to make a "safe" AC control circuit and wanted some ideas.
I have already designed this circuit 2 years ago but every while I gain some new experience. I was programming the dimmer using PIC and I was using Real Time Operating System (RTOS) + using (delay) to create an accurate timing for firing the TRIAC after the Zero crossing is detected. It worked very fine. Ofcourse using delay is bad and blocks your code.
Afterwards I changed my code to use time interrupts instead of RTOS, and flickering was happening sometimes.
I am telling you this because this may be something wrong in your coding. So this is the first issue you have to revise.Second. A few months ago I found a better design in this link . It is also a dimmer circuit but I read the comments and people said that there is no choke component in the circuit. I read later and new that this means that an inductor must be added ( don't know where exactly ) but I knew later that pulsing in such circuits is not safe without a choke components. This may also cause this flicker as I have on some sites.
Third. I had a friend of mine who used to run his Home Automation for 3 years. He used the same simple design as you and he never reported any bad issues :) This really made me confused, as the link which I have shared above contains more componets ( capactitors + snubber circuit ) for safety, while my friend didn't add them. I have also to add that snubber circuits are needed with inductive loads only, and maybe this is way he didn't face any problem.
ohhh what a long reply :)
-
Hey,
@ahmedadelhosni
Thanks for long post ;)Safety is in first place. This circuit should be safer with snubber circuit, inductor and varistor. I miss something? DIAC is same purpose like varistor?
I look at few already made products in China. Im not realy sure about whats that in pictures, is that inductor or antenna for rf module :)
First smart switch from China:
Second smart switch from China:
Even more cheaper: Cheap smart switch
But theese switches are with relays.
@rvendrame
I was trying to change around dimtime constant values - and with no any good luck.Today I move last modified code to Arduino Mini Pro and test it. When I test it - there was no flickering at all. Only there is same problem with:
When I turn it on, bulb also graceful goes to 100%, but when max power had been reached - power instantly goes to 0% and in Domoticz status leaves as ON.
But if I use slipper to set 100% - dim level leaves and light bulb is shining as 100%.I will check it and try to figure out why this is happening. :)))
-
Hey,
@ahmedadelhosni
Thanks for long post ;)Safety is in first place. This circuit should be safer with snubber circuit, inductor and varistor. I miss something? DIAC is same purpose like varistor?
I look at few already made products in China. Im not realy sure about whats that in pictures, is that inductor or antenna for rf module :)
First smart switch from China:
Second smart switch from China:
Even more cheaper: Cheap smart switch
But theese switches are with relays.
@rvendrame
I was trying to change around dimtime constant values - and with no any good luck.Today I move last modified code to Arduino Mini Pro and test it. When I test it - there was no flickering at all. Only there is same problem with:
When I turn it on, bulb also graceful goes to 100%, but when max power had been reached - power instantly goes to 0% and in Domoticz status leaves as ON.
But if I use slipper to set 100% - dim level leaves and light bulb is shining as 100%.I will check it and try to figure out why this is happening. :)))
@jacikaas said:
When I turn it on, bulb also graceful goes to 100%, but when max power had been reached - power instantly goes to 0% and in Domoticz status leaves as ON.
But if I use slipper to set 100% - dim level leaves and light bulb is shining as 100%.I saw you still using 'static int' instead 'volatile int' for currentLevel . Did you try 'volatile int' ?
Apart from that, I don't see any other reason for that. Perhaps something into controller side (domoticz)? I use Vera Lite with similar arduino circuit as yours, and I never had this behavior in my setup.
-
If I understand, sometimes when you think you should be seeing 100%, the light is actually off?
You are counting on the triac to latch and hold until the next Zero Crossing. However a triac needs a certain level of current in order to latch. If you try to trigger it too early in the AC cycle (while the AC voltage is still close to zero, just starting to rise), the load may not provide enough current to latch the triac. This is especially true with some kinds of loads. For example, LED Xmas lisghts don't conduct until the AC instantaneous voltage rises above the combined Vfwd of 25-50 series LEDs.
One way to test this hypothesis is to lengthen the pulse. Or you could adjust your timing multiplier.
-
@jemish which module do you mean exactly?
The schematic in the first post is not suitable for inductive loads. -
@jemish maybe have a look at following blog-post: http://www.homemade-circuits.com/2012/04/how-to-use-triacs-for-inductive-loads.html
With this information you should be able to "improve" above schematic to be also able to handle inductive loads.If you have no clue about all that... maybe have a look at this module:
https://www.kemo-electronic.de/en/Light-Sound/Effects/Modules/M028-Power-control-110-240-V-AC-2600-VA.php
It can control AC Motors,
in combination with this module:
https://www.kemo-electronic.de/en/Transformer-Dimmer/Converter/M150-DC-pulse-converter.php
You can connect it safely to the arduino. -
@jemish maybe have a look at following blog-post: http://www.homemade-circuits.com/2012/04/how-to-use-triacs-for-inductive-loads.html
With this information you should be able to "improve" above schematic to be also able to handle inductive loads.If you have no clue about all that... maybe have a look at this module:
https://www.kemo-electronic.de/en/Light-Sound/Effects/Modules/M028-Power-control-110-240-V-AC-2600-VA.php
It can control AC Motors,
in combination with this module:
https://www.kemo-electronic.de/en/Transformer-Dimmer/Converter/M150-DC-pulse-converter.php
You can connect it safely to the arduino.@Oitzu i cant find the price of them on the site. Are they listed ?
-
@ahmedadelhosni
http://www.ebay.com/itm/KEMO-M028-Power-control-110-240-V-AC-2600-VA-Made-in-Germany-/251096815198
as example..they are relativ expensive.. see it more as an example. :) -
@ahmedadelhosni
http://www.ebay.com/itm/KEMO-M028-Power-control-110-240-V-AC-2600-VA-Made-in-Germany-/251096815198
as example..they are relativ expensive.. see it more as an example. :)@Oitzu assume that I didn't ask you :) :)