演示视频:
【单片机毕业设计选题24057】-基于esp32的离线语音红外小夜灯
系统功能:
网购具有红外功能的小夜灯,通过ESP32将其改造为具有手机APP的智能小夜灯。
主控器件:NodeMCU-ESP32开发板
主要功能:
1. 连接blinker,通过手机蓝牙控制。
2. 手机界面模拟小夜灯遥控器界面。
3. 通过DHT11采集温湿度。

主要功能模块原理图:

系统主要功能模块代码
#define BLINKER_BLE
#include <Blinker.h>
#include <Arduino.h>
#include <IRremoteESP8266.h>
#include <IRsend.h>
#include <DHT.h>
#define DHTPIN 17 // GPIO17连接DHT11
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
#define LED_ON HIGH
#define LED_OFF LOW
unsigned char readHumiVal = 50;
unsigned char readTempVal = 28;
uint32_t intervalTime = 0;
const uint16_t kIrLed = 4; //GPIO4
IRsend irsend(kIrLed); //Set the GPIO to be used to sending message
//blinker app中对应的按键定义
BlinkerButton Power("Power"); //开关机键
BlinkerButton BrightAdd("BrightAdd"); //亮度+键
BlinkerButton BrightDec("BrightDec"); //亮度-键
BlinkerButton ColourTemp("ColourTemp"); //色温键
BlinkerButton Light("Light"); //灯光键
BlinkerButton Timer1("Timer1"); //定时1键
BlinkerButton Timer2("Timer2"); //定时2键
BlinkerButton Timer3("Timer3"); //定时3键
BlinkerButton SetTimer("SetTimer"); //设置定时键
//DHT11温湿度传感器定义,使用的是Adafruit的DHT-sensor-library
BlinkerNumber HUMI("humi");
BlinkerNumber TEMP("temp");
//打开关闭小夜灯
void power_callback(const String & state)
{
if(state=="tap")
{
digitalWrite(LED_BUILTIN, LED_ON);
irsend.sendNEC(0x01FE58A7);
digitalWrite(LED_BUILTIN, LED_OFF);
}
}
//亮度+
void brightAdd_callback(const String & state)
{
if(state=="tap")
{
digitalWrite(LED_BUILTIN, LED_ON);
irsend.sendNEC(0x01FE807F);
digitalWrite(LED_BUILTIN, LED_OFF);
}
}
此设计提供的资料包含原理图(包含PDF,AD,立创EDA三个版本),源代码,系统框图,主程序流程图,物料清单(包含使用到的器件手册),功能操作说明等。


ESP32智能红外小夜灯设计

被折叠的 条评论
为什么被折叠?



