Design of infrared communication interface circuit controlled by 89C51 single chip microcomputer

Publisher:Yuexiang666Latest update time:2010-06-23 Source: 山西电子技术 Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

In communication systems, non-electrical signals are often used to transmit control signals and data to achieve remote control or telemetry functions. Infrared communication is a commonly used communication method with the characteristics of simple control, convenient implementation, and high transmission reliability. Infrared communication uses infrared rays in the 950 nm near-infrared band as the medium for transmitting information. The transmitter uses pulse-time modulation to modulate the binary digital signal into a pulse sequence of a certain frequency, and drives the infrared transmitting tube to send it in the form of light pulses. The receiving end converts the received light pulses into electrical signals. After amplification and filtering, it is sent to the demodulation circuit, restored to a binary digital signal and output.

1 Overall structure of the system

The infrared communication system adopts infrared light transmission and infinite working mechanism. Its structure mainly includes three parts: infrared transmitter, communication channel and infrared receiver.

(1) Complete the electro-optical conversion of the signal and emit infrared pulses into space

The key to the infrared transmitter is the infrared light-emitting diode and the corresponding driving circuit. The infrared light-emitting earphone light must first meet the requirement that its modulation bandwidth is greater than the spectrum width of the signal to ensure smooth communication lines. In addition, the emission wavelength of the light-emitting diode should match the peak response of the photodetector (silicon photodiode) at the receiving end to minimize the background stray light interference. At present, the infrared band of 780nm to 950nm is generally used for digital signal transmission. Since the signal-to-noise ratio of the infrared wireless communication system is proportional to the square of the transmission power, the transmission power of the infrared transmitter is appropriately increased, and measures such as spatial diversity and holographic diffusers can be used to evenly distribute the optical power of the transmitting end in space to reduce the bit error rate and improve the communication quality. Its schematic diagram is shown in Figure 1.

Infrared transmitter schematic diagram

(2) Infrared Receiver

The infrared receiver includes the infrared receiving part and the subsequent signal sampling, filtering, judgment, quantization, equalization and decoding. Its principle block diagram is shown in Figure 2.

Infrared receiver block diagram

The working process of the infrared receiving end is to first perform photoelectric conversion to convert the infrared pulse signal into an electrical signal, and then perform symbol judgment after appropriate frequency domain equalization. The symbol judgment circuit is the core part of the receiver design. Since the signal is transmitted through infrared wireless, its level variation range is large, so the symbol judgment circuit must be adaptive. The received signal becomes a digital signal after adaptive symbol judgment, and then undergoes appropriate decoding to convert it into a differential signal and enter the signal input end of the computer network card.

(3) Communication Channel

The channel of infrared wireless digital communication generally refers to the space between the transmitter and the receiver. Due to the intervention of background light signals such as natural light and artificial light sources, the influence of electrical or optical noise in the signal source and the transmitting and receiving equipment, the communication quality of infrared wireless digital communication is poor in some occasions, and channel coding technology is needed to improve the anti-interference ability.

In the infrared communication system, since the transmission power of the infrared transmitter is small and the signal is transmitted by infrared, it is easily affected by the external environment. These factors lead to the signal of the infrared receiver being very weak and the level variation range being large. Therefore, low-noise preamplifier design and adaptive symbol decision circuit are necessary. Low-noise preamplifiers generally use field effect tube amplifiers with high input impedance, and require large bandwidth, high gain, low noise, low interference, and frequency response matching the channel impulse response. The adaptive symbol decision circuit can automatically track the change of the input signal level, obtain the best threshold level, and judge the signal according to this threshold level, convert it into a digital level, and then decode it to restore the original signal. At the same time, in order to filter out low-frequency noise and artificial interference, a bandpass filter is used, in order to match the modulation characteristics and eliminate inter-symbol interference, equalization technology is often used, and in order to obtain a larger working range of the optical receiver and instantaneous field of view, a spherical optical lens is used. These measures will be conducive to improving the quality of infrared wireless communication.

2 Infrared serial communication interface circuit design

