Design of infrared remote control keyboard for industrial control computers

Publisher:学思者Latest update time:2014-09-15 Source: 21icKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Preface

For industrial control microcomputer systems, input device keyboards are almost indispensable. When the number of keys is small, the high and low levels of the key control interface line are generally used directly to indicate, so corresponding interface support is required. Due to the limited number of interface lines in the single-chip industrial control microcomputer system, in order to reduce the occupation of interface lines, one key definition of multiple functions is often used, but this increases the complexity of the software; when the number of keys is large, most of them use dynamic scanning to form a keyboard matrix. Although this keyboard has a simple structure principle and the driver is easy to design, it often takes a lot of time to design the printed circuit board and consider the panel layout in the specific implementation. In addition, when the hardware resources are relatively tight, it is also necessary to consider expanding the I/O port, which makes the circuit more and more complicated.

2. System Introduction

This paper introduces an interface principle and implementation method of using an infrared transmitter as an input keyboard for industrial control computers. This interface can minimize the hardware resource requirements for the single-chip microcomputer system, occupying only one interface line and requiring only a small receiving window on the system panel. The entire interface consists of two parts: the transmitter and the receiver. When the number of keys required for a single-chip industrial control microcomputer system is less than 30, the transmitter can directly use a finished infrared remote control transmitter. If the transmitter is designed by yourself, it can support about 60 keys, of which two keys are used to form a combination key. The interface circuit of the receiver is also very simple and does not require wiring. It only needs to connect the output of the finished module directly to any I/O interface line of the single-chip industrial control microcomputer system. At the same time, the driver is also easy to design. Since the keyboard adopts a wireless method, the single-chip microcomputer formed can easily meet some occasions that require long-distance control, as well as some special occasions, such as: the single-chip industrial control microcomputer system is in a sealed container, and parameters are input or controlled through a small glass window; the surrounding environment of the single-chip industrial control microcomputer is not suitable for close operation by users, etc.

3. Hardware composition of infrared remote control keyboard

The infrared remote control keyboard transmitter circuit composed of the integrated chip PT2248 is shown in Figure 1. 00H~09H are numeric keys, 0AH is the reset key, and 0BH is the cancel key.

1.gif

Figure 1 Schematic diagram of infrared remote control keyboard transmitter circuit

The infrared remote control keyboard transmitting circuit adopts the pulse time modulation (PPM) method to modulate the remote control command into a pulse sequence and drive the infrared transmitting tube to send it out in the form of light pulses. The remote control command consists of 12-bit code, see Table 1.

2.jpg

Table 1 Remote control command format

C1, C2, C3 are user codes. Connecting diodes between T1, T2, T3 and CODE respectively means C1, C2, C3 are high level "1", and not connecting diodes means low level "0". In Figure 2, C1C2C2=111. D1, D2, D3, D4, D5, D6 are the data codes to be sent. The corresponding relationship between key numbers and key codes is shown in Table 2.

3.jpg

Table 2 Correspondence between key numbers and key codes

The waveform of the PT2248 remote control command is that the duty cycle of the positive pulse is 1/4, which represents "0", and the duty cycle of the positive pulse is 3/4, which represents "0".

Table “1” is shown in Figure 2.

4.gif

Figure 2 Waveform of remote control command

Whether "0" or "1", the positive pulse is modulated on the 38KHZ carrier during transmission, and the duty cycle of the carrier is 1/3, which is conducive to reducing power consumption. Each transmission cycle is sent serially in the order of C1, C1, C2, H, S1, S2, D1, D2, D3, D4, D5, D6, with a total length of 48a, where a is 1/4 of each bit code period, and its size is: a=192/fosc seconds=192/455KHE=0.422ms. When a key from 00H to 0BH is pressed, the output pin TXOUT sends two cycles of 12-bit code, with an interval of 80a. The infrared remote control keyboard receiving circuit composed of GL3276A is shown in Figure 3.

5.gif

Figure 3 Schematic diagram of infrared remote control keyboard receiving circuit

