A very cool project implementation is lightning control. Well, right now the LED technology is emerging and gaining more popularity, there are advantages and disadvantages of this technology that does not come around in this project.
Because right now, light bulbs are in the country that i live, fluorescents and incandescents (i don’t know if there is a company having LED lightning), I, in this project only focus on incandescent lights. Controlling fluorescent a fluorescent light has another type of control and issues.
On the hardware part we have three main stages:
The endpoint stages are only for isolating the circuitry from the AC signal source. In the transformer approach, it increases the cost of the board and weight. A cheap solution is to use a transformerless power supply like in the Microchip application note.
The load optoisolation includes the power controller stage two, but in one block. Finally, the load is triggered each time and correct each rising or falling edge.
We will make a closed loop approach, and a easy one is detecting the edge and correcting it every cycle.
Before enter in theme, we first look at the software part first:
The main idea here is to correct in each half cycle of the 60Hz wave the trigger because without feedback the system will be unstable. I am using a potentiometer to vary the duty cycle and make the dimming approximately from 1% to 99%. The reason we could not reach the 0% and 100% is because we have to consider the effect of the diode, we have to break the 0.7V barrier to view the pulse. I make an adjustment to get the 0 and 100, but is on the IEEE paper that is on the bottom page.
Now, for this situation, the control of AC load, we will use some thyristor called TRIAC.
This element is part of the thyristors family and is closed related with SCRs. The main difference, and the most notable between TRIAC and SCR is that the TRIACs are bidirectional and the current can flow in both directions, special care of SCR must be taken because they are unidirectional.
There is an example of the application of a triac controlling a resistive load. This is actually the expected output and is energy efficient control
You can download here the documentation, and the source code is inside the document, is very short, but is in assembler.