IR remote control device. Scheme of remote control of devices. From idea to implementation

Hi all! Here we will talk about how to make the simplest IR control (). You can even control this circuit with a regular TV remote control. I warn you right away, the distance is not great - about 15 centimeters, but even this result will please a beginner in the work. With a homemade transmitter, the range doubles, that is, it approximately increases by another 15 centimeters. The remote control unit is made simply. We connect the IR LED to the 9-volt “crown” through a 100-150 ohm resistor, while installing a regular button without locking, glue it to the battery with electrical tape, and the electrical tape should not interfere with the infrared radiation of the IR LED.

The photo shows all the elements that we need to assemble the circuit

1. Photodiode (almost any one is possible)
2. Resistor for 1 ohm, and for 300-500 ohms (For clarity, I placed resistors for 300 and 500 ohms in the photo)
3. Trimmer resistor for 47 kom.
4. Transistor KT972A or similar in current and structure.
5. You can use any low-voltage LED.

Schematic diagram IR control receiver on one transistor:


Let's start making a photodetector. His diagram was taken from one reference book. First we draw the board with a permanent marker. But you can do this even by hanging installation, but it is advisable to do it on PCB. My board looks like this:


Well, now, of course, let's start soldering the elements. Soldering the transistor:



Solder a 1 kOhm resistor (Kilohm) and a construction resistor.


And finally we solder the last element - this is a 300 - 500 Ohm resistor, I set it to 300 Ohms. Posted it with reverse side printed circuit board, because he didn’t allow me to touch him from the front side, because of his mutation paws =)


We clean the whole thing with a toothbrush and alcohol in order to wash off the remaining rosin. If everything is assembled without errors and the photodiode is working properly, it will work immediately. A video of this design in action can be seen below:

In the video, the distance is small, since you had to look at both the camera and the remote control at the same time. Therefore, I could not focus the directions of the remote control. If you put a photoresistor instead of a photodiode, it will react to light, I personally verified that the sensitivity is even better than in original diagrams photoresistor. I supplied 12V to the circuit, it works fine - the LED lights up brightly, the brightness and sensitivity of the photoresistor is adjusted. Currently, using this circuit, I am selecting elements so that I can power the IR receiver from 220 volts, and the output to the light bulb is also 220V. Special thanks for the diagram provided: thehunteronghosts . Material provided by:

Having collected JDM programmer, let's start looking for some easy-to-repeat pattern. Quite often these are banal LED flashing lights or LED clocks, but the first option practical application almost none, and the second one is often not suitable, not because it is undesirable, but because a radio amateur, especially a beginner or living in the outback, does not always have the necessary components (for example, quartz resonator or LED indicators).


