The project "PWM with microcontroller 8051 for SCR or triac power control" can be used for two applications.
1. To control AC load's power with SCR or triac by controlling the firing angle or duty cycle for two channels.
2. The project as it is can be used as digital to analog converter "DAC" for two channels.
This project is currently output two PWM signals but can be extended to many PWM signals very easy. The input to the microcontroller is 100HZ pulses as zero crossing.
The project can be used to control the heating of AC heater also.
currently it is build for two channel DAC, the input at port1 and port2 of microcontroller is converted to 0 - 5v accordingly. But if it is desired to control the SCR, then OP-AMP circuit will be removed and optocoupler moc3020 will be used for interfacing SCR or triac.
The circuit diagram of PWM with microcontroller 8051 for SCR or triac power control is as under:
The code of program for PWM with microcontroller 8051 for SCR or triac power control is written c lanuage using keil compiler. The c-code for PWM is as follows.
/* This project is develop to generate two seperate channel PWM signals at 50HZ frequency
The duty cycle of the pulses is variable subject to the input on Port1 and port2.
The output PWM signal can be used to drive SCR or triacs to control the phase angle and power of any load with suitable hardware interface.
Please not that in this project the OPAMP are used to convert the pulses to 0 - 5 V, means you can use it in as two channel DAC also.
But for triac or SCR interface the OPAMP circuit will be re-placed with proper optocoupler like moc3020 and scrs.89c51 as pwm controller
*/
1. To control AC load's power with SCR or triac by controlling the firing angle or duty cycle for two channels.
2. The project as it is can be used as digital to analog converter "DAC" for two channels.
This project is currently output two PWM signals but can be extended to many PWM signals very easy. The input to the microcontroller is 100HZ pulses as zero crossing.
The project can be used to control the heating of AC heater also.
currently it is build for two channel DAC, the input at port1 and port2 of microcontroller is converted to 0 - 5v accordingly. But if it is desired to control the SCR, then OP-AMP circuit will be removed and optocoupler moc3020 will be used for interfacing SCR or triac.
The circuit diagram of PWM with microcontroller 8051 for SCR or triac power control is as under:
The code of program for PWM with microcontroller 8051 for SCR or triac power control is written c lanuage using keil compiler. The c-code for PWM is as follows.
/* This project is develop to generate two seperate channel PWM signals at 50HZ frequency
The duty cycle of the pulses is variable subject to the input on Port1 and port2.
The output PWM signal can be used to drive SCR or triacs to control the phase angle and power of any load with suitable hardware interface.
Please not that in this project the OPAMP are used to convert the pulses to 0 - 5 V, means you can use it in as two channel DAC also.
But for triac or SCR interface the OPAMP circuit will be re-placed with proper optocoupler like moc3020 and scrs.89c51 as pwm controller
*/
#include<at89x52.h>
unsigned char ch_count[2];// two channel counts array
unsigned char ch_duty_level[2];// level of the duty cycle
bit int_10ms;// this is a flag wich is set every 10msec time period
sbit PWM1 = P3^6;
sbit PWM2 = P3^7;
sbit indicator = P3^5;
void external_interrupt (void) interrupt 0
// external interrupt for zero crossing dectection
{
ch_count[0]=ch_duty_level[0];
// on zero crossing detection, counts are updated for both PWM channels
ch_count[1]=ch_duty_level[1];
PWM1=0; // the output is active low
PWM2 =0;//89c51 as pwm controller
int_10ms = 1; // 10msec flag is set
}
void timer_interrupt (void) interrupt 1
// The timer 0 is used for the duty cycle adjustement of two channel PWM
{
TL0 = 0XE2; //reset timer LSB
if(--ch_count[0]==0) PWM1 = 1;
// each time the timer interrupt occur the counts are decreased by one and on reaching zero
if(--ch_count[1]==0) PWM2 = 1;
// the outputs are turned off, as the out put is active low
}
void main (void)
{
ET0 = 1; // enables the Timer 0 interrupt of 8051
TMOD = 0x02;
// timer mode register, timer 0 is used in mode 2
TL0 = 0XE2; // Initialize timer0 LSB
TR0 = 1; // timer 0 is activated
EX0 = 1; // external inturpt is activated
IT0 = 1;
EA = 1;
ch_duty_level[0] = 30; // dummy value for duty cycle for PWM 1
ch_duty_level[1] = 60; // dummy value for duty cycle for PWM 2
while (1) // endless loop
{
if( int_10ms){
int_10ms = 0;
ch_duty_level[0] = P1;
// take the input value of duty cycle for PWM 1 fromport1 of the 8051
ch_duty_level[1] = P2;
// take the input value of duty cycle for PWM 2 fromport1 of the 8051
indicator =~ indicator;
}
}
}solenoid valve atmel dc control triac,dimmer bt138,uln2003 microcontroleur interfacing a microprocessor to a power thyristor microcontrol based level mesurement 89c51 as pwm controller,at89c2051 sine wave pwm









