当前位置:网站首页>Design principle of infrared circuit of single chip microcomputer
Design principle of infrared circuit of single chip microcomputer
2022-07-26 06:26:00 【an520_】
TV 、 The air conditioner can't live without the infrared remote control . The air conditioner remote control is actually an infrared signal transmitting device , The air conditioner body has an infrared receiving probe , It can receive the infrared signal sent by the remote control and analyze , So as to realize the function of remote control , The same principle applies to TV remote control . Now there are many mobile phones with infrared function , By matching the communication protocol , It can realize the function of mobile phone remote control TV and air conditioner . Pass below Hardware and Software Two aspects to share with you , The principle of infrared remote control .

This part includes , Principle of infrared emission part 、 Principle of infrared receiving part as well as The principle of software coding .
1 Circuit principle of infrared emission part
The infrared emission function mainly consists of Infrared emission tube To achieve , The infrared emitting tube is and transparent in appearance LED Light emitting diodes are very similar , Its driving and control modes are also the same . When using single chip microcomputer to control the transmitting tube , Generally, triode is used to drive ,NPN Triode and PNP Triode can achieve . Use it as shown in the figure below PNP Triode .

PNP The base of the triode is connected to the single chip microcomputer through resistance GPIO mouth , The transmitting tube is connected to... Through a current limiting resistor PNP On the emitter of the triode . When the microcontroller's GPIO Output high level PNP The triode is in the cut-off state, and the infrared emitter does not work ; When GPIO Output low level PNP The triode turns on and the emitter works , Emit infrared rays invisible to the naked eye , Received by the receiving tube . Each key on the remote control has a certain code , This coding is actually a high-level and low-level pulse that follows certain rules , The receiving circuit parses the pulse to perform the corresponding operation .
2 Circuit principle of infrared receiving part
remember , Infrared emission and infrared reception are a pair , Use in pairs . The launch tube is white , The receiving tube is black . You can use a triode to build a receiving circuit or a comparator to build a circuit , The following shows the circuit of infrared receiving with triode circuit . As shown in the figure below .

When no infrared signal is received , The receiving pipe is not conductive , triode Q1 No conduction , triode Q3 No conduction , The MCU receives a continuous high level ; When the receiving tube receives the infrared signal , MCU receives low level signal . When the key on the remote control is pressed , The coding pulse corresponding to the key will be received by the single chip microcomputer , The single chip microcomputer analyzes the pulse , You can know which key on the remote control is pressed , So as to realize the user's operation .
however , The anti-interference ability of black infrared receiving tube is relatively low , When designing the circuit, generally do not choose , Instead, use a special infrared receiver , The most commonly used model is HS0038. and , Its infrared receiving circuit is simple , Strong anti-interference ability .

3 Infrared software code analysis
The pulse coding mentioned above is the communication content between infrared emission and infrared reception , Data or content of communication , It is called communication protocol . Generally speaking , Infrared communication follows NEC Coding protocol specification .
NEC According to the agreement , The working frequency is 38KHz, Its data format consists of the following parts : Pilot code 、 User code 、 User code complement 、 Key code 、 Key code complement, etc . A complete key / The data cycle is 108ms.NEC Coding rules 0 and 1 The code of is as follows :
code 0:0.56ms High level +0.565ms Low level =1.125ms
code 1:0.56ms High level +1.685ms Low level =2.245ms, As shown in the figure below .

When a key on the remote control is pressed , The transmitting tube will send out a string containing the pilot code 、 User code 、 User code complement 、 Key code 、 The pulse of key code complement comes out , If you want to translate the pulse , Just look at 0 and 1 Sequence , The length is 2.245ms The pulse of represents data 1, Pulse length is 1.125 The pulse of represents data 0. Similar pulse data are shown in the figure below .

The infrared special probe at the receiving end should sense some pulses and send them to the single chip microcomputer , Single chip microcomputer analyzes pulse data , Calculate the user's key information , Then execute the corresponding commands and logic , In this way, users can remotely control the air conditioner and TV on the sofa .
Nowadays, many mobile phones have integrated infrared emission circuits , It also has a self-learning function, which allows the mobile phone to match the coding protocol of the device according to the operating instructions , After the protocol is matched, you can remotely control the TV through your mobile phone 、 Air conditioning and other equipment , At this time, the mobile phone becomes a remote control .
Because the communication part has to deal with complex data , So this kind of circuit needs the support of MCU .
【 Learning exchange group 197416462】
边栏推荐
- nuxt 配置主题切换
- Should we test the Dao layer?
- Latex merges multiple rows and columns of a table at the same time
- Read five articles in the evening | Economic Daily: don't treat digital collections as wealth making products
- 将金额数字转换为大写
- CCTV dialogue ZTE: why must the database be in your own hands?
- Latex同时合并表格的多行多列
- RNN recurrent neural network
- [day04_0421] C language multiple choice questions
- YOLOv6:又快又准的目标检测框架开源啦
猜你喜欢

BPG notes (IV)

力扣5: 最长回文子串

CV (1)- Introduction

【无标题】

将一个正整数分解质因数,要求分解成尽可能小的多个的因数。

Alibaba cloud OSS binding custom domain name

Registration conditions for system integration project management engineer (intermediate level of soft exam) in the second half of 2022

PHP 多任务秒级定时器的实现方法

JVM class loading and GC garbage collection mechanism

Markdown add Emoji expression
随机推荐
[day04_0421] C language multiple choice questions
Yolov6: the fast and accurate target detection framework is open source
【Day_03 0420】字符串中找出连续最长的数字串
Youwei low code: Brick life cycle component life cycle
【Day_07 0425】Fibonacci数列
How to divide the disks under the devices and drives in win10 new computer
【Day_03 0420】数组中出现次数超过一半的数字
【BM2 链表内指定区间反转】
【Day_07 0425】合法括号序列判断
[pytorch] fine tuning technology
Code Runner for VS Code,下载量突破 4000 万!支持超过50种语言
Using dynamic libraries in VS
Convert amount figures to uppercase
Advanced C language - archived address book (file)
[untitled]
移动web
【Day_06 0423】把字符串转换成整数
英语句式参考纯享版 - 定语从句
基于消防GIS系统的智慧消防应用
[day_050422] statistical palindrome