At present, projectors are common equipment in multimedia classrooms of colleges and universities. However, due to frequent use and mixed personnel, the projector remote control is often damaged or lost. Because the projectors used in schools are all imported products, it is difficult to match the remote control, and the price is very expensive if you can buy it. Using the function of the single-chip microcomputer to simulate the remote control, the low-cost projector remote control has practical promotion value.
The key to making a projector remote control is to first read out the control code data of all the buttons of the original projector remote control (same model), and then make a button control code table. During simulation, the microcontroller will transmit different control code data under button operation to achieve the purpose of remote control of the projector.
1. How to read the remote control button code
1.1 Hardware circuit for reading remote control key codes
Figure 1 shows the control circuit of the microcontroller reading the projector remote control key code. The microcontroller uses STC12C5410 from Hongjing Company. The P1.6 port light is used to indicate the code reading status. The light is on, indicating the code reading status. The P1.7 port light is used to indicate the remote control transmission operation. When it flashes, it means that the remote control code is being transmitted. In the code reading status, when the P1.6 port light is off and the P1.7 port light is on, it means that the code has been read. Pin (1) is the reset pin of the microcontroller, using a simple RC power-on reset circuit. Pin (6) is the external interrupt input port, used for the conversion control of the code reading function. When the switch at pin (6) is pressed, the system enters the interrupt code reading status. Pin (8) is used to read the output signal of the infrared receiver. Pin (11) is used as the infrared signal output port of the remote control, used to output 40KHz carrier code. Pin (12) is connected to the remote control test switch. Pins (4) and (5) are connected to an external 12M crystal oscillator.
Figure 1 Schematic diagram of the circuit for reading remote control key codes using a single chip microcomputer
When the "learning" switch is pressed, the code reading light of the P1.6 port turns on, indicating that the code reading state has been entered. At this time, press a button of the remote control that needs to be simulated against the infrared receiving head. When the light of the P1.6 port goes out and the indicator light of the P1.7 port turns on, the code reading is successful. The key code data can be obtained from the computer super terminal serial port. In order to test whether the read code is correct, you can press the transmission test switch to see if the projector function can be correctly operated. According to the above method, all the key codes of the original projector remote control are read into the computer for standby. Figures 2 and 3 are the waveform diagrams of the infrared receiving head output port and the microcontroller output port when the remote control code is transmitted.
Figure 2 Waveform of infrared receiver output port |
|
Figure 3 P3.7 output waveform during remote control transmission test |
1.2 Design of software for reading remote control key codes
Figure 4 is the main program flow of the remote control key code control software. Figure 5 is the program flow chart of interrupting the reading of key code data.
Figure 4 Main program flow chart
Figure 5 Flowchart of interrupt key code reading program
The interrupt key code reading program is very important in programming design. It needs to complete the functions of identifying the start bit of the remote control code and counting the pulse width, counting the width of the remote control code coding bit, and identifying the end bit. Through a large number of experimental analyses of different types of remote control code waveforms, the frame intermittent bit width of the remote control code is more than 10 ms, the start bit code width is between 100μs-20ms, and the coding bit is between 100μs-5ms. In order to ensure the success of reading codes for all remote controls, the following design method is adopted:
(1) Method for finding the start bit: Use a 16-bit DPTR counter to count the width of the high level. The counting sampling period is 21μs. When the high level ends, if the high 8-bit counter is non-zero, it means that the high level width exceeds 5.35ms (255×21μs). The following low level code is the start bit, otherwise start over.
(2) Reading start bit method: Use 16-bit DPTR to count the width of the low level (the maximum readable width is 1.376s). When the high level jumps, the counting ends and the high 8 bits and low 8 bits of DPTR are stored in the R4 and R5 registers respectively .
(3) Method for reading remote control code: Use the DPTR low 8-bit counter to count the width of the code (high level or low level). The counting ends when the level changes, and the value is stored in the specified address. When counting the high-level code, if the DPTR high 8-bit counter is non-zero (the width is greater than 5.35ms), it is determined to be the end frame interval bit, and OOH is written to the corresponding storage unit as the end mark.
2 Design of projector simulation remote control
2.1 Design of the hardware circuit of the simulated remote control
Figure 6 is the circuit diagram of the projector simulation remote control. It uses a 4*8 matrix key switch and can have 32 operation keys. The remote control outputs a 40K infrared modulation signal from the P3.7 port.
Figure 6 Projector simulation remote control circuit schematic
2.2 Design of remote control simulation software
In the simulation remote control, the corresponding key code transmission function is executed through the loop check key of the main program. The key code table is written in the ROM, so it cannot be changed after programming. The program includes the following main modules:
(1) Initialization procedure. Set the P1 and P3 ports, and set the counter counting mode, control word, etc.
(2) Keyboard scanning program. Complete the scanning of 32 keys and translate them into corresponding 32 key numbers to enable the execution of corresponding key functions.
(3) Button function program. Use the timer interrupt function to realize the generation of 40KHz carrier; use the corresponding start bit control data, high level control data, and low level control data of each button on the ROM table to control the carrier transmission time and interval time. The algorithm of remote control code modulation transmission is as follows:
①[Send start bit modulation wave]
Get the start bit data in the ROM table;
Turn on the 40KHZ square wave timer;
The start bit data is reduced by 1, and if it is not zero, the sentence is repeated after a delay of 21μs;
If it is zero, execute the next sentence;
②[Send high level interval bit]
Turn off 40KHZ square wave timer;
Get the high-level data in the ROM table; if the data is 0, the algorithm ends after a delay of 10ms; if it is not zero, execute the next sentence;
The data is reduced by 1, not zero, and the sentence is repeated after a delay of 21μs;
If it is zero, execute the next sentence;
③[Send low level modulation wave]
Get the low level data in the ROM table;
Turn on the 40KHZ square wave timer;
The low-level data is reduced by 1. If it is not zero, the sentence will be repeated after a delay of 21μs. If it is zero, the loop will be turned to ②.
④ Algorithm ends
3 Main performance indicators
(1) Maximum learning code length of the code reader: 206 bits
(2) Code reader recognition range: start bit: 21μs~1.376s, encoding bit: 21μs ~5.355ms
(3) Code reading error: + 21μs
(4) The frame intermittent position recognition range of the code reader is less than 1.37s and greater than 5.355ms.
(5) Simulation remote control transmission distance: greater than 10M
4 Summary
The performance of the multimedia projector's single-chip microcomputer simulation remote control is closely related to the software design, especially the sampling period of the code width count, which is related to whether the start position and the remote control code sampling accuracy can be identified. Multiple experimental tests are required during programming to balance each other. The code reading sampling period in this design is 21μs. After testing, it can correctly simulate commonly used projectors, color TVs, air conditioners and other equipment on the market.
References:
[1] An Qiling. Remote control interface of DVOD system. Microcomputer Information, 2002, 18(1): 54-55
[2] Lou Ranmiao. Design of single chip intelligent simulation remote control. Journal of Zhejiang Ocean University, 2001, 20(1): 70-73
[3] Li Jingda. Infrared remote control software decoding and its application. Microcontrollers and Embedded Systems Applications, 2002, (12): 66-67
Previous article:Design of an ultra-low power consumption dairy cow estrus monitor
Next article:Proteus virtual simulation software for single chip microcomputer
- Popular Resources
- Popular amplifiers
- A review of learning-based camera and lidar simulation methods for autonomous driving systems
- Simulation and Modeling of Chemical Sensors Volume 5 Electro-Optical Sensors Part 1 Photocopy
- The authoritative guide to AR development: Based on AR Foundation (Wang Xiangchun)
- ADS2008 RF Circuit Design and Simulation Examples (Edited by Xu Xingfu)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- [NXP Rapid IoT Review] +6. Guide to Translation Display Elements
- MicroPython driver porting for STTS751
- Please recommend a PAL video signal equalization chip or amplifier chip
- [RVB2601 creative application development] SVM40 UART communication implementation
- EEWORLD University ----TI Precision Laboratory - Isolation
- Fighting back against India? It is said that Huawei will lay off 70% of its employees in India...
- New courses are online at the beginning of the school year! Learn the latest TI training courses and win gifts
- After reviewing ten wireless sports Bluetooth headsets, I will teach you how to buy headsets under 300 yuan
- This week's highlights
- When encountering refurbished chips again, how to identify new and old chips?