When the infrared remote control keyboard receiving circuit is working, after the receiving tube PH302B receives the infrared signal of the remote control command with a carrier frequency of 38KHZ, it will amplify, limit and detect, detect the pulse envelope of the remote control command, filter out the 38KHZ carrier frequency, and obtain the pulse signal of the remote control command. After shaping and reversing, it will be output from OUT. The OUT of GL3276A will be shaped by the 74LS14 Schmitt trigger, and finally the ideal reverse pulse signal of the remote control command will be obtained. The waveform of the reverse pulse signal of the remote control command obtained is that the duty cycle of the positive pulse is 1/4, representing "1", and the duty cycle of the positive pulse is 3/4, representing "0", as shown in Figure 4. Figure 4 Waveform of the reverse pulse signal of the remote control command

4. Software design of infrared remote control keyboard

The OUT output signal of GL3276A is shaped by the two-stage Schmitt inverter of 74LS14 and then connected to P3.2 (/INTO) of 89C51. Since each bit of code has a cycle of 4a, and the start of each bit is always from high level to low level, the decoding process can use the starting edge of each bit of code as the interrupt request signal of /INTO. After the interrupt response, the /INTO interrupt is turned off, and then a/2 is delayed. The output signal of the infrared remote control receiving circuit is sampled by P3.2, and then a is delayed. The sampling is performed at 3a/2, 5a/2, and 7a/2 respectively. The corresponding relationship between the waveform and the sampling time is shown in Figure 5. [page]

6.gif

Figure 5 Correspondence between waveform and sampling time

As shown in Figure 5, the received "0" is composed of 'low-high-high', and the "1" is composed of 'low-low-high'. When the sampling is completed at 7a/2, the /INTO interrupt is turned on to prepare for the sampling of the next bit code until the /INTO interrupt is 24 times (two cycles of serial 12-bit code). The interrupt service subroutine starts to preset the sample code 0FH, and P3.2 samples the output signal of the infrared remote control receiving circuit at a/2, 3a/2, 5a/2, and 7a/2 respectively. If it is a high level, the sample code remains unchanged. If it is a low level, the corresponding position of the sample code is 0, and finally the sample code is stored in the specified RAM unit.

The reliability of the remote control keyboard is a key issue to be considered in the design of software and hardware. In terms of hardware, the OUT of GL3276A is shaped by 74LS14 Schmitt to improve the anti-interference ability. In terms of software, to decode correctly, it is necessary to start receiving from the start bit of each bit of the code. In this design, the start code of the remote control command sent by PT2248 is the user code C1C2C3=111. Because the "1" received by P3.2 is composed of 'low low low high', the received code should be three "0001". If not, this reception is invalid. Secondly, in order to prevent receiving errors, the 12-bit serial codes of the two cycles received twice before and after should be compared for consistency. If they are the same, they should be compared with the key code in the key code table to find the corresponding key number, otherwise this reception is invalid. See Figure 6 for the flowchart of the decoding program.

 

7.gif

Figure 6 Decoding program flow chart

5. Conclusion

This article introduces an interface principle and method of using an infrared remote control as a microcontroller input keyboard. The design is ingenious, the structure is reasonable, and the cost is low. We have successfully used this interface method to realize the wireless operation of the microcontroller keyboard. In this article, the PT2248 integrated chip is used as the transmitting part. For other types of transmitting chips, this interface principle is still applicable. You only need to modify the interrupt service program accordingly. If the microcontroller system has extra external interrupt resources, the received signal can be input to the interrupt pin. By combining the external interrupt with the timer, the CPU time occupied during the receiving process can be reduced. Using this technology, we have achieved good application in the "Development of Intelligent Milk Quality Rapid Detector" project.

Remote control technology has gone through wired remote control, radio wave remote control, and now infrared remote control. The technology is quite mature, with more and more powerful functions, more and more stable operation, and more and more extensive applications. If advanced remote control technology is used in industrial control with single-chip microcomputers, the operation of the control system will become easier, faster, more convenient, and safer.

references

[1] Chen Mingying, 8051 Microcontroller Course Design, Tsinghua University Press, 2004

