Mobile phones and gadgets

Mobile phones and gadgets

» A simple scheme for remote control on IR rays. A simple do-it-yourself IR beam remote control system. Pinout and appearance of the main elements of the circuit

A simple scheme for remote control on IR rays. A simple do-it-yourself IR beam remote control system. Pinout and appearance of the main elements of the circuit

Yakorev Sergey

Introduction

There are many simple devices on the Internet based on PIC16F and PIC18F controllers from Microchip. I bring to your attention a rather complicated device. I think this article will be useful to everyone who writes programs for PIC18F, since you can create your own real-time system by taking the source code of the program. There will be plenty of information, starting from theory and standards, ending with the hardware and software implementation of this project. Assembly source code is 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 map size is 2 x 3 m. It is necessary to control the highlighting of selected areas. Control should be carried out remotely via an infrared control channel, hereinafter simply 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. By 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, it was necessary to go through some stages and solve various technical problems.


View from the mounting side.

Device operation algorithm

From the remote control, the information display control system should be controlled no more difficult than selecting a program on TV or setting a track number on a CD. It was decided to take the remote ready from the Philips VCR. The choice of the number of the district is set by successive pressing of the buttons of the remote control "P +", then two numeric buttons of the number of the district, we finish entering "P-". The first time you select an area, it is highlighted (the LEDs turn on), and the second time you select it, the selection is removed.
Card management protocol from a PC management server.

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

1.1. When the power is turned on on the device, the PC receives the command: MAP999
1.2. When including area: MAP(number of area)1
1.3. When disabling region: MAP(number of region)0
1.4. When including the whole map: MAP001
1.5. When turning off the whole map: MAP000

2. Incoming commands:

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

When turning off the last included area, the command "turn off the entire map" should also be received.
When you include the last non-included area, the command "enable the entire map" must also be received.
The district number is ASCII digit characters (0x30-0x39).

From idea to implementation

Anticipating that it might be a rather difficult problem to manufacture our own case for the remote control, it was decided to take a ready-made remote control from a serial device. The system of IR control commands of the RC5 format was chosen as the basis of the IR control system. Currently, remote control (RC) on IR rays is very widely used to control various equipment. Perhaps the first type of household equipment that used IR remote control was televisions. Now remote control is available in most types of household audio and video equipment. Even portable music centers have recently been increasingly equipped with a remote control system. But household appliances are not the only scope of 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 the RC-5 remote controls, and some models have quite a decent design. This allows you to get a home-made device with IR remote control at the lowest cost. Omitting 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 home appliances. When we press a button on the remote control, the transmitter chip is activated and generates a sequence of pulses that have a fill 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. Then they are fed to the decoder. Decoding is usually done in software by a microcontroller. We will talk about this in detail in the section on decoding. 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 formation of IR control systems, the signal was formed in hardware. For this, specialized ICs were developed, and now more and more remote controls are made on the basis of a microcontroller.

One of the most common transmitter ICs is the SAA3010 IC. Let's briefly consider 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 Operation mode selection input
3-6 Z0-Z3 Button Matrix Input Lines
7 MDATA Modulated output, 1/12 resonator frequency, 25% duty cycle
8 DATA Output
9-13 DR7-DR3 Scan Outputs
14 VSS Earth
15-17 DR2-DR0 Scan Outputs
18 OSC 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 heart of the remote control. In practice, the same remote control can be used to control multiple devices. The transmitter chip can address 32 systems in two different modes: combined mode 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 the command related to this system is transmitted. Thus, to transmit any command, successive pressing of two buttons is required. This is not very convenient and is justified only 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, only one button press is required to send any command. Using the switch, you can work with several systems. And in this case, only one button press is required to transmit the command. The transmitted command will refer to the system currently selected with the switch.

