Control AC load with microcontroller.

Summary of Control AC load with microcontroller.


This article describes a microcontroller-based AC load control project using a zero-cross detection circuit, a quadrature encoder for timing, and a TRIAC (BTA10) driven by an optocoupler. The author reports inconsistent TRIAC behavior across different voltage levels (15V and 110V), including failure to trigger after slight delays or triggering only at the start of half-waves. The core issue involves improper firing pulse timing relative to the zero-cross signal, potentially caused by insufficient gate current, incorrect resistor sizing, or isolation challenges when transitioning from transformer-supplied to mains-powered testing.

Parts used in Control AC load with microcontroller:

  • BTA10 TRIAC
  • MOC Optocoupler
  • PIC Microcontroller
  • Quadrature Encoder
  • Zero Cross Detector
  • Car tail lights (Load)
  • Heater (Load)
  • Transformer
  • Resistors

As per the title of this question i’m trying to control an ac resistive load. So far i had little success and i’m experiencing “strange”, to me at least, behaviour from the triac(s) i tried. first of all i post a schematic of my test circuit (bare with it, it’s not a complete schematic, it represents only the control partControl AC load with microcontroller

as you can see it’s sized for a 220v ac line missing in the schematic is a quadrature encoder input used to control the delay of the firing pulse to the opto. What i did is take the zero cross signal and compute a delay based on the encoder input (ie if the input was 5 out of 10 i’d start a timer on ZCD and once it reaches 5 it would trigger the opto led thus triggering the BTA10 triac) So far so good, the ZCD outputs a nice spike which is read by the pic and the output to the MOC is perfectly timed. Now comes the problems. Just to test the circuit i tried first with 15vAC (sizing the resistors accordingly and using a couple of car tail lights as a load) and i experienced this

problem

ok, i don’t draw very well…what was happening was that the triac switched nicely in the green region and won’t turn on at all in the red one. i was puzzled but i thought it could be a voltage problem so i went from 15v to 110vAC (again changing the resistors and load). Now the triac switched on only at the very beginning of each half wave right after ZC. Sometimes switching only one half of the full wave.Control AC load with microcontroller schematic As soon as i delay my triggering signal more than a few hundreds uS or so the triac just stops working. I also changed the load to a beefier one (a heater) to increase current but nothing happened. I also tried playing with the resistors a bit to see if i can get some changes but had no luck. Now reading some forums I thought I may get rid of the transformer i used to supply my circuit with 15vAC first and 110vAC after and connect everything directly to the mains as it will eventually be. But maybe someone can point me directly to the correct answer! May the transformer be the culprit? If not what can it be? I don’t have much experience with TRIACS so my knowledge is surely lacking something and i may have forgot something important in the description of what I’m doing that can be helpful to get the answer right… Just to be sure i link here the datasheets of the triac, optocoupler and optotriac. And an app note with some of the calculations i’ve used.

 

 

For more detail: Control AC load with microcontroller.

Quick Solutions to Questions related to Control AC load with microcontroller:

  • Why does the TRIAC fail to turn on when delaying the trigger signal?
    The TRIAC stops working when the delay exceeds a few hundred microseconds, likely due to the firing pulse arriving too late in the AC cycle.
  • Can the transformer be the culprit for the strange behavior?
    The author questions if the transformer is the cause but notes that switching directly to mains did not immediately resolve the issue without further changes.
  • What happens when the TRIAC is tested at 15VAC versus 110VAC?
    At 15VAC it switches in specific regions but fails in others, while at 110VAC it only triggers at the very beginning of the half-wave or sometimes only one half.
  • How was the delay for the firing pulse calculated?
    The delay was computed based on the quadrature encoder input, where a specific input value determined the timer duration after the zero-cross signal spike.
  • Did increasing the load current fix the problem?
    No, changing the load to a beefier heater to increase current did not change the behavior of the TRIAC.
  • Is the zero-cross signal generation working correctly?
    Yes, the zero-cross detector outputs a nice spike which is successfully read by the PIC microcontroller.
  • What components were used as test loads?
    The author initially used car tail lights and later switched to a heater to test the circuit.
  • Does adjusting the resistors solve the triggering issue?
    Playing with the resistors provided no luck in resolving the inconsistent switching behavior.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter