智能远程遥控器的设计与实现
2018-04-16刘赐恩石道胜王成
刘赐恩 石道胜 王成
【摘 要】远程遥控作为智能化家居中的一个重要功能,在日常生活中和工业应用中十分常见。遥控的基础在嵌入式设备中只是一种状态控制另一种状态的表现,在远程遥控中,就必须依赖某种媒介,例如有线连接、局域网、广域网等等。本文介绍的是一个以STM32为控制核心,辅以ESP12F联网模块及红外发射二极管为一体的远程遥控装置,操作装置是基于android的应用。文中介绍了该远程遥控的功能特点,给出了STM32与其他硬件连接的电路与编程设计方法。
【关键词】智能化;远程遥控器
中图分类号: TP872 文献标识码: A 文章编号: 2095-2457(2018)03-0225-002
Design and Implementation of Intelligent Remote Control
LIU Ci-en SHI Dao-sheng WANG Cheng
(School of Electronic Information Engineering, Suzhou Vocational University, Suzhou, Jiangsu 215100, China)
【Abstract】As an important function of intelligent home, remote control is very common in daily life and industrial applications. The basis of remote control is only the performance of a state to control another state in an embedded device. In a remote control, it must rely on a certain medium, such as a wired connection, a local area network, a wide area network, and the like. This article describes a remote control device that uses the STM32 as the control core, supplemented with the ESP12F networking module and infrared emission diodes. The operation device is based on the android application. This paper introduces the features of the remote control, STM32 circuit with other hardware and programming design method is given.
【Key words】Intelligent; Remote control
1 系統描述
本文研究的智能远程遥控器的结构框图如图1所示。STM32F103R8T6作为控制核心,主设备由锂电池供电,经ASM1117稳压后连接到STM32的电源上。该远程遥控器主要应用于家居环境,主要控制具有红外接收功能的设备。四路红外发射二极管与STM32具有PWM输出功能的IO口相连,然后由STM32的IO输出38KHz的载波信号给红发射二极管,遵循红外NEC协议,NEC协议如图2所示,一帧信号首先是由9ms的载波和4.5ms的空闲作为引导码开始,然后紧跟的是4段信息,分别是用户码、用户反码、键值码和键值反码,数字逻辑“0”是560us的载波+560us的空闲组成,数字逻辑“1”是560us的载波+1.68ms的空闲组成。在使用时,对于特定的功能需求,输出特定的编码信号。最终达到红外控制的目的。
在控编码输出之前,首先要知道红外编码信息。VS1838B是红外接收一体头,其频率是37.90KHz,它能够将红外光信息转换为数字信息,然后利用STM32对数字信息进行输入捕获,同样是遵循红外NEC协议,最终将红外编码转换为数字信息存储到STM32的内部Flash里面,即对红外信息进行解码。……