To enable the combined mode, the output of the transmitter SSM (Single System Mode) must be applied low. In this mode, the transmitter chip 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 is pressed in an X-DR or Z-DR matrix, the keyboard debounce cycle is initiated. If the button is closed for 18 cycles, the "generator enable" signal is fixed. At the end of the debounce cycle, the DR outputs are turned off and two scan cycles are started, turning on each DR output in turn. In the first scan cycle, the Z-address is found, in the second - the X-address. When the Z-entry (system matrix) or the X-entry (instruction matrix) is found to be in the zero state, the address is latched. When a button is pressed in the system matrix, the last command (i.e., all command bits are equal to one) is transmitted 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 starts, a reset occurs. If the transfer has started, 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 transmitter X-lines 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 scans, the system address is determined and stored in a latch. In the second cycle, the command number is determined. This command is sent along with the system address stored in a latch. If there is no Z-DR jumper, then no codes are transmitted.

If the button was released between sending the code, then a reset occurs. If the button is released during the debounce routine or during the sensor scan, but before a button press is detected, then a reset also occurs. Outputs DR0 - DR7 have an open drain, at rest the transistors are open.

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 or a new press has occurred. The control bit is inverted only after a fully completed send. Scanning cycles are performed before each message, so even if you change the pressed button to another during the transmission of the message, the system number and commands will still be transmitted correctly.

The OSC pin is the input/output of a 1-pin oscillator and is designed to connect a ceramic resonator at a frequency of 432 kHz. In series with the resonator, it is recommended to include a resistor with a resistance of 6.8 Kom.

Test inputs TP1 and TP2 must be connected to ground during normal operation. A high logic level on TP1 increases the scan frequency, and a high level on TP2 increases the frequency of the shift register.

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

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


Figure 2. Data word format of the RC-5 code.

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, the data word is transmitted at 64 clock intervals, i.e. 113.778 ms (Fig. 2).

The first two pulses are start pulses and both are logical "1s". Note that half of the bit (empty) passes before the receiver determines the real start of the message.
The extended RC5 protocol uses only 1 start bit. The S2 bit is transformed and added to the 6th command bit, making 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 is periodically pressed.
The next 5 bits represent the address of the IR device, which is sent with the first LSB. The address is followed by 6 command bits.
The message contains 14 bits, together with the pause, have a total duration of 25.2 ms. Sometimes the message may be shorter due to the fact that the first half of the start bit S1 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 be repeated every 114ms. The control bit will remain the same in all messages. This is a signal for the receiver program 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 the RC-5 code.

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

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

To ensure that the equipment responds equally to RC-5 commands, the codes are distributed in a very specific way. This standardization allows you to design transmitters that allow you to control various 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 household appliances are listed below:

0 - TV
2 - Teletext
3 - Video data
4 - Video player (VLP)
5 - Video Cassette Recorder (VCR)
8 - Video tuner (Sat.TV)
9 - Camcorder
16 - Audio preamplifier
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 - Numerical values ​​0-9
12 - Standby mode
15 - Display
13-mute
16 - volume +
17 - volume -
30 - search ahead
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 operate in remote controls at pulsed currents of about 1 A. It is very convenient to build an LED driver on a low-threshold (logic level) MOSFET, for example, KP505A. An example of a circuit diagram of the console is shown in fig. 5.

Figure 5. Schematic diagram of the RC-5 console.

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

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 control receiver must recover data with bi-phase encoding, it must respond to large, rapid changes in signal level, regardless of interference. The pulse width at the receiver output should differ from the nominal value by no more than 10%. The receiver must be insensitive to constant external illumination. Satisfying all these requirements is not easy. Old implementations of the IR remote control receiver, even with the use of specialized microcircuits, contained dozens of components. Such receivers often used resonant circuits tuned to 36 kHz. All this made the design difficult to manufacture and adjust, 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 shaper. At the output, a regular TTL signal is formed without filling 36 kHz, suitable for further processing by the microcontroller. Such receivers are manufactured by many companies, these are SFH-506 from Siemens, TFMS5360 from Temic, ILM5360 from Integral and others. At present, there are also more miniature versions of such microcircuits. Since there are other standards besides RC-5 that differ, in particular, in the duty cycle, there are integrated receivers for different frequencies. To work with the RC-5 code, you should choose models designed for a duty cycle of 36 kHz.

As an IR remote control receiver, you can also use a photodiode with an amplifier-shaper, which can serve as a specialized microcircuit KR1568KhL2. A diagram of such a receiver is shown in Figure 6.

Figure 6. Receiver on the KR1568HL2 chip.

