1、题 目: 智能护眼台灯智能护眼台灯 摘要摘要 本智能护眼灯以 MSP43G2231 为核心,完成护眼灯的照明,电源管理,环境 采集和中央处理及控制功能。灯珠采用高亮白光 LED,恒流驱动,无频闪,不伤 害眼睛,保护视力。电源管理,由专用电源管理方案,管理系统充电和用电。环 境采集,用光传感器采集光照强度,根据光照强度控制灯珠亮度,用人体热释红 外检测人远近。 abstract This intelligent lamp is as the core of MSP43G2231, complete lighting, power management, environment collectio
2、n , the central processing and control function.The bead is by highlight LED ,which is constant current drive, no stroboscopic, no dam- ages to eyes,and can protect vision.Power management:the special power managemen t solutions manage power,system of charging and electricity.Environmental acquisiti
3、o n:it uses light sensors to collect light intensity, can control lights bead brightness acco rding to the light intensity ,can test people far and near by employing infrared body heat release. 1. 引言引言 现在市场上常用的台灯使用的发光体为普通荧光管或 LED,存在弊端, 灯光亮度不能随环境变化自动调节,致使光线过弱或过强,长时间使用会导 致眼疲劳,伤害人眼。即使是护眼台灯,但其调节灯亮度只能手动调
4、节,且 其档位有限,给使用者带来不便。并且普通护眼灯及一般台灯的效率不高, 比较费电,即使使用节能灯管,还是不能掩饰其效率不理想的弊端。一般台 灯发光部分为单一灯管或数颗 LED 集中发光,投光后如有遮挡物比如写字 办公,手和笔不可避免的造成遮挡,形成暗影区,影响办公写字。 针对以上提出两点问题,急需设计一款集护眼、无影与高效为一体的护 眼台灯,填补市场空缺。 2. 系统方案系统方案 系统整体方框图如下: 图 2.1 系统方框图 高亮 LED 驱动 显示部分 电源供电 环 境 采 集 和 人 距 感 应 部 分 MSPG2231 控 制 ( 1 ) 环境采集用光敏电阻采集环境亮度,人距感应部分
5、采用热释红外。 当人靠近台灯,产生信号给 MCU 控制器,打开台灯。光敏电阻采集当前亮 度值,根据使用者选择的模式作出调整。 ( 2 ) MCU 控制亮度和环境采集采用闭环控制, 具体算法用 PID 算法的增 量式模式。具体函数如下: typedef struct PID double SetPoint; /设定目标 double Proportion;/比例常数 double Integral; /积分常数 double Derivative;/微分常数 double LastError; /Error-1 double PrevError; /Error-2 double SumError
6、; /Sums of Errors PID; double PIDCalc(PID *pid, double NextPiont) double dError, Error, rOUT; Error = pid-SetPoint - NextPiont; / 偏差 pid-SumError += Error; / 积分 dError = pid-LastError - pid-PrevError; /当前微分 pid-PrevError = pid-LastError; /Error-2 =Error-1 pid-LastError = Error; /Error-1 = Error rOUT = pid-Proportion * Error + pid-Integral * pid-SumError + pid-Derivative * dError; /比例项 /积分项