The infrared communication system controlled by the single-chip microcomputer mainly consists of three parts: infrared transmitter, infrared receiver, and single-chip microcomputer 89C51. The single-chip microcomputer itself does not have an infrared communication interface. The serial interface of the single-chip microcomputer can be used with the infrared transmitting and receiving circuits to form an infrared serial communication interface of the single-chip microcomputer control system.

2.1 Design of the launch part

The infrared transmission circuit includes pulse oscillator, transistor and infrared transmitting tube. The pulse oscillator is composed of NE555 timer, resistor and capacitor, which is used to generate 38 kHz pulse sequence as carrier signal. The infrared transmitting tube HG uses TSAL6238 produced by Vishay Company to emit 950 nm infrared beam. The transmission process is as follows: the serial data is sent out by the serial output terminal TXD of the microcontroller and drives the transistor. The digital "0" turns on the transistor. It is modulated into a 38 kHz carrier signal through the multivibrator circuit composed of NE555, and is sent out in the form of light pulses by the infrared transmitting tube. The digital "1" turns off the transistor, and the infrared transmitting tube does not emit infrared light. The oscillation period formula of the multivibrator circuit composed of NE555 is T=0. 693(R1+R2)C, where R1 is the charging resistor, R2 is the discharge resistor, and C is the charging capacitor.

2.2 Design of infrared receiver

The infrared receiving circuit uses the dedicated infrared receiving module TSOP1738 produced by Vishay. This module is a three-terminal component, powered by a single power supply +5V, with the characteristics of low power consumption, strong anti-interference ability, high input sensitivity, and insensitivity to infrared light of other wavelengths (except 950 nm). Its internal structure block diagram is shown in Figure 3.

TSOP1738 internal structure diagram

The working process of TSOPl738 is as follows: First, the received pulse infrared light signal with a carrier frequency of 38 kHz is converted into an electrical signal through an infrared photosensitive element, and then amplified by a preamplifier and an automatic gain control circuit. Then, it is filtered through a bandpass filter, and the filtered signal is demodulated by a demodulation circuit. Finally, the output stage circuit performs reverse amplification and output.

2.3 Digital display part

In the system, a dual seven-segment digital tube is used to display the sent and received data. The digital tube adopts a DPY dual-digit seven-segment common anode digital tube. The common anode of the high position is pin 10, and the common anode of the low position is pin 5. The cathode of the digital tube is controlled by the PO port of the single-chip microcomputer, and the P2.6 and P2.7 ports control the high and low positions of the digital tube respectively. When the P2 port outputs the digit "0", the corresponding transistor is turned on. According to the different digits output by the PO port, the digital tube displays different numbers. When the P2 port outputs the digit "1", the transistor is cut off and the digital tube does not display.

2.4 Design of LED display part

There are 8 light-emitting diodes connected to the P1 port of the microcontroller. The positive pole of the diode is connected to the positive pole of the power supply, and the negative pole is connected in series with a resistor and connected to the Pl port. Sending a low level to the Pl port will get different display states.

2.5 Button design

There are four buttons connected to the P3 port of the microcontroller, one side of the button is grounded, and the other side is connected to the P3.2, P3.4, and P3.5 ports of the microcontroller. The overall diagram of the infrared communication interface circuit controlled by the microcontroller is shown in Figure 4.

Overall diagram of infrared communication interface circuit controlled by single chip microcomputer

Its working process: the single-chip microcomputer sends serial data through TXD, and the multi-harmonic oscillation circuit composed of NE555 generates a 38 kHz pulse sequence as a carrier signal. The signal is sent out through the infrared transmitting tube as a 950 nm infrared beam. The infrared receiving module TOSP1738 converts the received light pulse into an electrical signal, which is then sent to the demodulation circuit for demodulation after amplification, filtering and other processing. After being restored to a binary digital signal, it is output to the RXD port of the single-chip microcomputer. The single-chip microcomputer processes the received data and displays the corresponding data on the digital tube. In this way, an infrared communication system controlled by a single-chip microcomputer realizes communication.