For the information display control system, I chose an integrated IR remote control receiver. A highly sensitive PIN photodiode is installed as an optical radiation receiver in the TSOP1736 microcircuit, the signal from which is fed to the input amplifier, which converts the output current of the photodiode 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 the demodulator, which consists of a detector and an integrator. In the pauses between pulses, the AGC system is calibrated. This is controlled by the control scheme. Thanks to this construction, the microcircuit does not respond to continuous interference even at the operating frequency. The active level of the output signal 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 electric screen and are filled with special plastic. This plastic is a filter that cuts off optical interference in the visible light range. Thanks to all these measures, the microcircuit is characterized by a very high sensitivity and a low probability of false signals. However, integrated receivers are very sensitive to power noise, so it is always recommended to use filters such as RC. The appearance of the integrated photodetector and the location of the pins are shown in fig. 7.

Figure 7. Integrated receiver RC-5.

RC-5 decoding

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 cycles to generate time delays and measurement intervals. This is not suitable for our case. It was decided to use interrupts on the fall of the signal at the INT input of the PIC18F252 microcontroller, measure the time parameters using TMR0 of the PIC18F252 microcontroller, the same timer generates an interrupt when the next pulse timeout has elapsed, i.e. when there is a pause between two messages. The demodulated signal from the output of the DA1 microcircuit is fed to the INT0 input of the microcontroller, in which it is decoded and the decoded command is issued to the 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 can see 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 which bit was before. In the program below with detailed comments, this is very clearly visible. The entire project is available for download and use for personal purposes. When reprinting a link is required.

In television, household, medical equipment and other equipment, IR receivers of infrared radiation are widely used. They can be seen in almost any kind of electronic equipment, they are controlled using a remote control.

Typically, an IR receiver microassembly has three pins. One is common and is connected to the power minus GND, the other to the plus Vs, and the third is the output of the received signal Out.

Unlike a standard IR photodiode, an IR receiver is capable of not only receiving, but also processing an infrared signal in the form of pulses of a fixed frequency and a given duration. This protects the device from false alarms, background radiation and interference from other household appliances emitting in the IR range. Sufficiently strong interference for the receiver can be created by fluorescent energy-saving lamps with an electronic ballast circuit.

A micro-assembly of a typical IR radiation receiver includes: PIN photodiode, adjustable amplifier, band pass filter, amplitude detector, integrating filter, threshold device, output transistor


A PIN photodiode from the photodiode family, in which, between the n and p regions, another region is created from its own semiconductor (i-region) - this is essentially a layer of pure semiconductor without impurities. It is this that gives the PIN diode its special properties. In the normal state, no current flows through the PIN photodiode, since it is connected to the circuit in the opposite direction. When electron-hole pairs are generated in the i-region under the action of external IR radiation, a current begins to flow through the diode. Which then goes to an adjustable amplifier.

Then the signal from the amplifier goes to a bandpass filter that protects against interference in the IR range. The bandpass filter is tuned to a strictly fixed frequency. Typically, filters are applied that are tuned to a frequency of 30; 33; 36; 36.7; 38; 40; 56 and 455 kilohertz. In order for the signal emitted by the remote control to be received by the IR receiver, it must be modulated with the same frequency as the filter is set to.

After the filter, the signal goes to the amplitude detector and the integrating filter. The latter is necessary to block short single signal bursts that may appear from interference. Further, the signal goes to the threshold device and the output transistor. For stable operation, the gain of the amplifier is adjusted by the automatic gain control (AGC) system.

Housings of IR modules are made in a special shape that helps to focus the received radiation on the sensitive surface of the photocell. The body material transmits radiation with a strictly defined wavelength from 830 to 1100 nm. Thus, the device uses an optical filter. To protect the internal elements from the effects of external email. fields, an electrostatic shield is used.

Below we will consider the operation of the IR receiver circuit, which can be used in many amateur radio developments.

There are various types and schemes of IR receivers depending on the wavelength, wavelength, voltage, data packet, etc.

When using the circuit in combination with an infrared transmitter and receiver, the wavelength of the receiver must necessarily match the wavelength of the IR transmitter. Let's consider one of these schemes.