[2] Qiushi Technology Microcontroller Typical Module Design Example Navigation? People's Posts and Telecommunications Press, 2004

[3] Li Jianhua, Principles and Production of Practical Remote Control, Posts and Telecommunications Press, 1996.

[4] Zheng Fengyi, Principles and Maintenance of Color TV Remote Control System, Posts and Telecommunications Press, 1997.

[5] Fan Changxin, Zhang Puxu, Xu Bingxiang, and Wu Chengke, Principles of Communications, National Defense Industry Press, 2001.

[6] Wang Ting, Microcontroller Decoding Technology for Color TV Remote Controls, Publishing House of Electronics Industry, 1997.

Keywords:MCU Reference address:Design of infrared remote control keyboard for industrial control computers

Previous article:Interface design of bank queuing system based on I2C bus
Next article:Inkjet Printer Control Technology Based on 51 Single Chip Microcomputer

Recommended ReadingLatest update time:2024-11-16 15:27

Robotic arm intelligent grabbing system based on 89C51 microcontroller
Abstract: In the process of agricultural development, fruit picking is an extremely labor-intensive task. In order to reduce labor costs in the agricultural production process, applying artificial intelligence to the agricultural field will be an effective means. An intelligent grasping system is designed based on the
[Microcontroller]
Robotic arm intelligent grabbing system based on 89C51 microcontroller
Design of Low Power Consumption System Based on PIC Microcontroller
introduction Since the 1990s, with the continuous reduction of the feature line width of integrated circuits and the corresponding increase in chip density and operating frequency, reducing power consumption has become a major consideration in the design of submicron and deep submicron VLSI. The increase in power cons
[Microcontroller]
Design of Low Power Consumption System Based on PIC Microcontroller
Design of wide voltage intelligent flashing lamp based on single chip microcomputer
The MK6A11P microcontroller has strong anti-interference ability, contains RC oscillator, watchdog and reset circuit. Compared with other series of microcontrollers, it saves a lot of peripheral components and is low-priced, suitable for the design of various small industrial products. The intelligent flashing l
[Microcontroller]
Design of wide voltage intelligent flashing lamp based on single chip microcomputer
The realization method of serial communication between single chip microcomputer and PC
With the continuous development of single-chip microcomputer and microcomputer technology, especially the widespread application of network technology in the field of measurement and control, the multi-machine network measurement and control system composed of PC and multiple single-chip microcomputers has become a
[Microcontroller]
The realization method of serial communication between single chip microcomputer and PC
Discussion on the Design of Serial Communication between PC and Multiple MCS-51 Single Chip Microcomputers
Introduction: This paper mainly discusses the design of serial communication between PC and multiple MCS-51 microcontrollers. The software and hardware of this system have been debugged on IBM PC/XT and DICE series MCS-51 microcontrollers and run well. Its control on the simulation platform has been verified and is no
[Microcontroller]
Discussion on the Design of Serial Communication between PC and Multiple MCS-51 Single Chip Microcomputers
ATmega16 MCU Bluetooth serial port control program
/*           HC-06 Bluetooth module ATmega16 microcontroller                  VCC----------------VCC         GND----------------GND         TXD----------------RXD (PD0 port, set input)         RXD----------------TXD (PD1 port, set output)          */ /*ICCAVR7.2 programming software*/ /*Use internal 8M crystal osci
[Microcontroller]
Introduction to compiler for avr microcontroller
There are many compilers for avr, including avr studio, iccavr, cvavr, winavr, and iar. I started with studio+winavr, which seems to be used by most people. I later found it inconvenient to compile multiple files, as I had to modify the makefile. Later, I used iar, which is very useful. This software is recognized as
[Microcontroller]
Introduction to compiler for avr microcontroller
Ultra-low frequency waveform generator using MSP430F149 microcontroller
    Abstract: This paper introduces the design principle of using MSP430F149 chip to develop ultra-low frequency waveform generator and its application in physiological filter debugging.     Keywords: MSP430F149 chip microcontroller waveform generator filter system Ultra-low frequency waveform generators are c
[Test Measurement]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号