Dear Sir,
ReplyDeleteI'm working in temperature calibration laboratory. So I am very interested about your project based on microcontroller and I really wants to try this out to use in my oven calibrations applications.
I would be very much thankful , if you could send me more detail with circuit diagram and codes of microcontroller projects.
Hope you will help me to make this low cost product.
Thanking you,
@ OVEN temperature calibration laboratory :-
ReplyDeleteThanks
As you can see in my blog there are a lot many different projects, circuit diagrams, codes for different applications based on microcontroller 8051.
So, i can not understand which project you want to build by your own.
If you required any kind of help regarding microcontroller 8051 circuit diagram , code, and interfacing. YOu ack the question, i will try to reply.
Thank you very much for your kind concern.
ReplyDeleteI have given the title which I'm really interested to make a low cost oven calibrator.
could you please send me in detail ,the circuit diagram as well as the source code.
Hope you will help me to be success in this project.
PIC18F452 Oven Calibrator Using the MAX6674/MAX6675 Thermocouple-to-Digital Converter: A Thermocouple Measurement Circuit
Thanking You with Best Regards,
@ OVEN temperature calibration laboratory :-
ReplyDeleteThe literature about the topic you said is given in picinf.blogspot.com
youcan find it on clicking the below topic.
PIC18F452 Oven Calibrator Using the MAX6674/MAX6675 Thermocouple-to-Digital Converter
if you want more help regrding this project, then you have to send your work on this project sofar, so that i could understand, where you are stuck and what is the actual problem in your design or your code.
If you want me to develop whole project for you including hardware and software then you should discuss it with me in detail.
I will need your project proposal, requirement of your project and algorithms to develop the coding of microcontroller project in which MAX6674/MAX6675 is being interfaced with PIC microcontroller.
Sir i am working on a project titled "Automatic temperature control for boilers" using at89s52 microcontroller,lm75 sensor,half wave SCR to control current proportional to temperature of boiler using heater...
ReplyDelete@ Anonymous (Temperature controller through SCR):-
ReplyDeleteGood to know that . Keep reading my blog, here you will find all relvent information and if you want to discuss then write please.
Hi Dr. Rana.... Nice visiting ur blog. U got interesting projects. I intend implementing one of your projects which is the PWM control using de 8051 microntroller for SCR. I need clarifications on SW1 and SW4 having 5A and 18 respectively. Please what do they mean? Secondly de zero crossing detector circuit? hw do u implement dis with de 100Hz input.. look 4ward 2 hearing from u...
ReplyDeleteHi Dr. Rana... nice visiting ur blog... U have interesting projects. I intend implementing one of ur projects which is the PWM control using 8051 microcontroller for SCR. Please I need clarifications on the SW1 and SW4 for 5A and 18 respectively. what do they mean. Secondly u need a zero crossing detector for de circuit design right? hw do u implement dis using de input of 100Hz? I look 4ward 2 hearing from u...
ReplyDelete@ Okumen (zero crossing and traic control with microcontroller):-
ReplyDeleteThanks for reading my blog of microcontroller project.
Q1. Switches?
Answer: The project is to control firing angle of SCRs of two independent channels. The phase angle control need input from user, so i am giving two inputs each with parallel 8 bits combinations. So you can have different 256 stages fro 0 to 100% of power. These switches are two tumb wheel swtiches uses to generate parallel bytes independent of each other. You can interface these ports with eithor parallel 8 switches or any circuit which give you parallel output.
Q2. Zero crossing?
Answer:
Yes, you need a proper zero crossin circuit which gives 100Hz signal on input of 50HZ AC.