摘 要:本文設(shè)計(jì)了一種可用于手動(dòng)和自動(dòng)調(diào)節(jié)的智能臺(tái)燈,其采用STM32作為主芯片,4路LED模擬臺(tái)燈,通過按鍵來進(jìn)行自動(dòng)模式和手動(dòng)模式的自由切換。手動(dòng)模式可以通過按鍵來進(jìn)行臺(tái)燈亮度的調(diào)節(jié),自動(dòng)模式可以通過光照傳感器采集光照強(qiáng)度,自動(dòng)調(diào)節(jié)LED的亮度。另外還加入了無線控制功能,用手機(jī)等移動(dòng)終端安裝對(duì)應(yīng)的應(yīng)用后,就可以遠(yuǎn)程操控臺(tái)燈開關(guān)和亮度。
關(guān)鍵詞:雙控調(diào)節(jié);智能臺(tái)燈;STM32
中圖分類號(hào):TM923.44 文獻(xiàn)標(biāo)識(shí)碼:A 文章編號(hào):2096-4706(2018)10-0051-03
Abstract:This paper designs an intelligent desk lamp which can be used for manual and automatic adjustment. It uses STM32 as the main chip,the 4 way LED analog desk lamp,free switching between automatic mode and manual mode by buttons. The manual mode can adjust the brightness of the desk lamp by the button. The automatic mode can collect the light intensity by the light sensor and automatically adjust the brightness of the LED. In addition,the wireless control function is added. After installing corresponding applications with mobile phones and other mobile terminals,the lamp switch and brightness can be remotely controlled.
Keywords:double control regulation;intelligent desk lamp;STM32
0 引 言
在當(dāng)前技術(shù)條件下,臺(tái)燈的亮度往往根據(jù)使用者手動(dòng)進(jìn)行調(diào)節(jié),并不能夠根據(jù)環(huán)境自動(dòng)調(diào)節(jié)。臺(tái)燈作為常用的照明裝置,其是否被正確使用、對(duì)人眼的保護(hù)和對(duì)近視的防治不無關(guān)系。例如,當(dāng)人們沒有伏案使用時(shí),臺(tái)燈更多的是提高整個(gè)環(huán)境的光照,此時(shí)應(yīng)當(dāng)提高亮度,當(dāng)有人在臺(tái)燈前伏案工作學(xué)習(xí)時(shí),太高的光照強(qiáng)度將會(huì)導(dǎo)致人眼損傷。本設(shè)計(jì)采用雙控模式:既可以由用戶手控調(diào)節(jié),也可自動(dòng)調(diào)節(jié),另外加入無線控制,用戶還可以通過手機(jī)等移動(dòng)終端WIFI進(jìn)行燈光亮度的調(diào)節(jié),或者開閉臺(tái)燈。其采用STM32作為主芯片,4路LED模擬臺(tái)燈,通過光照傳感器采集光照強(qiáng)度,調(diào)節(jié)LED的亮度,無線控制采用型號(hào)為ESP8266的WIFI模塊,使用手機(jī)連接WIFI時(shí)可通過網(wǎng)絡(luò)調(diào)試助手發(fā)送消息給M3,M3根據(jù)接受到的消息控制臺(tái)燈。
1 方案總體設(shè)計(jì)
本設(shè)計(jì)使用STM32為主控芯片,通過STM32自帶的AD轉(zhuǎn)換,把光照傳感器的模擬量值輸?shù)絊TM的ADC通道,計(jì)算出臺(tái)燈環(huán)境的光強(qiáng)度。使用4路LED模擬臺(tái)燈,通過軟件模擬PWM功能,實(shí)現(xiàn)LED亮度的調(diào)節(jié)。……