In order to ensure the accuracy of the infrared receiving module TSOPl738, the frequency of the carrier signal at the transmitting end should be as close to 38 kHz as possible. Therefore, when designing the pulse oscillator, it is necessary to select precision components and ensure the stability of the power supply voltage. In addition, the transmitted digit "0" must correspond to at least 14 carrier pulses, which requires that the transmission baud rate cannot exceed 2400 bps.

3 Main program of infrared communication controlled by single chip microcomputer

; P3.2 is the start key. It is also the function selection key, and P3.5 is the function confirmation key.

program

program

4 Conclusion

The infrared communication system controlled by the single-chip microcomputer has the advantages of simple hardware circuit, low cost, convenient programming, and high communication reliability. It realizes non-contact data between the communicating parties and is widely used in remote control, telemetry and other applications.

Keywords:MCU Reference address:Design of infrared communication interface circuit controlled by 89C51 single chip microcomputer

Previous article:Design of Remote Online Upgrade Program for C8051F130
Next article:Design of multi-point temperature control system based on 51 single chip microcomputer

Recommended ReadingLatest update time:2024-11-16 21:53

Low frequency digital phase measuring instrument based on AVR microcontroller and FPGA
Abstract: A system design scheme based on AVR ATmega128 microcontroller and Altera's Cyclone series EP1C3T100 is proposed. The measurement principle and measurement error of the digital low-frequency phase meter and the method of eliminating them are analyzed. The powerful computing and control functions of the micr
[Industrial Control]
Low frequency digital phase measuring instrument based on AVR microcontroller and FPGA
PIC Microcontroller for Beginners (Part 1)
Learning PIC microcontroller   for beginners  (Part 1): The pain and joy of writing driver for TS1620 character LCD module    I have been studying PIC16F87X series microcontrollers for half a month, and I have encountered many difficulties. Fortunately, there are some related books in the library of my unit, and I hav
[Microcontroller]
Single chip microcomputer lighting (lighting, flashing, running light)
1. Light up working principle: As shown in the figure, the anode of the diode is connected to the resistor, and the cathode of the diode is connected to the pin of the microcontroller. D0 corresponds to P20, D1 corresponds to P21,,,,,,,, are all controlled through the P2 hole. diode: The positive terminal of the
[Microcontroller]
Analysis of the conditions and causes of internal reset in PIC16F87X series microcontrollers
The reset function of the PIC16F87X series microcontrollers is relatively well designed. The conditions and reasons that cause the internal reset of the microcontroller can be roughly summarized into the following five types. 1. Power-on reset Every time the microcontroller is powered on, the power-on reset circuit
[Microcontroller]
Analysis of the conditions and causes of internal reset in PIC16F87X series microcontrollers
PIC microcontroller infrared remote control coding and recognition
    Infrared remote control is widely used, and encoding and recognition are often the most headaches for microcontroller beginners. In fact, infrared encoding and recognition are not difficult. The key is to master the methods of infrared encoding and recognition. First, let us understand infrared encoding.     1.
[Microcontroller]
Interpretation of 51 single chip microcomputer LED system circuit
The LED rotating display is a rotating LED display screen developed based on the principle of visual persistence. It installs 16 LED light-emitting devices on a carrier with a certain rotation speed. Each LED light-emitting tube is arranged in a straight line with equal spacing. As the rotation speed increases, the pr
[Microcontroller]
Interpretation of 51 single chip microcomputer LED system circuit
51 microcontroller learning: static digital tube experiment
Experiment name: Static digital tube experiment wiring instructions: Experimental phenomenon: After downloading the program, the leftmost digital tube of the "nixie tube module" displays the number 0. Notes: ******************* *************************************************** ******************/ #include "reg52.h"
[Microcontroller]
Idle mode and sleep mode of STC12 series microcontrollers
1. Idle mode Idle mode refers to the state where only the microcontroller is not working. At this time, the CPU has no clock and stops working, but the external interrupt, external low voltage detection circuit, timer, A/D conversion, serial port, etc. are still running normally. In idle mode, the RAM, stack point
[Microcontroller]
Idle mode and sleep mode of STC12 series microcontrollers
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号