亚洲一区二区欧美_亚洲丝袜一区_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亚洲国产精品_日韩亚洲一区二区
亚洲一本视频| 久久久久欧美精品| 欧美资源在线观看| 亚洲调教视频在线观看| 亚洲激情综合| 亚洲国产精品福利| 激情一区二区三区| 黄色国产精品| 国一区二区在线观看| 国产精品亚洲综合色区韩国| 国产精品成人久久久久| 欧美午夜不卡在线观看免费 | 欧美激情自拍| 美女视频黄 久久| 久久综合电影| 美女视频网站黄色亚洲| 另类综合日韩欧美亚洲| 看片网站欧美日韩| 免费人成网站在线观看欧美高清| 亚洲激情偷拍| 欧美在线91| 久久精品国产综合精品| 久久国产一二区| 久久精品国产精品| 亚洲黄色影院| 亚洲精品视频在线观看免费| 亚洲免费激情| 亚洲一级黄色片| 午夜亚洲性色福利视频| 久久精品国产91精品亚洲| 久久久久久综合网天天| 久热re这里精品视频在线6| 欧美.日韩.国产.一区.二区| 欧美国产欧美亚州国产日韩mv天天看完整| 亚洲午夜激情网页| 亚洲影视在线| 午夜精品一区二区三区电影天堂| 亚洲黄一区二区| 亚洲人在线视频| 一本色道久久综合亚洲精品按摩 | 国产精品高潮呻吟久久| 欧美片在线播放| 欧美视频手机在线| 国产欧美日韩不卡免费| 国内精品久久久久久影视8| 悠悠资源网久久精品| 亚洲精品视频二区| 正在播放欧美一区| 欧美伊人久久大香线蕉综合69| 一区二区三区国产精品| 亚洲一区二区三区在线看| 欧美亚洲一区三区| 亚洲美女诱惑| 亚洲欧美影院| 巨乳诱惑日韩免费av| 欧美激情第六页| 国产精品剧情在线亚洲| 极品日韩av| 在线视频欧美日韩精品| 久久国产精品久久久久久| 日韩亚洲综合在线| 欧美中文字幕在线观看| 欧美成人精品激情在线观看 | 激情亚洲网站| 99国产一区| 欧美在线视频a| 99精品视频免费全部在线| 午夜精品区一区二区三| 久久久久久久综合色一本| 欧美伦理在线观看| 国产区在线观看成人精品| 亚洲黄色影院| 欧美在线关看| 亚洲图中文字幕| 免费成人av在线| 国产精品一区二区黑丝| 亚洲日韩第九十九页| 欧美一区二区三区免费视频| 一本色道久久综合亚洲精品婷婷 | 欧美18av| 国产农村妇女精品一二区| 91久久精品日日躁夜夜躁国产| 在线国产日韩| 亚洲少妇在线| 亚洲美女啪啪| 久久色在线播放| 国产精品久久久久秋霞鲁丝 | 久久av资源网站| 亚洲午夜视频在线观看| 你懂的国产精品永久在线| 国产日本欧美一区二区三区| 99在线热播精品免费| 久久精品欧美日韩| 欧美一级片在线播放| 欧美日韩精品在线| 91久久国产精品91久久性色| 亚洲国产欧美一区二区三区同亚洲 | 欧美一区二区三区在| 亚洲综合色视频| 欧美日韩视频一区二区三区| 亚洲黄色免费电影| 亚洲国产精品一区二区久| 久久成人免费电影| 国产精品一区二区在线观看不卡| 国产日韩欧美三区| 中文av一区特黄| 亚洲视频在线观看三级| 欧美激情综合| 亚洲韩国日本中文字幕| 亚洲人成免费| 久久综合精品国产一区二区三区| 欧美 日韩 国产一区二区在线视频| 欧美二区乱c少妇| 黄色小说综合网站| 亚洲电影有码| 91久久国产自产拍夜夜嗨| 性欧美激情精品| 欧美色大人视频| 欧美日韩人人澡狠狠躁视频| 亚洲精品久久久久久下一站 | 久久精品人人爽| 欧美午夜精品一区| 亚洲日本va午夜在线影院| 亚洲国产精品黑人久久久| 欧美一级专区免费大片| 欧美色123| 亚洲日本成人| 亚洲黄色在线视频| 久久综合狠狠综合久久综合88| 欧美黄色aaaa| 在线国产欧美| 亚洲国产精品电影在线观看| 亚洲一二三区精品| 国产精品日日摸夜夜摸av| 一区二区三区四区五区精品视频| 亚洲免费在线| 亚洲女爱视频在线| 国产精品久久77777| 在线视频精品一区| 欧美影院成年免费版| 国产女精品视频网站免费| 日韩一级在线观看| 亚洲三级免费电影| 欧美精品1区2区| 亚洲精品麻豆| 一区二区欧美国产| 欧美天天在线| 亚洲一卡久久| 久久大逼视频| 国产精品主播| 最新成人av在线| 欧美精品不卡| 亚洲乱码精品一二三四区日韩在线 | 亚洲国产一成人久久精品| 玖玖国产精品视频| 伊甸园精品99久久久久久| 亚洲国产毛片完整版| 嫩草成人www欧美| 夜夜嗨av一区二区三区网站四季av| 久久精品国产亚洲一区二区三区 | 亚洲国产专区校园欧美| 久久精品中文字幕一区| 国内精品久久久久影院色| 久久精品99无色码中文字幕| 久久婷婷丁香| 亚洲黄色成人| 欧美一区二区免费| 国产一区二区三区免费在线观看| 亚洲免费av片| 亚洲一区观看| 国产日本欧洲亚洲| 久久国产视频网| 欧美体内she精视频| 亚洲欧洲av一区二区| 久久婷婷久久一区二区三区| 91久久精品美女| 亚洲摸下面视频| 亚洲第一毛片| 亚洲视频电影在线| 国产日韩精品一区二区三区| 久久精品视频在线观看| 欧美激情免费在线| 欧美与黑人午夜性猛交久久久| 亚洲综合清纯丝袜自拍| 国产欧美日韩另类视频免费观看| 亚洲免费观看在线观看| 中日韩美女免费视频网址在线观看| 免费美女久久99| 亚洲日本视频| 新狼窝色av性久久久久久| 国产资源精品在线观看| a91a精品视频在线观看| 国产精品永久| 亚洲精品社区| 国外成人性视频| 亚洲午夜伦理| 黄色成人免费网站| 亚洲一品av免费观看| 国内精品久久久久久久影视麻豆| 亚洲国产美女精品久久久久∴|