Go Down

Topic: SCR gate controller circuit using arduino (Read 19047 times) previous topic - next topic


Greetings. Based on my previous post finally i came up with the programming. But I need a little favour or guidance if what i done is correct. My project is based on designing a SCR gate controller circuit for a FW H bridge rectifier. So i decided to use arduino Duemilanove to help my cause. I came across a journal where they precisely explained the generation method but they used Atmega-32. So i followed the steps. The following is the method and I have attached the zero cross detection circuit along with its simulated o/p.


1) At any time when zero crossing (rising edge of square wave) is detected on the AC mains, arduino is interrupted and the latest values of
ADC is used to manipulate firing delay which is use to determine firing angle. According to the firing angle, the triggering pulse is generated for gate terminal of SCR to trigger the thyristor. On LCD, ADC output and firing angle which is calculated from ADC reading is displayed for the observer who is controlling the converters output. ADC output is 0-1023 which is use to control firing angle 0-180 degrees. Let ADC is the output from analog to digital converter and alpha is the firing angle. So alpha is calculated using the following equation:
alpha = ADC/5.68

2) Nxt is calculating the delay as per the firing angle which is based on the ADC output and ADC output is based on the analog voltage (0-5V).  AC supply is 50Hz it have the time period of 20ms and for positive half cycle time period is 10ms, ADC reading is converted into a delay after which firing pulse is to be generated. If ADC is output of ADC and d is the delay in microseconds, then


1.955 here is the scaling up factor for the ADC reading and 5 is the reference voltage.

So this is the method i followed but i m having doubts whether it can be fired on the negative cycle of the rectifier. Plus I thought of using an external voltage as the controlling voltage to get the ADC voltage. Any other easy recommendation?

My program:

#include <LiquidCrystal.h>

The circuit:
*LCD RS pin to digital pin 8
*LCD Enable pin to digital pin 9
*LCD D4 pin to digital pin 4
*LCD D5 pin to digital pin 5
*LCD D6 pin to digital pin 6
*LCD D7 pin to digital pin 7
*LCD R/W pin to ground

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

int ZCDpin= A0;
int ADCpin= A1;
int SCRpin1= 9;
int SCRpin2= 10;
attachInterrupt(ZCDpin, loop, RISING);

void setup (){
pinMode (SCRpin1, OUTPUT);
pinMode (SCRpin2, OUTPUT);
lcd.begin (16, 2)
lcd.clear ();
analogReferrence (DEFAULT);

void loop (){
if (ZCDpin == 1){
else if (ZCD == 0){
lcd.setCursor (0,0);
lcd.print("Angle=         ");
lcd.setCursor (0,1);
lcd.print("delay=         ");

void adc_pot1(){
if (int x=0; x<180; x++)
{ int ADC= analogRead(ADCpin);
   alpha= ADC/5.68;
   d= (ADC*5)*1.955);
   digitalWrite(SCRpin1, alpha);
   delay (d);

void adc_pot2(){
if (int x=0=180; x<360; x++)
{ int ADC= analogRead(ADCpin);
   alpha= ADC/5.68;
   d= (ADC*5)*1.955);
   digitalWrite(SCRpin2, alpha);
   delay (d);


...but i m having doubts whether it can be fired on the negative cycle of the rectifier.
A TRIAC (thyristor) can be triggered with a positive or negative voltage on the gate. But, I've never used an SCR.  I've always used a special optoisolator designed to drive a TRIAC, such as the MOC3021.  You need to isolate your Arduino from the high voltage anyway, and the optoisolator allows you to trigger the TRIAC with a 5V logic pulse.

I haven't studied your code, but since you are detecting only the positive-going zero-crossing, you'll have to allow for that, and send-out another trigger pulse after a 1/2 cycle delay (10mS @ 50Hz, or 8.33mS @ 60Hz) to cover the negative half-cycle.

Plus I thought of using an external voltage as the controlling voltage to get the ADC voltage. Any other easy recommendation?
Sure!   The ADC just gives you a "number"... A value that gets converted to a delay value...  With the appropriate circuitry, you could adjust the brightness of a lamp based on the volume of an audio signal, or whatever.  (I'm assuming this is a light dimmer?)

You don't even need to use the ADC...  You can control the delay (brightness) entirely in software...    About a million years ago (with a different microcontroller) I built a "sunrise dimmer" that brings-up the light level over a 10 minute period.


Thx @DVDdoug, in my code i stated the else if statement saying when the ZCD==0, its goes 2 d 2nd subroutine where it calculates 4 d negative cycle. Is whatever I m doing there make sense? And I will be using a pulse transformer to isolate my arduino from the H-bridge rectifier. Its not really a light dimmer. All i have to do is to make sure the SCR in the H bridge works and the AC is fully rectified. the output of the rectifier can just be resistor.


Can anyone help me to check if program is correct? any corrections? and i m rather curious to know if the ADC calculation and LCD display might consume time causing the arduino not being synchronized with the sine input of the rectifier


Isn't the frequency (1/freq = period) constant?
If you have zero-cross, that is a reference, then it is a matter of timing from that point (delay till trigger.)
"Who is like unto the beast? who is able to make war with him?"
When all else fails, check your wiring!


Apr 13, 2013, 08:34 am Last Edit: Apr 13, 2013, 08:38 am by sonnyyu Reason: 1
This must be school project. There is due date, is it?

Here is my best shoot;-

few modification
1. Replace T1 with SCR+full bridge rectifier ( I did SCR+full bridge rectifier to replace triac when I was kid, since triac is much expensive than SCR+full bridge rectifier that time)
2. Make all the related parts meet your AC voltage.( they might design for 110V, if yours is 220V)


copy and paste Arduino code above, modification might need if you design 50hz instead 60hz.

last thing is document

copy and paste every thing from above again, if you need more content I put a little more here for copy.

1. The SCR will be triggered by a very fast current pulse. make sure capacitance of the opto triac is not able to generate such a pulse under a high dv/dt transient.
2. Select opto triacs have good dv/dt rating  to increase  effective dv/dt of your power circuit.
3. Make sure voltage rating of the opto triacs has enough margin,  400V for 110V AC, 600V for 220V AC.
4.  The LED suffer from gradual degradation and no exception for opto triacs here. the driving current margin is needed, compensated degradation.
5. Protect the SCR gate against unneeded negative gate current. In this circuit no need do anything since full bridge rectifier force everything positive.

good luck and have a fun with copy and paste!

Author here is sharing more than quarter century old knowledge!
High voltage is dangerous! Be careful.
No responsible for any damage or harm.
Don't try follow this unless you absolutely know what you are doing!


Apr 13, 2013, 03:24 pm Last Edit: Apr 13, 2013, 09:14 pm by sonnyyu Reason: 1
While you have fun with copy and paste;

This one need adobe photoshop to do copy and paste; second half sine wave have to be 180° shift. photoshop will do it at seconds.

If "copy and paste" save you some time, you should focus on adobe flash and convert above image into flash. Your ee professor is not impression any thing you did so far, since he knows. The flash might be different story.

one last thing, read text book understand dv/dt , arduino, opto triacs,  cpu speed,  read code...
"copy and paste" only buy your time but not skill.

Go Up