The circuit consists of an IR phototransistor, a diode, a field effect transistor, a potentiometer, and an LED. When the phototransistor receives any infrared radiation, current flows through it and the field effect transistor turns on. Further, the LED lights up, instead of which another load can be connected. The potentiometer is used to control the sensitivity of the phototransistor.

Checking the IR Receiver

Since the IR signal receiver is a specialized microassembly, in order to make sure that it works, you need to apply a supply voltage to the microcircuit, usually 5 volts. The current consumption in this case will be about 0.4 - 1.5 mA.

If the receiver does not receive a signal, then in the pauses between bursts of pulses, the voltage at its output practically corresponds to the supply voltage. Its between GND and the signal output pin can be measured with any digital multimeter. It is also recommended to measure the current consumed by the microcircuit. If it exceeds the standard one (see the reference book), then most likely the microcircuit is defective.

So, before starting the module test, we must determine the pinout of its outputs. This information is usually easy to find in our mega electronics datasheet guide. You can download it by clicking on the picture on the right.

Let's check on the TSOP31236 chip, its pinout corresponds to the figure above. We connect the positive output from the self-made power supply to the positive output of the IR module (Vs), and the negative output to the GND output. And we connect the third output OUT to the positive probe of the multimeter. We connect the negative probe to the common GND wire. We switch the multimeter to DC voltage mode at 20 V.


As soon as bursts of infrared pulses from the photodiode of the IR microassembly begin to arrive, the voltage at its output will drop by several hundred millivolts. In this case, it will be clearly visible how the value on the multimeter screen decreases from 5.03 volts to 4.57. If we release the remote control button, then the screen will again display 5 volts.

As you can see, the IR receiver responds correctly to the signal from the remote control. So the module is correct. Similarly, you can check any modules in the integrated design.

Single-channel receiver module with relay, to be triggered by any standard infrared remote control, provides remote control of any load via an invisible IR channel. The project is based on PIC12F683 microcontroller and TSOP1738 is used as infrared receiver. The microcontroller decodes the serial draft of the RC5 data coming from the TSOP1738 and provides output control if the data is valid. The output can be set to various desired states using a jumper on the board (J1). There are 3 LEDs on the PCB: power indicator, transmission presence and relay operation. This circuit works with any RC5 TV remote, center and so on.

Features of the scheme

  • Receiver power supply 7-12V DC
  • Current consumption of the receiver up to 30 mA
  • Range up to 10 meters
  • RC5 signal protocol
  • Board dimensions 60 x 30 mm

Although it has recently become fashionable to use a radio channel, including Bluetooth, it is not at all easy to make such equipment on your own. In addition, radio waves are subject to interference, and it is elementary to intercept them. Therefore, the IR signal in some cases will be preferable. Firmware, printed circuit board drawings and a full description in English -

The design is a so-called infrared barrier and can be used to protect the perimeter, windows, balconies and other poorly protected openings. The author used a similar design to protect the loggia and was satisfied with the stability of the work and the absence of false positives. According to him, the device worked reliably at temperatures from -25 to +30 °C.

Structurally, the security system consists of two blocks - an IR transmitter and a receiver, which should be located on the sides of the opening, while the width of the opening itself can reach 9 m. no worries either. As soon as the invisible beam is crossed by the intruder, the alarm is activated.

The transmitter is an asymmetric multivibrator assembled on transistors VT1 and VT2. The frequency and duty cycle of the pulses depends on the ratings of the R1C1 chain and, with the values ​​\u200b\u200bspecified in the diagram, is approximately equal to 10 kHz. Resistor R2 is current limiting for infrared LED HL1.

The receiver is assembled on the timer KR1006VI1 (foreign analogue 555), the role of the IR receiver is performed by the VT3 phototransistor, which has a sufficiently large current gain. For use in the design, it will have to be slightly modified - carefully cut off the upper part of the case with a needle file so that light falls on the crystal. In principle, the FD-24K photodiode can be a good alternative to a phototransistor, but its cost is much higher.

The sensitivity of the start input Z of the timer depends on the value of the resistor R3, which is the load of the phototransistor VT3 - the higher the value, the higher the sensitivity of the receiver. The DA1 timer itself is included according to the classical scheme of the missed pulse detector. While pulses from the photosensor pass to the input 2 of the microcircuit, the timer is constantly restarted without completing the duty cycle. Its Out output is constantly high. Transistor VT4 is open, trinistor VS1 is closed, relay K1 is de-energized.