The scheme proposed below, taken from the Zhelezo-off website (http://aes.at.ua/publ/31-1-0-61), uses more accessible elements.

I replaced the TSOP1738 photosensor with a TSOP1736, but you can experiment with similar parts removed from faulty equipment.

The microcontrollers indicated in the diagram are flashed with different firmware - both firmware versions can be downloaded from the site mentioned above.

You can use any relay with a winding voltage of 12 volts.

A little about the remaining details, since the values ​​of some of them are not very clear in the diagram:
C1 - 220 µF 25 V;
C2 - 220 µF, at least 10 V;
C3 - 0.1 μF (here a typo crept into the author’s diagram - the next capacitor, electrolytic, must have serial number 4);
C4 - 4.7 µF 10 V;
R1 - 330 Ohm;
R2 - 1K;
R3 - 4.7 K;
T1 - BC547, KT315 or other similar transistors of the N-P-N structure;
LED - LED of any type and color of your choice;
D1 - 1N4148, 1N4007 or analogues;
Button - without fixation.
Stabilizer - any 5 volt.

Remote control (RCU, remote control unit, RCU, remote control unit) is an electronic device for remote (remote) control of another electronic device at a distance. They exist in both autonomous and (much less frequently) non-autonomous (wired) versions. Structurally - usually a small box containing electronic circuit, control buttons and autonomous power supply.

Remote control panels are used to control systems and mechanisms on mobile objects (airplanes, spaceships, ships, etc.), control production processes, communication systems, military facilities. They are also widely used for remote control of televisions, stereo systems, audio and video players, and other household electronic equipment (sending commands for switching TV channels, audio tracks, volume control, etc.). A household remote control is small device with buttons, powered by batteries and sending commands via infrared radiation. Most modern consumer electronics contain a limited set of controls on the body and a full set on the remote control.

Car alarms and some digital cameras have unique remote controls. There are also remote controls for controlling robots, aircraft models, etc. (Figure 1.2).

Figure 1.2 - Various remote controls for household appliances

1.2.1 History of remote control

One of the earliest examples of remote control devices was invented and patented by Nikola Tesla in 1893.

In 1903, the Spanish engineer and mathematician Leonardo Torres Quevedo introduced the Telekino at the Paris Academy of Sciences, a device that was a robot that carried out commands transmitted via electromagnetic waves. In the same year he received patents in France, Spain, Great Britain and the USA. In 1906, in the port of Bilbao, in the presence of the king and a large crowd of spectators, Torres presented his invention, steering a boat from a ship. Later he tried to adapt Telekino for shells and torpedoes, but abandoned the project due to lack of funds.

The first remote-controlled airplane model was launched in 1932. The use of remote control for military purposes was then worked on intensively during World War II, for example in the German Wasserfall surface-to-air missile project.

The first TV remote control was developed by the American company Zenith Radio Corporation in the early 1950s. It was connected to the TV with a cable. In 1955, the Flashmatic wireless remote control was developed, based on sending a beam of light towards a photocell. Unfortunately, the photocell could not distinguish the light from the remote control from light from other sources. In addition, it was necessary to point the remote control precisely at the receiver.

In 1956, Austrian-American Robert Adler developed the Zenith Space Commander wireless remote control. It was mechanical and used ultrasound to set the channel and volume. When the user pressed the button, it clicked and struck the plate. Each plate produced noise of a different frequency and the TV circuits recognized this noise. The invention of the transistor made it possible to produce cheap electric remote controls that contain a piezoelectric crystal that powers electric shock and oscillating at a frequency exceeding the upper limit of human hearing (though audible to dogs). The receiver contained a microphone connected to a circuit tuned to the same frequency. Some problems with this method were that the receiver could be triggered by natural noise and that some people, especially young women, could hear the high-pitched ultrasonic signals. There was even a case where a toy xylophone could change channels on this type of TV because some of the xylophone's overtones were the same frequency as the signals from the remote control.

In 1974, GRUNDIG and MAGNAVOX released the first color TV with an IR microprocessor control. The TV had an on-screen display (OSD) - the channel number was displayed in the corner of the screen.

The impetus for more sophisticated types of remote controls came in the late 1970s when Teletext was developed by the BBC. Most remote controls sold at the time had a limited set of functions, sometimes only four: next channel, previous channel, volume up or down. These remote controls did not meet the needs of teletext, where pages were numbered with three-digit numbers. The remote control, which allowed you to select a teletext page, had to have buttons for numbers from 0 to 9, other control buttons, for example to switch between text and image, as well as regular television buttons for volume, channels, brightness, color. The first televisions with teletext had wired remotes for selecting teletext pages, but the growth in the use of teletext showed the need for wireless devices. And BBC engineers began negotiations with television manufacturers, which led in 1977-1978 to the appearance of prototypes that had much larger set functions. One of the companies was ITT, the infrared communication protocol was later named after it.

In the 1980s, Stephen Wozniak of Apple founded the company CL9. The company's goal was to create a remote control that could control several electronic devices. In the fall of 1987, the CORE module was introduced. Its advantage was the ability to “learn” signals from different devices. It also had the ability to perform certain functions at designated times thanks to a built-in clock. It was also the first remote control that could be connected to a computer and loaded with updated software code. CORE hasn't had much of an impact on the market. It was too difficult to program for the average user, but it received rave reviews from people who were able to figure out its programming. These obstacles led to the dissolution of CL9, but one of its employees continued the business under the Celadon brand.

By the early 2000s, the number of household electrical appliances increased dramatically. To control a home theater, you may need five or six remote controls: from a satellite receiver, video recorder, DVD player, television and sound amplifier. Some of them need to be used one after the other, and due to the fragmentation of control systems, this becomes cumbersome. Many experts, including renowned expert and inventor of the modern remote control Robert Adler, have noted how confusing and clunky it can be to use multiple remote controls.

The emergence of PDAs with an infrared port made it possible to create universal remote controls Remote control with programmable control. However, due to its high cost, this method has not become very widespread. Special universal learning control panels have not become widespread due to the relative complexity of programming and use. It is also possible to use some mobile phones for remote control (via Bluetooth channel) of a personal computer.

Below are schematic diagrams and articles on the topic “IR rays” on the radio electronics and radio hobby website.

What are “IR rays” and where is it used, schematic diagrams of homemade devices that relate to the term “IR rays”.

Schematic diagram. Like the previous version, this transmitter provides a short range (up to 10 m). In addition, the LEDs used as emitters are directional, which allows you to control the model only within the irradiation zone... IR pulses modulated by the command signal are supplied to the photodiode VD1. The changing current of the photodiode through the emitter follower VT2 is supplied to the input of the three-stage amplifier VT3-VT5. On transistor VT1 there is a unit for compensating for interference from... In this shooting range they shoot pulses of infrared radiation. The gun contains a power source and a DC voltage converter into rectangular pulses, the duration and amplitude of which are determined by the capacitance of capacitors C2-C5. A packet of pulses arrives at the infrared emitter... Wireless headphones allow you to receive soundtrack TV, radio signal, tape recorder within one medium-sized room. The device operates based on the transmission of a frequency-modulated light signal in the infrared range. The kit includes... Thanks to the use of specialized coding integrated circuits this device can be used to control central locking in the car, activating the car alarm, garage doors, gates, lighting, etc. The kit consists of two parts: the transmitter and... The infrared receiver circuit is designed in such a way that it can work with any remote control: from the TV receiver , satellite tuner, VCR. The device works with most remote control buttons. The receiver operates as follows: a signal from the receiving diode... An optoelectronic barrier is used to protect objects. Thanks to it, you can turn on the alarm when an unauthorized person approaches the object. The barrier uses infrared radiation, the beam of which is transmitted from the transmitter to the receiver. Interruption of the beam causes a change in the output state... Standard remote control systems used in video technology are made on specialized microcircuits and provide a very large set of commands. But to control simple devices such a large number of commands is not required. In principle, even for operational control of a TV... The TRC1300N microcircuit is an encoder / decoder for remote control systems operating through a communication channel using infrared rays or via a radio channel. Depending on the logical level at pin 2 of the microcircuit, it works either as an encoder that generates pulses, or as... Light can be used as a medium for transmitting information. This can be ordinary (visible) light or infrared radiation - infrared rays. Schemes of simple optical transmitters for light telephones (photophones) using simple incandescent lamps are considered, as well as... Domestic semiconductor televisions of the USST line have already completely gone out of service, many have been thrown away and disassembled for parts. But some people still have completely working copies, used exclusively at the dacha. Indeed, our dachas are usually very poorly guarded (if at all... The device is designed to signal the passage of a person into the room through the front door or passage. The circuit works on the principle of crossing an infrared beam. When it crosses, a musical alarm is activated, warning staff that he has arrived visitor or client... Diagram of a simple homemade photo sensor for monitoring objects on a conveyor. This device is designed to turn on the load when a box or box enters a certain area of ​​​​the conveyor or conveyor belt, and turn off the load when the box leaves this zone. The device is very... Homemade IR beam intersection or reflection sensor on the K561LP2 chip. Many amateur radio automation circuits use infrared sensors for reflection or beam intersection, built on the element base of household radio-electronic remote control systems... A diagram of a simple homemade set-top box connected to a COM port to control a computer using a remote control. Modern Personal Computer, if the necessary peripherals are available and software able to replace a home audio-video center. You must have... A diagram of a simple homemade border crossing or entry alarm using infrared rays. In some cases, it is necessary to signal the passage of a person into a room, the passage of a car into the territory, the movement or entry of any object into a box, box... Below is a description of a simple two-command remote control system using IR rays, which can be used to control various devices, and, burglar alarm, electronic lock with remote control. The circuit is based on three LM567 microcircuits and one... The system is designed for independent control of four objects. The remote has four buttons and the receiver has four outputs. Each button on the remote control is responsible for its own receiver output; each button press changes the state of the corresponding receiver output. The receiver outputs are equipped with... Everyone knows why a microcalculator exists, but it turns out that in addition to mathematical calculations, it is capable of much more. Please note that if you press the “1” button, then “+” and then press “=”, then with each press of the “=” button the number on the display will be... The device is designed to turn on or switch something when brought to the sensor hands or other reflective surface. Sensitivity can be adjusted over a wide range, with the response range varying from several meters to several centimeters. The idea, in general...

03-01-2009

Yakorev Sergey

Introduction

IN Internet networks a lot of simple devices based on controllers of the PIC16F and PIC18F family from Microchip. I bring to your attention a rather complex device. I think this article will be useful to everyone who writes programs for the PIC18F, since you can use the source code of the program to create your own real-time system. There will be plenty of information, starting from theory and standards, ending with hardware and software implementation of this project. The assembler source codes are provided with full comments. Therefore, it will not be difficult to understand the program.

Idea

As always, everything starts with an idea. We have a map of the Stavropol Territory. There are 26 districts of the region on the map. The size of the map is 2 x 3 m. It is necessary to control the illumination of the selected areas. Control must be carried out remotely via an infrared control channel, hereinafter referred to simply as IR or IR remote control. At the same time, control commands must be transmitted to the PC-based control server. When you select an area on the map, the management server displays additional information on the monitor. Using commands from the server, you can control the display of information on the map. The task has been set. In the end, we got what you see in the photo. But before all this was realized, we had to go through some stages and solve various technical problems.


View from the installation side.

Device operation algorithm

The information display control system should not be controlled from the remote control harder to choose programs on TV or specifying the track number on a CD. It was decided to take a ready-made remote control from a Philips VCR. The selection of a district number is set by sequentially pressing the remote control buttons “P+”, then two numeric buttons for the district number, ending with “P-”. When you select an area for the first time, it is highlighted (the LED backlight turns on), and when you select it again, the selection is removed.
Protocol for managing the card from the PC control server.

1. Outgoing commands, i.e. commands coming from the device to the PC:

1.1. When you turn on the power on the device, the PC receives the command: MAP999
1.2. When turning on an area: MAP(area number)1
1.3. When turning off an area: MAP(area number)0
1.4. When the entire map is turned on: MAP001
1.5. When turning off the entire map: MAP000

2. Incoming commands:

2.1. Enable entire map: MAP001
2.2. Turn off entire map: MAP000
2.3. Include area: MAP(area number)1
2.4. Disable area: MAP(area number)0
2.5. Receive information about included areas: MAP999 In response to this command, data about all included areas is transmitted in the format of clause 1.2 (as if all included areas are being turned on again).
2.6. Receive information about disabled areas: MAP995 In response to this command, data about all disabled areas is transmitted in the format of clause 1.3 (as if all disabled areas are switched off again).

When turning off the last enabled area, the command “turn off the entire map” should also be received.
When turning on the last unincluded area, the command “turn on the entire map” should also be received.
The area number is ASCII digit characters (0x30-0x39).

From idea to implementation

Anticipating that making your own housing for the remote control could be a rather difficult problem, it was decided to take a ready-made remote control from a serial device. The IR control command system of the RC5 format was chosen as the basis for the IR control system. Currently, it is very widely used to control various equipment. remote control(DU) on IR rays. Perhaps the first type of household equipment to use IR remote control was televisions. Nowadays, remote control is available in most types of household audio and video equipment. Even portable music centers Recently, they are increasingly equipped with a remote control system. But household appliances are not the only area of ​​application for remote control. Devices with remote control are quite widespread both in production and in scientific laboratories. There are quite a lot of incompatible IR remote control systems in the world. The most widely used system is the RC-5. This system is used in many televisions, including domestic ones. Currently, different factories produce several modifications of RC-5 remote controls, and some models have quite a decent design. This allows you to get a homemade device with IR remote control at the lowest cost. Skipping the details of why this particular system was chosen, let’s consider the theory of building a system based on the RC5 format.

Theory

To understand how the control system works, you need to understand what the signal at the output of the IR remote control is.

The RC-5 infrared remote control system was developed by Philips for the needs of controlling household appliances. When we press the remote control button, the transmitter chip is activated and generates a sequence of pulses that have a filling frequency of 36 KHz. LEDs convert these signals into infrared radiation. The emitted signal is received by a photodiode, which again converts the IR radiation into electrical impulses. These pulses are amplified and demodulated by the receiver chip. They are then fed to the decoder. Decoding is usually done in software using a microcontroller. We will talk about this in detail in the section on decoding. The RC5 code supports 2048 commands. These teams make up 32 groups (systems) of 64 teams each. Each system is used to control a specific device such as a TV, VCR, etc.

At the dawn of the development of IR control systems, signal generation took place in hardware. For this purpose, specialized ICs were developed, and now, increasingly, remote controls are made based on a microcontroller.

One of the most common transmitter chips is the SAA3010 chip. Let's briefly look at its characteristics.

  • Supply voltage - 2 .. 7 V
  • Current consumption in standby mode - no more than 10 µA
  • Maximum output current - ±10 mA
  • Maximum clock frequency - 450 KHz

The block diagram of the SAA3010 chip is shown in Figure 1.

Figure 1. Block diagram of the SAA3010 IC.

The description of the pins of the SAA3010 chip is given in the table:

Conclusion Designation Function
1 X7 Button matrix input lines
2 SSM Operating mode selection input
3-6 Z0-Z3 Button matrix input lines
7 MDATA Modulated output, 1/12 cavity frequency, 25% duty cycle
8 DATA Output
9-13 DR7-DR3 Scan outputs
14 VSS Earth
15-17 DR2-DR0 Scan outputs
18 O.S.C. Generator input
19 TP2 Test input 2
20 TP1 Test input 1
21-27 X0-X6 Button matrix input lines
28 VDD Supply voltage

The transmitter chip is the basis of the remote control. In practice, the same remote control can be used to control several devices. The transmitter chip can address 32 systems in two different modes: combined and single system mode. In combined mode, the system is selected first, and then the command. The number of the selected system (address code) is stored in a special register and a command related to this system is transmitted. Thus, to transmit any command, successive pressing of two buttons is required. This is not entirely convenient and is only justified when working simultaneously with a large number of systems. In practice, the transmitter is more often used in single system mode. In this case, instead of the matrix of system selection buttons, a jumper is mounted, which determines the system number. In this mode, transmitting any command requires pressing only one button. By using the switch, you can work with multiple systems. And in this case, only one button press is required to transmit the command. The command transmitted will be related to the system that is currently selected using the switch.

To enable the combined mode, the SSM (Single System Mode) transmitter pin must be applied low. In this mode, the transmitter IC operates as follows: During rest, the X and Z lines of the transmitter are driven high by internal p-channel pull-up transistors. When a button in the X-DR or Z-DR matrix is ​​pressed, the keyboard debounce cycle is initiated. If the button is closed for 18 clock cycles, the “generator enable” signal is fixed. At the end of the debouncing cycle, the DR outputs are turned off and two scan cycles are started, turning on each DR output in turn. The first scan cycle detects the Z address, the second scan detects the X address. When the Z-input (system matrix) or X-input (command matrix) is detected in the zero state, the address is latched. When you press a button in the system matrix, the last command is transmitted (i.e., all command bits are equal to one) in the selected system. This command is transmitted until the system select button is released. When a button is pressed in the command matrix, the command is transmitted along with the system address stored in the latch register. If the button is released before transmission begins, a reset occurs. If the transfer has begun, then regardless of the state of the button, it will be completed completely. If more than one Z or X button is pressed at the same time, the generator will not start.

To enable single system mode, the SSM pin must be high and the system address must be set with the appropriate jumper or switch. In this mode, the X-lines of the transmitter are in a high state during rest. At the same time, the Z-lines are turned off to prevent current consumption. In the first of two scan cycles, the system address is determined and stored in a latch register. In the second cycle, the command number is determined. This command is sent along with the system address stored in the latch register. If there is no Z-DR jumper, then no codes are transmitted.

If the button is released between code transmissions, a reset occurs. If the button is released during the debounce procedure or while the sensor is being scanned, but before a button press is detected, a reset also occurs. Outputs DR0 - DR7 have an open drain, and the transistors are open at rest.

The RC-5 code has an additional control bit that is inverted each time the button is released. This bit informs the decoder whether the button is being held down or a new press has occurred. The control bit is inverted only after a completely completed transmission. Scanning cycles are performed before each sending, so even if you change the pressed button to another during the sending of a parcel, the system number and commands will still be transmitted correctly.

The OSC pin is a 1-pin oscillator input/output and is designed to connect a ceramic resonator at a frequency of 432 KHz. It is recommended to connect a resistor with a resistance of 6.8 Kom in series with the resonator.

Test inputs TP1 and TP2 must be connected to ground during normal operation. When the logic level on TP1 is high, the scanning frequency increases, and when the logic level on TP2 is high, the frequency of the shift register is increased.

At rest, the DATA and MDATA outputs are in the Z-state. The pulse sequence generated by the transmitter at the MDATA output has a filling frequency of 36 kHz (1/12 of the clock generator frequency) with a duty cycle of 25%. The same sequence is generated at the DATA output, but without padding. This output is used when the transmitter chip acts as a controller for the built-in keyboard. The signal at the DATA output is completely identical to the signal at the output of the remote control receiver microcircuit (but unlike the receiver, it does not have inversion). Both of these signals can be processed by the same decoder. Using the SAA3010 as a built-in keyboard controller is very convenient in some cases, since the microcontroller uses only one interrupt input to poll a matrix of up to 64 buttons. Moreover, the transmitter microcircuit allows power supply voltage of +5 V.

The transmitter generates a 14-bit data word, the format of which is as follows:


Figure 2. RC-5 code data word format.

The start bits are for setting the AGC in the receiver IC. The control bit is a sign of a new press. The clock duration is 1.778 ms. As long as the button remains pressed, a data word is transmitted at intervals of 64 clock cycles, i.e. 113.778 ms (Fig. 2).

The first two pulses are the start pulses, and both are logical "1". Note that half the bit (empty) passes before the receiver determines the actual start of the message.
The extended RC5 protocol uses only 1 start bit. The S2 bit is transformed and added to the 6th bit of the command, forming a total of 7 command bits.

The third bit is the control bit. This bit is inverted whenever a key is pressed. In this way, the receiver can distinguish between a key that remains pressed or one that is pressed periodically.
The next 5 bits represent the IR device address, which is sent with the first LSB. The address is followed by 6 command bits.
The message contains 14 bits and, together with the pause, has a total duration of 25.2 ms. Sometimes the message may be shorter because the first half of the S1 start bit is left blank. And if the last bit of the command is a logical "0", then the last part of the message bit is also empty.
If the key remains pressed, the message will repeat every 114 ms. The control bit will remain the same in all messages. This is a signal for the receiver software to interpret this as an auto-repeat function.

To ensure good noise immunity, two-phase coding is used (Fig. 3).

Figure 3. Coding "0" and "1" in RC-5 code.

When using the RC-5 code, you may need to calculate the average current draw. This is quite easy to do if you use Fig. 4, which shows the detailed structure of the parcel.

Figure 4. Detailed structure of the RC-5 package.

To ensure the equipment responds equally to RC-5 commands, the codes are distributed in a very specific way. This standardization allows transmitters to be designed to control a variety of devices. With the same command codes for the same functions in different devices a transmitter with a relatively small number of buttons can simultaneously control, for example, an audio complex, a TV and a VCR.

System numbers for some types of household equipment are given below:

0 - Television (TV)
2 - Teletext
3 - Video data
4 - Video Player (VLP)
5 - Video cassette recorder (VCR)
8 - Video tuner (Sat.TV)
9 - Video camera
16 - Audio preamp
17 - Tuner
18 - Tape recorder
20 - Compact player (CD)
21 - Turntable (LP)
29 - Lighting

The remaining system numbers are reserved for future standardization or experimental use. The correspondence of some command codes and functions has also been standardized.
Command codes for some functions are given below:

0-9 - Digital values ​​0-9
12 - Standby mode
15 - Display
13 - mute
16 - volume +
17 - volume -
30 - forward search
31 - search back
45 - ejection
48 - pause
50 - rewind
51 - fast forward
53 - playback
54 - stop
55 - entry

In order to build a complete IR remote control based on the transmitter chip, you also need an LED driver that is capable of providing a large pulse current. Modern LEDs work in remote controls when pulse currents about 1 A. It is very convenient to build an LED driver on a low-threshold (logic level) MOS transistor, for example, KP505A. An example of a circuit diagram of the remote control is shown in Fig. 5.

Figure 5. Schematic diagram of the RC-5 remote control.

The system number is set by a jumper between pins Zi and DRj. The system number will be as follows:

The command code that will be transmitted when a button is pressed that closes the Xi line with the DRj line is calculated as follows:

The IR remote receiver must recover bi-phase encoded data and must respond to large, rapid changes in signal strength regardless of interference. The pulse width at the receiver output should differ from the nominal by no more than 10%. The receiver must be insensitive to constant external light. Satisfying all these requirements is quite difficult. Older implementations of an IR remote control receiver, even those using specialized chips, contained dozens of components. Such receivers often used resonant circuits tuned to 36 kHz. All this made the design difficult to manufacture and configure and required the use of good shielding. Recently, three-pin integrated IR remote control receivers have become widespread. In one package they combine a photodiode, a preamplifier and a driver. The output generates a regular TTL signal without padding at 36 KHz, suitable for further processing by the microcontroller. Such receivers are produced by many companies, these are SFH-506 from Siemens, TFMS5360 from Temic, ILM5360 from Integral software and others. Currently, there are more miniature versions of such microcircuits. Since in addition to RC-5 there are other standards that differ, in particular, in the fill frequency, there are integrated receivers for different frequencies. To work with the RC-5 code, you should select models designed for a fill frequency of 36 KHz.

As an IR remote control receiver, you can also use a photodiode with a shaper amplifier, which can be a specialized KR1568HL2 microcircuit. The diagram of such a receiver is shown in Figure 6.

Figure 6. Receiver based on the KR1568HL2 microcircuit.

For the information display control system, I chose an integrated IR remote control receiver. A highly sensitive PIN photodiode is installed in the TSOP1736 microcircuit as an optical radiation receiver, the signal from which is fed to the input amplifier, which converts the photodiode output current into voltage. The converted signal is fed to an amplifier with AGC and then to a bandpass filter, which separates signals with an operating frequency of 36 kHz from noise and interference. The selected signal is fed to a demodulator, which consists of a detector and an integrator. In the pauses between pulses, the AGC system is calibrated. This is controlled by a control circuit. Thanks to this design, the microcircuit does not respond to continuous interference even at the operating frequency. The active output level is low. The microcircuit does not require the installation of any external elements for its operation. All its components, including the photodetector, are protected from external interference by an internal electrical screen and filled with special plastic. This plastic is a filter that cuts off optical interference in the visible range of light. Thanks to all these measures, the microcircuit is characterized by very high sensitivity and a low probability of false signals. Nevertheless, integrated receivers are very sensitive to power supply noise, so it is always recommended to use filters, for example, RC. Appearance of the integrated photodetector and the location of the pins are shown in Fig. 7.

Figure 7. RC-5 integrated receiver.

Decoding RC-5

Since the basis of our device is the PIC18F252 microcontroller, we will decode the RC-5 code in software. The RC5 code reception algorithms offered on the network are mostly not suitable for real-time devices, such as our device. Most of the proposed algorithms use software loops to generate time delays and measurement intervals. This is not suitable for our case. It was decided to use interrupts based on the signal decline at the INT input of the PIC18F252 microcontroller, measure the timing parameters using TMR0 of the PIC18F252 microcontroller, the same timer generates an interrupt when the waiting time for the next pulse has expired, i.e. when there was a pause between two sendings. The demodulated signal from the output of the DA1 microcircuit is supplied to the INT0 input of the microcontroller, in which it is decrypted and the decrypted command is issued to shift registers to control the keys. The decryption algorithm is based on measuring the time intervals between interrupts of the PIC18F252 microcontroller. If you look closely at Figure 8, you will notice some features. So if the interval between interrupts of the PIC18F252 microcontroller was equal to 2T, where T is the duration of a single RC5 pulse, then the received bit can be 0 or 1. It all depends on what bit was before it. This is very clearly visible in the program below with detailed comments. The entire project is available for download and use for personal purposes. When reprinting, a link is required.




Top