版本协议

Public Domain

标签
专业版
#第十届立创电赛#基于AI语音智能控制的台灯

创建时间:1个月前

37 0

视频

描述

<div class="document"> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">注:* 为必填项</p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><strong><span style="color:#0093e6;">请在报名阶段填写 ↓</span></strong></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">* 1、项目功能介绍</h3> <hr class="horizontal-splitline normal-bold-2"> <p><span class="citation-62 citation-end-62">    本项目名为“随光智行”,是一款基于AI语音控制及姿态检测的智能台灯,旨在解决青少年和职场人士在学习与办公场景中因坐姿不良导致的健康问题,以及传统灯具交互能力弱的痛点 </span>。</p> <p><span class="citation-61 citation-end-61">    我们通过以下技术手段,将台灯打造成一个兼顾用户健康与智能交互的助手 </span>:</p> <p><strong><span class="citation-60">AI智能语音交互</span></strong><span class="citation-60 citation-end-60">:台灯内置高保真麦克风(INMP441) </span><span class="citation-59 citation-end-59">,集成3A音频处理技术(回声消除、噪音抑制) </span><span class="citation-58 citation-end-58">,确保语音指令清晰。用户无需提示词即可用普通话进行多轮对话或下达复合指令 </span><span class="citation-57 citation-end-57">。语音信号通过云端大语言模型(LLM)进行意图理解,并由TTS(文本转语音)合成自然语音进行回复与播报 </span>。</p> <p><strong><span class="citation-56">坐姿健康检测与智能提醒</span></strong><span class="citation-56 citation-end-56">:通过红外传感器实时检测用户与台灯的距离 </span><span class="citation-55 citation-end-55">。当系统检测到用户距离小于30厘米或身体倾斜超过15度时,会主动触发语音提醒,引导用户调整坐姿,以降低用眼疲劳和脊柱健康风险 </span>。</p> <p><strong><span class="citation-54">多模式智能控制</span></strong><span class="citation-54 citation-end-54">:除了核心的语音控制外,台灯还支持多种交互方式。用户可以通过电容式滑条传感器手动调节灯光亮度 </span><span class="citation-53 citation-end-53">或通过实体按键快速切换色温模式 </span>,适应不同场景需求。</p> <p><strong><span class="citation-52">核心技术架构</span></strong><span class="citation-52 citation-end-52">:项目以ESP32-S3芯片为核心主控,集成了Wi-Fi与蓝牙功能 </span><span class="citation-51 citation-end-51">。设备端与云端通过基于JSON-RPC 2.0的MCP协议进行加密通信,保障了指令传输的稳定与安全 </span><span class="citation-50 citation-end-50">。整个系统构建了“感知-决策-执行-交互”的闭环,实现了智能化的用户体验 。</span></p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">*2、项目属性</h3> <hr class="horizontal-splitline normal-bold-2"> <p><strong><span class="citation-49">原创性</span></strong><span class="citation-49 citation-end-49">:属于原创项目 </span>。</p> <p><strong>非首次公开</strong>:该项目是为首次公开。</p> <p><strong>获奖情况</strong>:该项目在2025 山西省照明协会学术年会暨第六届(2025)中国大学生智能照明和智<br>能穿戴创新创业大赛。</p> <p><strong>校答辩</strong>:该项目已在学校参加过答辩。</p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">* 3、开源协议</h3> <p>为了拥抱开源,赋予项目更大的价值,我们作出如下说明:</p> <p><strong>开源协议选择</strong>:本项目为原创项目,推荐使用 <strong>GPL 3.0 开源协议。</strong></p> <p><strong>核心功能(开源80%以上)</strong>:</p> <p><strong><span class="citation-48">硬件部分</span></strong><span class="citation-48 citation-end-48">:基于ESP32-S3主控芯片的智能台灯主板电路设计 </span>。</p> <p><strong>嵌入式软件</strong>:</p> <p><span class="citation-47 citation-end-47">1.利用红外传感器进行坐姿距离检测与提醒的算法实现 </span>。</p> <p><span class="citation-46 citation-end-46">2.实现冷暖双色LED灯珠的PWM调光与色温调节的固件代码 </span>。</p> <p><span class="citation-45 citation-end-45">3.设备端运行的轻量级MCP服务器,用于解析和执行云端指令 </span>。</p> <p><strong>非核心功能</strong>:</p> <p><strong><span class="citation-44">云端AI服务</span></strong><span class="citation-44 citation-end-44">:项目中语音识别(ASR)、大语言模型(LLM)和语音合成(TTS)功能依赖于第三方云服务接口的调用 </span>,这部分属于服务的应用而非核心功能的实现。</p> <p><strong><span class="citation-43">通用模块功能</span></strong><span class="citation-43 citation-end-43">:如TFT显示屏的驱动 </span><span class="citation-42 citation-end-42">、ESP32-S3芯片自带的Wi-Fi连接管理等 </span>,这些是基于通用模块或SDK实现的功能</p> <p>    我们承诺,项目中引用的任何其他开源项目,均会注明来源并严格遵循其开源协议规定。</p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><strong><span style="color:#0093e6;">请在竞赛阶段填写 ↓</span></strong></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">*4、硬件部分</h3> <hr class="horizontal-splitline normal-bold-2"> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;">请输入内容…</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;"> 注:请前往<span style="text-decoration:underline;"><a href="https://lceda.cn/editor" target="_blank">嘉立创EDA</a> </span>生成/上传设计文件,文件完成后,相关文稿将自动生成至项目详情;这里可以详细说明您的项目实现原理和机制、注意事项、调试方法、测试方法等。推荐图文并茂的形式向别人介绍您的想法。 </span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">*5、软件部分</h3> <hr class="horizontal-splitline normal-bold-2"> <p>    本项目的软件架构是典型的“云端-设备端”结合模式,由两大部分组成:运行在ESP32设备上的嵌入式软件,以及运行在云服务器上的后端服务。两者协同工作,实现台灯的各项智能化功能。</p> <p><strong>1. 嵌入式软件 (设备端)</strong></p> <p>嵌入式软件基于FreeRTOS实时操作系统,使用C++语言开发,确保了传感器数据读取、网络通信和硬件控制等多任务的高效并发处理。</p> <p><strong>软件流程与模块:</strong></p> <p><strong>通信协议模块</strong>:设备端运行一个自定义的MCP(Miyoo Control Protocol,推测)服务器,用于监听来自云端的指令。其核心是<code>McpServer::ParseMessage</code>函数,该函数负责解析并验证传入的消息是否符合JSON-RPC 2.0标准。这确保了所有来自云端的指令在执行前都是结构化且有效的。</p> <p><strong>坐姿检测任务</strong>:这是实现健康监测功能的关键,作为一个独立的后台任务运行。<code>distance_sensor_run_task</code>函数会每隔3秒执行一次 (<code>vTaskDelay(pdMS_TO_TICKS(3000))</code>)。</p> <p><strong>核心逻辑</strong>:该任务持续从红外传感器读取距离。如果检测到的距离小于预设阈值 (<code>TOO_CLOSE_THRESHOLD_CM</code>),计数器<code>too_close_counter</code>就会增加。</p> <p><strong>触发机制</strong>:当计数器达到3(表示用户距离过近已持续约9秒)且尚未发送过提醒 (<code>!warning_sent</code>) 时,程序会向云端发送一个<code>postureWarning</code>通知。云端接收到此通知后,即可触发语音提醒。一旦检测到正常坐姿,计数器会立即清零,以防止误报。</p> <p><strong>灯光控制模块</strong>:该模块负责将云端指令转化为物理灯光的变化。<code>WClamp::refresh_Lamp</code>函数承担了此项职责。</p> <p><strong>工作机制</strong>:函数接收"brightness"(亮度)、"warm_weight"(暖光权重)或"cool_weight"(冷光权重)等参数。</p> <p><strong>具体执行</strong>:根据这些参数,函数会精确计算出冷、暖双色LED通道所需的PWM占空比,并最终通过调用ESP-IDF的<code>ledc_set_duty</code>和<code>ledc_update_duty</code>函数来控制LED驱动,从而精确调节台灯的亮度和色温。</p> <p> </p> <p><strong>2. 云端/后端服务</strong></p> <p>后端服务采用Python语言开发,是整个系统的智能中枢。它连接了高级的AI处理(语音识别、大语言模型、语音合成)与物理设备。</p> <p><strong>通信管理模块</strong>:<code>MCPManager</code>类是后端服务的核心。</p> <p><strong>主要功能</strong>:它的主要职责是管理与一台或多台智能台灯的MCP服务连接。</p> <p><strong>初始化过程</strong>:<code>initialize_servers</code>方法会从一个JSON配置文件中加载设置,并创建<code>MCPClient</code>实例。这些客户端随后被AI逻辑调用,用于向对应的设备发送格式化的JSON-RPC指令,以执行调节灯光等操作。</p> <p><strong>整体工作流程示例:</strong></p> <p>1.用户说出语音指令:“把灯光调暖一点。”</p> <p>2.云端的ASR(语音识别)服务将语音转换为文本。LLM(大语言模型)理解用户意图,并判断需要增加<code>warm_weight</code>参数。</p> <p>3.AI逻辑指示Python后端服务采取行动。</p> <p>4.<code>MCPManager</code>通过<code>MCPClient</code>向台灯发送一条JSON-RPC指令,例如:<code>{"jsonrpc": "2.0", "method": "set_lamp_params", "params": {"name": "warm_weight", "value": 90}}</code>。</p> <p>5.设备端的<code>McpServer::ParseMessage</code>函数接收并验证该指令。</p> <p>6.服务器随后调用<code>WClamp::refresh_Lamp</code>函数,并传入"warm_weight"参数。</p> <p>7.台灯的物理灯光随即变暖。</p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">*6、BOM清单</h3> <hr class="horizontal-splitline normal-bold-2"> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;">请输入内容…</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;">注:项目涉及的BOM清单。在<span style="text-decoration:underline;"><a href="https://lceda.cn/editor" target="_blank">嘉立创EDA</a> </span>生成/上传设计文件后,BOM将自动生成至项目详情;建议包括型号、品牌、名称、封装、采购渠道、用途等内容。具体内容和形式应以表达清楚项目构成为准。 </span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">*7、大赛LOGO验证</h3> <hr class="horizontal-splitline normal-bold-2"> <p style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;">请上传包含大赛logo的项目图片,logo以丝印形式印刷在PCB上面。</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;">点击zip下载大赛logo标识! <span style="text-decoration:underline;"><a href="https://image.lceda.cn/easyedaResource/images/d1bbfd69f9404f56901a0e7b849b7245.rar" target="_blank">(大赛标识).zip</a></span></span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">* 8、演示您的项目并录制成视频上传</h3> <hr class="horizontal-splitline normal-bold-2"> <p style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;">视频要求:请横屏拍摄,分辨率不低于1280×720,格式Mp4/Mov,单个视频大小限100M内;</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;">视频标题:立创电赛:{项目名称}-{视频模块名称};如立创电赛:《自动驾驶》-团队介绍。</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="font-size:14px;"><a href="/posts/42551e8f2f2548cabc1c36626a42da94" target="_blank">前往查看更多详情 ></a></span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> </div>

文档

BOM

暂无

附件

暂无

成员

评论(1)

  • 表情
    emoji
    小嘉工作篇
    小嘉日常篇
  • 图片
成功
工程所有者当前已关闭评论
立创电赛 回复
<p>需要上传logo验证实物图哦</p>
goToTop
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow