lucky6772
Junior Member level 2
Hey guys M controlling light intensity using zero detector through microcontroller 2051 using moc3041 and traic 136
what m doing is as there will zero detecting pulse after every 10ms. so m doing is m jst making moc off for 8ms and on for 2ms by this i m achieving 20% brightness BUT
THE PROBLEM IS BULB IS ACHIEVING 20%BRIGHTNESS BUT ITS KEEP ON FLICKER HERE'S THE SIMPLE CODE FOR TESTING M POSTING KINDLY HELP
NOTE= i am using moc3041 and connect in such a way that wen i give low pulse i.e '0' it fires..bulb on..
what m doing is as there will zero detecting pulse after every 10ms. so m doing is m jst making moc off for 8ms and on for 2ms by this i m achieving 20% brightness BUT
THE PROBLEM IS BULB IS ACHIEVING 20%BRIGHTNESS BUT ITS KEEP ON FLICKER HERE'S THE SIMPLE CODE FOR TESTING M POSTING KINDLY HELP
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 #include <REG2051.H> int i,j,a; sbit moc=P3^7; void delay(); void delay(int x) { for(i=0;i<100;i++) for(j=0;j<x;j++) ; } void isr(void) interrupt 0 { moc=1; ///bulb off for 8ms delay(8); moc=0; /// bulb on for 2ms delay(2); moc=1; delay(8); moc=0; delay(2); } void main() { EX0 = 1; // Enable EX0 Interrupt EA = 1; // Enable Global Interrupt Flag while(1) { ; } }
NOTE= i am using moc3041 and connect in such a way that wen i give low pulse i.e '0' it fires..bulb on..
Last edited by a moderator: