Showing posts with label Dimmer. Show all posts
Showing posts with label Dimmer. Show all posts

Wednesday, March 12, 2014

Điều khiển độ sáng đèn điện xoay chiều bằng điều khiển DC - PIC DC Controlled AC Light Dimmer

Posted by dientudieukhien at 4:46 PM 0 Comments
Sơ đồ nguyên lý:

Sơ lược về hoạt động: Ở đây dùng một vi điều khiển pic 12f615 để điều khiển độ mờ của bóng đèn thông qua điều khiển điện thế dc 5v ở port GP4. Ở đây sử dụng MOC 3021 để cách ly quang đảm bảo an toàn, dùng một triac để điều khiển đèn.
Video:

|| Tải code asm + trị số linh kiện + sơ đồ nguyên lý

source: pcbheaven.com
Read More »

Friday, December 20, 2013

Điều khiển độ sáng đèn dùng Pic16f873 - Light controller

Posted by dientudieukhien at 1:00 PM 0 Comments
Ở đây tác giả sử dụng các chức năng sẵn có của Pic để lập trình điều khiển độ sáng tối của một bóng đèn - ta còn gọi là bộ Dimmer như: AD converter,compare, PWM.
* Sơ đồ nguyên lý:

|| Xem và tải toàn bộ project tại dây.
Read More »

Tuesday, April 2, 2013

Điều chỉnh độ sáng tối bóng đèn bằng remote tivi Sony dùng vi điều khiển pic12f683

Posted by dientudieukhien at 4:10 PM 0 Comments
Sơ đồ nguyên lý:

Code viết bằng ngôn ngữ Mikroc:

The code devided into 2 parts, AC chopper for light dimming control and SIRC decoding for input remote control. As I mention earlier, the SIRC decoding part is on my previous example. For dimming control, GP3 is setup as interrupt-on-change, that's mean INTCON.GPIF is set every zero-crossing is dectected, then microcontroller performs delay by using the Timer1 then activates the triac.

#define tx GPIO.GP5

unsigned TMR1 absolute 0x0E;

char current_dim = 0;
char done_flag = 0;
//preload timer1 value 100%, 90%, 80%, 70% 60%, 50%, 40%, 30% 20% and 10%
unsigned preload_time[10] = {65535,63823,63082,62481,61925,61370,60814,\
60259,59656,58916};

//************************************************** ****************************
//*** interrupt-on-change when zero-crossing occur, preload timer1 value
//*** turn on timer1 to perform delay before gate trigger
//************************************************** ****************************
if(INTCON.GPIF){
tx = 1;
TMR1 = preload_time[current_dim];//preload_time into Timer1
T1CON.TMR1ON = 1; //start timer1
INTCON.GPIF = 0;
}
//************************************************** ****************************
//*** perform gate trigger, turn off itself
//************************************************** ****************************
if(PIR1.TMR1IF){
T1CON.TMR1ON = 0; //stop timer1
tx = 0; //turn on triac
delay_us(150);
tx = 1; //turn off triac
PIR1.TMR1IF = 0; //clear interrupt flag
}
}
At 60 Hz AC power line, one circle is 16.6667 milliseconds, half circle is 8.333 milliseconds. If the microcontroller delay 4166 us before activate the triac on both side, positive and negative, then the light bulb would have half of the power. In this project, the 8.333ms is divided into 10 steps for the power control by calculation then put it into preload_time variable. The program decode SIRC VOL+ key for step up and VOL- key for step down(dim) by changeing current_dim variable.

if(done_flag == 0){
if(got_data){
Command_code = input_data & 0x7F;
Device_code = input_data >> 7;
if(Device_code == 1){
switch (Command_code){
case 0x12: if(current_dim > 0) current_dim --;
break;
case 0x13: if(current_dim < 9) current_dim ++;
break;
}
}
done_flag = 1;
}
}



Nguồn: http://www.pic_examples.byethost3.com/
Read More »

    tab

back to top