As soon as the IR beam is blocked by the intruder, the pulses at the reset input will disappear, the counting cycle will be normally completed and the pin 3 of the timer will go low. Transistor VT4 will close, trinistor VS1 will open and turn on relay K1, which, with its normally open contacts, will turn on an alarm or any other actuator. It is worth noting that the R4R5C3 chain is selected in such a way that to complete the timer's working cycle, it is enough to skip a few pulses from the transmitter - the alarm is triggered when a tennis ball passes between the transmitter and the receiver. To reduce the sensitivity, it is enough to increase the value of the resistor R6 or capacitor C3. After the restoration of the passage of the IR beam, the circuit will return to its original state, with the exception of the trinistor, which will remain open and will not remove the alarm until its supply circuit is briefly interrupted by the SA1 switch.

About the details. The transmitter can use transistors KT315A - B, KT375A-B, KT3102B-E (VT1). KT3107A or KT361A - G will work in place of VT2. Capacitor C2 is an oxide type K50-20. The transmitter circuit practically does not need to be adjusted. The receiver can use transistors KT312B - V, KT315A - B or any other low-power n-p-n structure (VT4). Relay RES15 passport RS4.591.004 or RES10 with passport RS4.524.302 is used as K1. Trinistor - KU101 or KU201 with any letter index. In the second case, you may have to choose the value of the resistor R7.

Oxide capacitors - K50-20 for an operating voltage of at least 25 V, the rest - KM5, KM6-B. Resistors - MLT-0.25. Any stabilized voltage source of 9-15 V is suitable as a power source for the system. Current consumption in armed mode (receiver + transmitter) is 25-30 mA.

When you turn it on for the first time, due to the discharged capacitor C3, the timer will immediately start and the alarm will turn on, to turn off which it is enough to briefly turn off switch SA1.

A.P. Kashkarov "Photo and thermal sensors in electronic circuits", 2004

We present a simple project to create a long-range IR barrier - up to 5 meters. The device can also be used as a proximity or intersection sensor. The infrared barrier has a relay output, which allows you to connect it to any electrically powered device (lamp, motor, alarm, etc.). The high power of the transmitter and the sensitivity of the receiver make it possible to cover distances up to 4 meters, as well as the use of a reflector as a sensor up to a distance of 1 meter.

IR transmitter circuit

The barrier has two modules: one is a transmitter and the other is a receiver. The transmitter uses a classic, on a 555 chip, which works as a pulse generator. The BC327 transistor amplifies these pulses and supplies them to infrared LEDs.

Pulse transmission has two advantages. First: the receiver, with the help of filters, can highlight the transmitter signal against the background of interference. Second: if the pulses are short, then you can use more power of the LEDs in the emitters, without the risk of burning them, and thus, getting a larger radius of action. With the detail values ​​shown in the diagram, the transmit frequency will be 1.3 kHz and the pulses will have a width of 25 µs. And the periods of silence will be 750 microseconds. The ratio is 1 to 30.



The printed circuit board provides the ability to connect 3 LEDs at once. But you can connect only one LED, two or three. If you do not connect all the LEDs, you need to solder jumpers from a piece of wire instead of LEDs. LED current limiting resistance 10 ohm. You can increase it if you want to reduce the output radiation power.

IR receiver circuit

The receiver circuit is more complex than the transmitter and uses the LM324 op amp as an operational amplifier. The weak IR signal that goes to the phototransistor will amplify and filter out the first op-amp element, and then again amplify and correct through the second op-amp element and the 1N914 diodes.


The range of the security barrier depends on the power and concentration of the infrared light produced by the LEDs, and can vary from 1 meter to 5 meters. If not possible, more common LEDs can be used, such as LD271, LD274 or any other IR LED for TV remote control. The phototransistor used here is the SFH309 type, but other types will do.



Note that the circuit has no memory (the relay is activated only at the moment when the barrier is interrupted) and when a person passes further, the relay is turned off. So when using the module as part of a homemade security device, you need to add the ability to hold it for a while.