红外感光智能LED台灯设计.docx

上传人:b****4 文档编号:878633 上传时间:2022-10-13 格式:DOCX 页数:29 大小:267.46KB
下载 相关 举报
红外感光智能LED台灯设计.docx_第1页
第1页 / 共29页
红外感光智能LED台灯设计.docx_第2页
第2页 / 共29页
红外感光智能LED台灯设计.docx_第3页
第3页 / 共29页
红外感光智能LED台灯设计.docx_第4页
第4页 / 共29页
红外感光智能LED台灯设计.docx_第5页
第5页 / 共29页
点击查看更多>>
下载资源
资源描述

红外感光智能LED台灯设计.docx

《红外感光智能LED台灯设计.docx》由会员分享,可在线阅读,更多相关《红外感光智能LED台灯设计.docx(29页珍藏版)》请在冰豆网上搜索。

红外感光智能LED台灯设计.docx

红外感光智能LED台灯设计

(此文档为word格式,下载后您可任意编辑修改!

本科毕业论文(设计)

题目:

红外感光智能LED台灯

学校:

山东科技大学

院系:

机械电子工程学院

专业:

机械设计制造及其自动化

 

摘要

随着社会的进步,人们生活水平日益提高,追逐高质量生活已经成了当下的主题。

智能化产品更是当下的发展趋势。

为了满足人们高质量生活的诉求,现设计一种红外感光智能LED台灯,该产品可以克服普通台灯不能根据环境光强自动调节光的亮度的问题,使得使用者有更舒适的体验,并且能在一定程度上保护人眼,且比较节能。

本次设计的内容基于单片机控制,使得该台灯具有人体感应,自动根据环境光强度自动调节台灯亮度,同时为了满足使用者的某些特殊要求,该台灯还设有手动调节功能,台灯的控制分为台灯按键控制和红外遥控控制两种,这使得台灯的控制更加方便,灵活。

本次设计包括硬件部分和软件部分,硬件电路的核心是由单片机的控制模块,PCF8591+光敏电阻的自动调光模块,HC-SR501人体感应模块,HS0038遥控红外接收模块,红外遥控器,LED发光电路共同组成,软件采用比较灵活的C语言进行编程,进而对硬件电路进行有效控制。

关键字:

单片机;HC-SR501;自动调光模块;HS0038;红外遥控器

ABSTRACT

Withthesocialprogressandthe improvementoflivingstandards, pursuing ordertomeetthe demandsof people ofaninfraredphotosensitive inligentLEDlampinthisdesign.Theproductcanovercomethequestionofthecommondesklampcannotautomaticallyadjustthebrightnessaccordingtotheenvironmentallightintensity,whichallowstheuserstogetmorecomfortableexperienceandcanprotecttheinacertainextentandmoreenergy-efficient.

ThecontentofthisdesignisbasedonthecontrolofMCU.Itmakesthelamp withthefunctionof bodyinduction,automaticallyadjustthelampbrightnessaccordingtotheambientlightintensity,.Andinordertomeetsomespecialrequirementsoftheusers,thelampisalsoprovidedwithamanualadjustmentfunction.Thecontroloflampincludesthekeycontrolandtheinfraredremotecontrol.whichmakesthelampcontrolmoreconvenientandflexible.

Thedesignincludesbodyinductionmodule,HS0038infraredremotecontrolreceivingmodule,infraredremotecontroller,theLEDluminouscircuitcomposed.ThesoftwareusesflexibleClanguageprogrammingtogettheeffectivecontrolofthe()

{

uint8jj=0;

while

(1)

{

sweep();

if((mode==0)&&(ii==0))

{

if(;

uint8byte=0;

SDA=1;

for(n=0;n<8;n++)

{

SCL=0;

_nop_();

_nop_();

_nop_();

_nop_();

_nop_();

SCL=1;

_nop_();

_nop_();

byte<<=1;

if(SDA==1)

byte=byte+1;

_nop_();

_nop_();

}

SCL=0;

_nop_();

return(byte);

}

voidAck_I2c(uint8a)*判断是否非应答信号*

{

if(a==0)

SDA=0;

elseSDA=1;

_nop_();

_nop_();

_nop_();

SCL=1;

_nop_();

_nop_();

_nop_();

_nop_();

_nop_();

SCL=0;

_nop_();

_nop_();

}

voidwriteIIC(uint8x,uint8y)*写两个IIC字节*

{

iicstart();

iicsendbyte(x);

if(ack==0)

return;

iicsendbyte(y);

if(ack==0)

return;

iicstop();

}

uint8readIIC(uint8z)*读取模数转化信号*

{

uint8bb;

iicstart();

iicsendbyte(z+1);

if(ack==0)

return(0);

bb=iicreadbyte();

Ack_I2c

(1);

iicstop();

return(bb);

}

voiddelay()*延时函数*

{

uint16dd;

uint8ee;

for(ee=0;ee<40;ee++)

for(dd=0;dd<500;dd++)

{

sweep();

writeIIC(0x90,0x41);

aa=readIIC(0x90);

select();

}

}

voidsweep()*遥控+按键扫描*

{

uint8jj=0,i1,i2,cs=0;

while((cs++)<18)

{

switch(jj)

{

case0:

if(key0==0)

delay1(1000);

if(key0==0)

ii=1-ii;

while(!

key0);

if(ii==1)

{

P0=0Xff;

P2=0Xff;

zhishi=1;

zhishi1=1;

}

if(ii==0)

{

zhishi=0;

}

jj++;

case1:

if(ii==0)

{

if(key1==0)

delay1(1000);

if(key1==0)

mode=1-mode;

if(mode==0)

zhishi1=1;

while(!

key1);

}

jj++;

case2:

if((ii==0)&&(mode==1))

{

zhishi1=0;

if(key2==0)

delay1(2000);

if(key2==0)

dc++;

if(dc%4==1)

{

P0=0Xf0;

P2=0Xff;

}

if(dc%4==2)

{

P0=0X00;

P2=0Xff;

}

if(dc%4==3)

{

P0=0X00;

P2=0x0f;

}

if(dc%4==0)

{

P0=0Xff;

P2=0Xff;

dc=0;

}

while(!

key2);

}

jj++;

case3:

temp1=low();

if((temp1>4608)&&(temp1<9216))

{

temp2=(TH1*256+TL1);

}

uint16(TH1*256+TL1);

}

voidselect()*LED亮度控制函数*

{

if((aa>=0xf0)&&(aa<=0xff))

{

P0=0;

P2=0x0f;

}

if((aa>=0xe0)&&(aa<=0xef))

{

P0=0;

P2=0x1f;

}

if((aa>=0xd0)&&(aa<=0xdf))

{

P0=0;

P2=0x3f;

}

if((aa>=0xc0)&&(aa<=0xcf))

{

P0=0;

P2=0x7f;

}

if((aa>=0xb0)&&(aa<=0xbf))

{

P0=0;

P2=0xff;

}

if((aa>=0xa0)&&(aa<=0xaf))

{

P0=0x01;

P2=0xff;

}

if((aa>=0x90)&&(aa<=0x9f))

{

P0=0x03;

P2=0xff;

}

if((aa>=0x80)&&(aa<=0x8f))

{

P0=0x07;

P2=0xff;

}

if((aa>=0x70)&&(aa<=0x7f))

{

P0=0x0f;

P2=0xff;

}

if((aa>=0x60)&&(aa<=0x6f))

{

P0=0x1f;

P2=0xff;

}

if((aa>=0x50)&&(aa<=0x5f))

{

P0=0x3f;

P2=0xff;

}

if((aa>=0x40)&&(aa<=0x4f))

{

P0=0x7f;

P2=0xff;

}

if((aa>=0x00)&&(aa<=0x3f))

{

P0=0xff;

P2=0xff;

}

}

参考文献

1:

秦曾煌主编.《电工学》(第七版);高等教育出版社,2009.09

2:

沙占友孟志永王彦朋《单片机外围电路设计》(第2版);电子工业出版社,2006.

3:

刘娟梁卫文程莉等《单片机C语言与PROTUES仿真技能实训》;中国电力出版社2010.08

4

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 幼儿教育

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1