亚洲一区二区欧美_亚洲丝袜一区_99re亚洲国产精品_日韩亚洲一区二区

Night Light Saver V6

2016-07-05 15:37
Night Light Saver V6 Latest design of night light saver circuit built with AT89C2051. Nice firmware using c coding developed with SDCC. This new version has internal Ni-MH battery backup, reset button and simple time setting. Now the circuit board was embedded with lamp fixture. Preset turn on period is from 18:00 to 22:00 everyday. You may let the saver turn on whenever you want. The period of time on can be reprogrammed with sdcc. Howvere this project is not recommended for beginner. The circuit uses transformerless supply and no galvanic isolation! Figure 1: Embedded saver with lamp fixture Hardware DescriptionFigure 1 shows complete hardware schematic of the Night Light Saver V6.0. The AC line was protected F1, a 1A fuse. Any short circuit caused by saver's components will blow the fuse. R1 and C1 limit current to the 5V zener diode, D3. R2 discharges capacitor C1 when power terminal of the circuit was opened. The super capacitor C2, 5V 0.01F filters DC supply. D4 acts as unidirectional switch for current supplied to MCU. BT1 is 3V 60mAH Ni-MH battery for backup the MCU when main power failed. The charging current is approx. 2mA with AC main lives. When main power failed, BT1 supplies approx. 4mA to the MCU. With fully charged, it could be able to provide backup time approx. 15Hrs. The MCU runs with Vbackup. SW1 helps reset the MCU, in case of brownout voltage by BT1. C4 and internal pull-down resistor forms simple reset circuit. The MCU, 89C2051 runs with 3.579MHz Xtal. SW2 is for clock setting, when pressed, time will be 18:00. P3.7 drives tick LED with small sink current. R5, 4.7k limits less than one mA for D5. P3.0 provides 5Hz clock signal for calibration. The output bit is P1.6. It drives PNP transistor, Q1. R3 limits base current. R5 pull base pin to V when P1.6 is logic '1' to fully turn off Q1. R4 limits DC current injected to Q2, MAC97 small triac. LP1 is incandescent 25W lamp. The lamp's wattage can be up to 40W. Figure 2: Complete schematic of Night Light Saver V6.0 Night Light Saver V6saver6.pdf I built the board with universal pcb and put it under the lamp fixture. SW1 and SW2 are small tact switch. To press them I need a small rod made by bamboo. Figure 3: Bottom view with Ni-MH battery SoftwareThe source program is beautiful coding with c language. After timer initialization then idle mode is entered by setting bit0 in PCON register. The timer0 overflows 10 times per second. Tasks for update clock, check SW2, blink LED and update output bit will be executed every 1/10s. The task that controls output instead, will be executed every one second. For different preset time, time on, time off, you can edit the source code and recompile with sdcc easily. I provide sample scheduler scanning function, scan_pgm( ). If you want to modify the code for all 8-bit output on P1 similar to the Miniature Real-time Controller. You may have open collector driver, the same hardware and modify a little bit of the source code. /* Lamp.c night light saver V6.0, 89C2051 runs with 3.579MHz xtal The source code was compiled with sdcc. Copyright (C) 2004 Wichit Sirichote, kswichit@kmitl.ac.th, 20 December 2004 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */#include #define tick_test P3_0 // 10Hz/2 output for clock calibration #define LED P3_7 #define output1 P1_6char status;int count, i; char tick, flag1, temp, timer1, timer2;char hour,min,sec,sec10;// you may press set time button whenever you want the lamp turns on // for winter season you may press ealier than local time // for summer more late, time will shift relatively! // period will be 22:00 - 18:00 = 4 hourscode char time_on1[] = {18,00}; code char time_off1[] = {22,00};// another scheduler, the 3rd byte will write to P1 // you may replace control_output function by scan_pgm functioncode char pgm1[]={18,00,0x80,19,00,0,20,0x80,1,21,00,0};char _sdcc_external_startup() { return 1; // skip static and global variables initialization }scan_pgm() { char i; for(i=0; i<4; i ) { if(hour == pgm1[i*3] && min == pgm1[i*3 1]) P1 = ~pgm1[i*3 2]; } }control_output() { if(hour == time_on1[0] && min == time_on1[1]) status = 0; if(hour == time_off1[0] && min == time_off1[1]) status = 1; }blink_led() { if(flag1&1) { if( timer1>1) { flag1 &= ~1; // clear flag1.0 timer1=0; LED = 1; // turns off led } } }void time () /* update real-time clock */ { if ( sec10 >= 10) /* 100ms * 10 = 1 s */ { LED = 0; control_output(); // control output every second sec10 = 0; flag1 |=1; if ( sec >= 60) {sec = 0; if ( min >= 60) {min = 0; if ( hour >= 24) {hour = 0; } } } } } set_time() { if((P3&4)==0) { status = 0; hour = 18; min = 0; sec = 0; timer2=0; } }update_output() { if(status) output1 = 1; else output1 =0; // update output bit }void timer_isr(void) interrupt 1 using 1 { TH0 = 0x8b; TL0 = 0x7f; // reload with 35711 for 10Hz tick ; tick_test ^= 1; // test tick for 10Hz/2 or 5Hz time(); set_time(); blink_led(); update_output(); } main() { TMOD = 0x01; // timer1 and timer0 = mode 1 EA = ET0 = TR0 = 1; // enable timer0 interrupt, start timer PCON |= 1; // enable IDLE mode, to extend backup period for(;;) ; } Figure 4 shows start time at 18:00 when SW2 was pressed. The lamp will turn on until 22:00 everyday. Since the preset time, 18:00 can set whenever SW2 was pressed, so if you want to change time on, for examples in summer season, sun will set lately, suppose you want the lamp to be turned on at 19:00, you just press SW2 at 19:00. The day after it will turn on at 19:00, however time off will shift to 23:00. Figure 4: Preset time on for winter Figure 5 shows a complete lamp fixture with cover and 25W lamp. I have been tested the energy saving lamp, 5W Sylvania, it also works fine. Figure 5: with 25W lamp and cover Download Schematic saver6.pdf Firmware lamp.cNight Light Saver V6lamp.rar C compiler SDCC.zipNight Light Saver V6SDCC.zip Orcad 9.1 schematic file NA
亚洲一区二区欧美_亚洲丝袜一区_99re亚洲国产精品_日韩亚洲一区二区
在线精品福利| 国产精品久久久久毛片大屁完整版| 亚洲精品在线电影| 亚洲大胆美女视频| 欧美一区二区在线观看| 午夜国产不卡在线观看视频| 夜夜嗨av一区二区三区网页| 亚洲精品一二区| 亚洲国产高清一区| 一区二区在线视频| 激情婷婷欧美| 精品1区2区3区4区| 在线播放国产一区中文字幕剧情欧美| 国产一区二区精品丝袜| 国产日韩欧美日韩大片| 国产欧美一区二区精品仙草咪| 国产精品女主播| 国产农村妇女毛片精品久久莱园子| 国产精品美女久久久免费| 国产精品久久久久久妇女6080| 欧美日韩中文在线| 欧美视频不卡| 国产精品嫩草99a| 国产欧美日韩视频一区二区三区| 国产麻豆成人精品| 国一区二区在线观看| 国内外成人免费视频 | 欧美日韩123| 欧美午夜在线观看| 国产拍揄自揄精品视频麻豆| 国产一区二区三区免费在线观看| 狠狠做深爱婷婷久久综合一区| 精品成人久久| 亚洲免费观看高清完整版在线观看| 日韩亚洲视频在线| 亚洲在线成人| 亚洲国产日韩美| 亚洲视频一区二区免费在线观看| 午夜精品偷拍| 久久综合九色| 欧美日韩一区综合| 国产精品影视天天线| 激情综合自拍| 99视频在线观看一区三区| 亚洲欧美日韩国产另类专区| 久久精品国产2020观看福利| 亚洲精品一品区二品区三品区| 亚洲一区在线免费| 一区二区三区四区国产| 亚洲黄色成人| 亚洲欧洲99久久| 亚洲国产裸拍裸体视频在线观看乱了中文 | 亚洲国产精品成人综合| 亚洲免费观看| 欧美一区二区三区在线| 亚洲免费黄色| 久久经典综合| 欧美日韩国产亚洲一区| 性18欧美另类| 亚洲精品中文字幕在线观看| 亚洲视频一起| 亚洲人成网站色ww在线| 亚洲一区二区三区免费在线观看 | 亚洲深夜福利| 久久综合999| 国产精品免费一区二区三区在线观看| 一区二区三区自拍| 在线视频亚洲一区| 亚洲国内自拍| 欧美影院久久久| 欧美丝袜第一区| 亚洲高清自拍| 欧美一区二区三区的| 亚洲深夜激情| 欧美韩国一区| 国内精品一区二区三区| 亚洲午夜极品| 一区二区三区精品| 免费毛片一区二区三区久久久| 国产精品欧美日韩一区二区| 91久久嫩草影院一区二区| 亚洲免费在线视频| 在线综合亚洲欧美在线视频| 蜜臀av性久久久久蜜臀aⅴ| 国产精品中文字幕在线观看| 亚洲精选在线观看| 亚洲欧洲日本在线| 久久久久国色av免费观看性色| 国产精品激情| 亚洲精品女人| 亚洲国产第一| 在线成人小视频| 久久国产精品毛片| 欧美日韩的一区二区| 一区视频在线播放| 亚洲春色另类小说| 久久久久久亚洲精品杨幂换脸| 国产精品久99| 在线视频免费在线观看一区二区| 一区二区久久| 欧美精品少妇一区二区三区| 在线高清一区| 亚洲国产日韩欧美在线动漫| 久久色在线播放| 国产一区二区三区四区五区美女| 亚洲欧美综合v| 欧美一区二视频| 国产久一道中文一区| 亚洲一区二区欧美日韩| 亚洲女同同性videoxma| 欧美性色综合| 亚洲特级毛片| 小嫩嫩精品导航| 国产精品视频一二三| 亚洲伊人一本大道中文字幕| 午夜精品在线视频| 国产精品久久久久久影院8一贰佰 国产精品久久久久久影视 | 国产午夜精品久久| 欧美一区二视频| 久久免费的精品国产v∧| 国产日韩欧美在线一区| 欧美一区亚洲| 麻豆成人在线观看| 亚洲国产国产亚洲一二三| 91久久国产综合久久| 欧美国产另类| 日韩视频免费| 午夜亚洲激情| 国产亚洲一二三区| 亚洲第一区色| 欧美激情国产高清| 亚洲美女在线国产| 亚洲中字在线| 国产午夜精品美女毛片视频| 久久成人亚洲| 欧美大片在线观看一区二区| 亚洲精品自在久久| 亚洲欧美精品中文字幕在线| 国产三级精品三级| 亚洲第一精品福利| 欧美精品导航| 亚洲在线第一页| 久久免费高清| 亚洲日本欧美| 亚洲女同性videos| 国产日韩精品一区二区浪潮av| 久久精品论坛| 欧美伦理91i| 亚洲永久免费视频| 看片网站欧美日韩| 亚洲免费av电影| 欧美一区二区精品久久911| 国内精品久久久久影院 日本资源| 亚洲区一区二| 国产精品久久久久久久久动漫| 午夜精品久久久久久久久久久久久 | 亚洲国产91精品在线观看| 中文有码久久| 国产性猛交xxxx免费看久久| 亚洲精品影院在线观看| 国产精品www994| 亚洲成人资源网| 国产精品成人一区二区艾草| 欧美中文字幕| 欧美色播在线播放| 欧美一区二区私人影院日本 | 亚洲高清久久| 国产精品白丝av嫩草影院| 久久精品毛片| 国产精品成人免费视频 | 亚洲黄色性网站| 香蕉亚洲视频| 91久久黄色| 欧美在线观看天堂一区二区三区| 亚洲高清影视| 久久国产精品亚洲77777| 最新国产精品拍自在线播放| 亚洲欧美日本国产有色| 亚洲高清在线观看| 欧美一区二区在线| 亚洲精品日日夜夜| 久久亚洲国产精品日日av夜夜| 99国内精品久久久久久久软件| 久久精品国产一区二区三区免费看 | 亚洲特级毛片| 亚洲第一毛片| 欧美在线播放视频| 日韩写真视频在线观看| 久久一区二区三区av| 亚洲一区二区精品在线观看| 欧美电影在线观看完整版| 午夜在线一区| 国产精品xxxav免费视频| 亚洲国产美女| 国产在线欧美| 欧美一级网站| 一区二区三区导航| 欧美精品1区| 亚洲缚视频在线观看| 国产伦理一区|