news 2026/7/7 3:05:41

【dz-946】基于单片机的智能家居灯

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
【dz-946】基于单片机的智能家居灯

基于单片机的智能家居灯

摘要

随着生活品质的提升和智能家居理念的普及,家居照明的便捷性、智能化成为人们追求舒适生活的重要需求。传统家居灯光控制多依赖手动开关,存在操作不便、功能单一等问题,难以满足不同场景下的照明需求,例如夜间起夜时需手动开灯、无法远程控制灯光状态等,影响生活体验。因此,研发一种功能丰富、操作便捷的智能化家居灯控制系统十分必要。

本设计提出了一种基于 STM32F103C8T6 单片机的智能家居灯系统。系统主要功能包括:通过 3 个 LED 灯模拟卧室、客厅、洗手间的照明;借助 3 个按键分别控制三个灯的亮灭;在洗手间安装 D203S 人体热释电感应模块,当检测到有人且 5516 光敏电阻检测到光线较低时,自动开启洗手间灯;通过按键可调节客厅灯的亮度;通过按键设定卧室灯亮灯时间,时间到达后自动熄灭,OLED 显示屏实时显示计时时间;通过 ECBO2 蓝牙模块连接手机端,实现手机对三个灯亮灭的控制及客厅灯亮度的调节;通过 SU-03T 语音识别模块控制三个房间灯的开关和客厅灯的亮度。

该智能家居灯系统的作用在于,为人们提供了一种便捷、智能的家居照明解决方案。通过多种控制方式的融合与自动化感应功能,提升了家居照明的舒适度与便捷性,满足不同场景下的照明需求,改善生活品质。

关键词:单片机;智能家居灯;STM32F103C8T6;蓝牙控制;语音识别

Smart Home Light Based on Single Chip Microcomputer

Abstract

With the improvement of quality of life and the popularization of smart home concepts, the convenience and intelligence of home lighting have become important demands for people to pursue a comfortable life. Traditional home lighting control relies heavily on manual switches, which have problems such as inconvenient operation and single functionality, making it difficult to meet the lighting needs in different scenarios. For example, manual turning on of lights at night and inability to remotely control lighting status can affect the living experience. Therefore, it is necessary to develop an intelligent home light control system that is feature rich and easy to operate.

This design proposes an intelligent home lighting system based on STM32F103C8T6 microcontroller. The main functions of the system include: simulating the lighting of the bedroom, living room, and bathroom through three LED lights; Use three buttons to control the on/off of three lights respectively; Install D203S human pyroelectric induction module in the bathroom. When someone is detected and the 5516 photoresistor detects low light, the bathroom light will automatically turn on; The brightness of the living room lights can be adjusted through buttons; Set the bedroom light on time by pressing the button, and it will automatically turn off when the time is up. The OLED display screen will show the timer time in real time; Connect the ECBO2 Bluetooth module to the mobile phone to control the on/off of three lights and adjust the brightness of the living room lights; Control the on/off of three room lights and the brightness of the living room lights through the SU-03T speech recognition module.

The function of this smart home lighting system is to provide people with a convenient and intelligent home lighting solution. Through the integration of multiple control methods and automated sensing functions, the comfort and convenience of home lighting have been improved, meeting the lighting needs in different scenarios and enhancing the quality of life.

Keywords:microcontroller; Smart home lights; STM32F103C8T6; Bluetooth control; speech recognition

目 录

1 绪论

1.1 研究背景及意义

1.2 国内外研究现状

1.3 主要内容

2 系统总体方案设计

2.1系统总体设计

2.2 主要模块方案选择

3系统硬件设计

3.1 总体硬件框架

3.2 主控模块电路设计

3.3 LED 照明模块电路设计

3.4 按键模块电路设计

3.5 人体感应与光线检测模块电路设计

3.6 显示模块电路设计

3.7 蓝牙通信模块电路设计

3.8 语音识别模块电路设计

3.9 电源模块电路设计

4 系统程序设计

4.1 编程软件介绍

4.2 系统主流程设计

4.3 独立按键

4.4 OLED显示流程设计

4.5 定时器模块子流程

4.6 LED灯亮度调节子流程设计

4.7 蓝牙模块子流程

4.8 语言识别模块子流程设计

5实物制作与功能测试

5.1 实物制作

5.2 基础灯光控制功能测试

5.3 洗手间自动感应功能测试

5.4 客厅灯亮度调节与卧室定时功能测试

5.5 蓝牙远程控制功能测试

5.6 语音识别控制功能测试

6 总结

参考文献

致谢

附录A 原理图

附录B PCB

附录C 主程序

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/7/7 18:32:12

Java-IO流

IO (位于 java.io 包中) 一、概念 1. 流:数据在内存和其他存储设备传输的通道、管道。【理解】 2. 流的分类:【面试内容】 (1) 按照方向分:[以JVM内存为参照物] a. 输入流:将 [其他存储设备]中数据读入到[JVM内存]中 。->读 b.…

作者头像 李华
网站建设 2026/7/7 8:59:03

全栈开发者:雷池 WAF 受欢迎,不是超越谁,是它不打扰开发

我做全栈开发 8 年,从前端到后端都得管,安全这块一直是痛点。以前要么花大量时间研究安全规则,要么将就用简单工具,防护不到位。直到用了雷池,才发现安全工具也能做到 “不打扰开发”。之前维护一个电商小项目&#xf…

作者头像 李华
网站建设 2026/7/6 12:33:06

深入理解 Ascend C:昇腾 AI 芯片的高性能算子开发语言

引言:AI 算力时代的底层引擎随着人工智能技术从理论走向大规模产业落地,对计算性能、能效比和软硬件协同效率的要求日益严苛。传统通用处理器(如 CPU、GPU)在面对特定 AI 负载时逐渐显现出瓶颈,而专用 AI 加速芯片成为…

作者头像 李华
网站建设 2026/7/4 3:17:25

ComfyUI 升级 v0.4.0 踩坑记录:解决 TypeError: QM_Queue.task_done() 报错

记录于:2025年12月17日 ComfyUI version: 0.4.0 暂未适配v0.4.0的队列管理器旧版插件 comfyui_queue_manager 另一个可尝试替代的队列管理器 ac-comfyui-queue-manager Comfy.ICU 队列管理器介绍 ComfyUI 升级 v0.4.0 踩坑记录:解决 TypeError: QM_Queue…

作者头像 李华
网站建设 2026/7/7 13:06:56

量化数据清洗第一步:免费搞定股票代码、名称映射表,告别手动整理

在量化投资研究中,获取准确完整的股票代码与名称映射表是数据清洗的第一步,也是构建可靠研究基础的关键环节。许多初学者会手动整理这份基础数据,既耗时又容易出错。 本文将介绍如何利用免费的Baostock数据接口,快速获取并构建股…

作者头像 李华
网站建设 2026/7/7 1:57:23

预算6000元选什么游戏笔记本?七彩虹将星X16 Pro实测:14代酷睿i7+RTX5060如何定义“水桶机”性价比

对于预算在6000元价位段、追求高性能体验的学生党、年轻创客和游戏玩家而言,选购一台“全能无短板”的游戏笔记本,常常意味着在性能、屏幕、散热和做工之间艰难取舍。当前市场在享受国家补贴政策收紧和存储硬件价格上涨的双重影响下,高性价比…

作者头像 李华