Remote control scheme on IR rays. Simple Remote Control System IR Rays do it yourself

Among devices intended for remote control and control, devices using infrared (IR) radiation occupy a long-standing and honorable place.

For example, the first remote controls on infrared rays appeared in 1974, thanks to Grundig and Magnavox firms, which released the first TV equipped with such control. Sensors using IR radiation are widely used in automation.

The main advantage of control devices on IR rays is their low sensitivity to electromagnetic interference, as well as the fact that these devices themselves do not create interference with other electronic devices. As a rule, IR remote control is limited to a residential or industrial premises, and the radiation emitter and receiver must be in direct visibility and be directed to each other.

These properties determine the main scope of application of the device under consideration - remote control of household appliances and automation devices at short distances, as well as where the contactless detection of the intersection of the rectilinear spread of the radiation is required.

Even at the dawn of its occurrence, the device on IR rays were very simple in development and application, and at present, when using a modern e-database, such devices have become even easier and more reliable. How to notice to notice, even mobile phones and smartphones are equipped with an IR port for communication and management. household appliances According to the IR channel, despite the widespread use of wireless technologies, such as Bluetooth and Wi-Fi.

The whale company offers several modules working using IR radiation intended for use in DIY projects.

Consider three devices of varying degrees of complexity and destination. For convenience, the main characteristics of all devices are reduced to the table located at the end of the review.

  1. The infrared barrier is designed to be used as a security system sensor, with sporting competitions as a photofinish, as well as for remote control of automation devices at a distance of up to 50 meters.

The device consists of two modules - transmitter and receiver. The transmitter is assembled on a dual integral Timer NE556 and forms rectangular pulses with a filling of a frequency of 36 kHz. The timer has a fairly powerful current output in order to directly control the infrared LEDs connected to it.

Single analogue of the NE556 is the famous NE555 integral timer, which has already been a whole army of radio amms to development for development. electronic devices. Explore the timer on examples 20 electronic circuitsDesigned on the basis of this timer, it is possible using a set-designer "Classic circuitry" of their range of an electronics. When assembling schemes, the soldering iron does not even need; All of them are assembled on an invaluous dummy.

The emitted signal is received by the receiver, the basis of which is the specialized chip, is detected by a peak detector and enters the current amplifier on the transistor to which the relay is connected to switch the current to 10a.

The infrared barrier, despite the simplicity, is a fairly sensitive device, and allows you to work both on the "clearance" and on the "reflection" and requires the manufacture of a blend for the transmitter and receiver that eliminates the effect of reverse signals.

An example of the use of an infrared barrier together with a set of "Digital Laboratory" from the already mentioned series of the ABC of the electronics can be viewed.

  1. - This is a light switch with control from any remote control on infrared beams.

The module allows you to control lighting or other electrical devices using any remote control button.

As a rule, on each remote control there are rarely used or not used buttons. Applying this switch, you can turn on and off the chandelier, fan, etc. From the same remote control from which you manage the TV or music center.

When power is applied, the module for 10 seconds "waits" to obtain a signal corresponding to the selected button of the remote control, and after the expiration of this time "remembers" the button is pressed. After that, to trigger the module relay, it is enough to press this button once, when you press the relay again, it will turn off. Thus, the control mode of the type "trigger" is implemented. The module remains programmed even when its power is disconnected.

It should be noted that the "remembers" the last state when the power is turned off.

The device provides mode automatic shutdown The load is about 12 hours after its inclusion in case the load forgot to turn off.

The module relay can switch power up to 1500 watts.

  1. The wireless control kit over the IR channel has its own remote control with 4 buttons and 4 control channels for 2000 W each.

Each of the 4 channels of the remote control operates in the "Button" mode, i.e. The channel relay is closed while the corresponding button on the remote control is pressed.

With the help of the module, you can organize reversible control of two collector electric motors, since each relay has one normally closed (NC) and one normally open (NO) contacts with a shared wire.

For ease of use, each channel is equipped with an LED indicating the switching on the relay.

The remote control is powered by the CR2032 element.

Load control with a greater power for all discussed devices can be carried out using the expansion modules:

Up to 4000 watts: the expansion module is suitable;

Up to 8000 watts: the expansion module is suitable.

Infrared Modules

vendor code

Name

Supply voltage

Number of control channels

Maximum power load single channel, W

Examples of application

Infrared barrier

12V Permanent

Security devices; sport competitions; robotics; Automation devices

Light switch

12V permanent;

220V variables

Lighting, ventilation, heating

Wireless control set

12V Permanent

Reversible managing collector engines; 4-channel household appliances management

Hello everyone! Here we will talk about how to make the simplest IR management (). You can even manage this scheme with an ordinary remote control from the TV. I warn you right away, the distance is not large - about 15 centimeters, but even this result will make a beginner in the work. With a homemade transmitter, the range is twice, that is, it approximately increases by 15 centimeters. The block is done simply. To the 9-volt "Crown" we connect an IR LED through a resistor of 100-150 ohms, while we put the usual button without fixing, we glue it to the battery with a tape, while the tape should not prevent the infrared radiation of the IR LED.

The photo shows all those elements that we need to assemble the scheme

1. Photodiode (you can almost any)
2. Resistor for 1 com, and 300-500 ohms (for clarity in the photo, resistors for 300 and 500 ohms)
3. Strip resistor at 47 com.
4. TRANSISTOR KT972A or similar to current and structure.
5. LED can use any low-voltage.

Schematic diagram of an IR control receiver on one transistor:


We will proceed to the manufacture of the photodetector. His scheme was taken from one directory. First draw fee permanent marker. But you can do it even at the installation, but it is advisable to do on textolite. My fee looks like this:


Well, now, naturally, proceed to the soldering of the elements. We solder transistor:



We solder a resistor in 1 com (kilome) and a structured resistor.


And finally, we solder the last element is a 300 - 500 ohm resistor, I put 300 ohms. Posted from the back of the printed circuit board, because he did not allow me to prong it from the front side, because of his mutational paws \u003d)


All this is a matter to a toothbrush and alcohol, in order to wash off the remnants of rosin. If everything is collected without shells and the photodiode is good - earn immediately. Video operation of this design can be viewed below:

On the video, the distance is small, since it was necessary to watch simultaneously into the camera, and on the remote. Therefore, it was not possible to focus the directions of the console. If instead of the photodiode to put a photoresistor, then will respond to light, verified personally, sensitivity is even better than in the original photoresistor schemes. The scheme filed 12V, it works normally - the LED is bright, the brightness and sensitivity of the photoresistor is adjustable. Currently, according to this scheme, I select elements so that IC receiver from 220 volts can be used, and the output to the light is 220V. For the scheme provided, thanks for the scheme: thehunteronghosts. . Material provided:

System Du on IR rays on Chinese chips

Now in our country there was a lot of different Chinese electronics, both ready and different parts and components and other things. Various flying and driving toys on a radio control or on IR control are very popular. Most of them are based on a single microcircuit set: SM6135-SM6136, respectively, the coder and decoder of the control system. These chips can be mined from faulty toys or just buy in the store.

Here I want to show as with these chips you can organize five-fold remote controls on IR rays, for example, to manage a homemade audio center or may be a robot.

The figure shows the remote and decoder.

The remote is left, on SM6136. As you can see, it is very small and the details and the scheme can be performed very compact. S1-S5 buttons serve to feed commands. Commands are transmitted by a certain sequence of pulse packs. Putching pulses are swapped by a modulating frequency. This modulating frequency, as well as the equivalent frequency of the command pulse signal depends on the frequency of the clock generator, which is installed by the resistor R1, the frequency of the packs of packs are equal to half the frequency of the clock generator, which can be measured in the control output 13 d1.

The pulse modulated signal enters the key on the VT1 and through it to the HL1 IR LED. The current via HL1 is limited to the R3 resistor. HL1 LED - any IR LED from a TV remote control 3V.
HL2 - Team Transmission Indicator.

The receiving circuit is shown on the right, on the SM6135 chip. Parcels of the console takes an integrated photodetector FL1. This is a standard photodetector Du from the TV, under the modulating frequency of 38 kHz. On the transistor VT2 - inverter. And the commands appear in the form of logical units at the leads 7, 6, 10. 11, 12 d1. The clock frequency is set by the R4 resistor.

Setting
Start from the console. Measuring the output frequency 13 d1 Set its equal to the duddy frequency necessary for pairing with the photodetector. That is, if it is SFH506-38, that is, the frequency of 38 kHz, then 76 kHz should be at the output 13 d1.
Then, passing and taking commands to configure R4 so that the commands are accepted and the highest range.

The same kit SM6136 / 6135 is used in radio-controlled systems with models and toys. In this case, the command impulses are removed from the 8th output of the SM6136, on which they are not filled with modulating pulses, that is, a purely command code, without filling the pulses. This code is fed to the transmitter modulator.
The reception part is also different, as it is used in it amplifying cascades Microcircuits SM6135 (conclusions 1-3, 14-16). At these cascades, a signal amplifier circuit coming from the ultra-generrative detector is collected.

One of the possible radio control schemes is shown in the second drawing.

In household radio electronic equipment, integrated receivers of infrared radiation were widely used. In another other, they are also called IR modules.

They can be detected in any electronic device, manage which can be used using the remote control.

Here, for example, an IR receiver on the TV PCB.


Despite the seeming simplicity of this electronic component, this is a specialized integrated circuit designed to receive an infrared signal from remote control (DB). As a rule, an IR receiver has at least 3 conclusions. One output is common and connects to minus «-» food ( GND.), the other serves the advantage «+» output ( Vs.), and the third output of the received signal ( Out.).

Unlike an ordinary infrared photodiode, an IR receiver can receive and process an infrared signal, which is an IR-pulses of a fixed frequency and a certain duration - bundle of pulses. This technological solution eliminates random triggers, which may be caused by background radiation and interference from other devices emitting in the infrared range.

For example, strong interferences for the receiver of IR signals can create fluorescent lighting lamps with an electronic ballast. It is clear that it is not possible to use an IR receiver in return for an ordinary IR photodiode, because the IR module is a specialized microcircuit, sharpened under certain needs.

In order to understand the principle of operation of the IR module, we will describe in more detail in its device using the structural scheme.

The IR radiation receiver microcircuit includes:

    Pin photodiode.

    Adjustable amplifier

    Strip filter

    Amplitude detector

    Integrating filter

    Threshold


Pin photodiode. - This is a variety of photodiode, which has between areas n. and p. There is an area of \u200b\u200bits own semiconductor ( i-Oblast ). The area of \u200b\u200bits own semiconductor is essentially a layer from a pure semiconductor without impurities in it. It is this layer that gives a PIN-dode its special properties. By the way, PIN diodes (not photodiodes) are actively used in microwave electronics. Take a look at your mobile phoneIt also uses a PIN diode.

But let's return to the PIN photodide. In the usual state, the current through the PIN photodiode does not proceed, since it is included in the scheme reverse direction (In the so-called reverse displacement). Since under the action of external infrared radiation in i-regions There are electron-hole pairs, then the current begins to flow through the diode. This current is then converted into voltage and enters adjustable amplifier.

Next, the signal from the adjustable amplifier enters strip filter. It serves as protection against interference. The strip filter is configured to a certain frequency. So in IR receivers, strip filters configured to frequency 30 are mainly used; 33; 36; 36.7; 38; 40; 56 and 455 kilohertz. In order for the signal emitted by the remote control to be received by an IR receiver, it must be modulated by the same frequency on which the IR receiver strip filter is configured. So, for example, a modulated signal looks like a radiating infrared diode (see Figure).

But it looks like a signal at the outlet of the IR receiver.

It is worth noting that the selectivity of the band filter is small. Therefore, an IR module with a 30 kilohertz filter may well receive a signal with a frequency of 36.7 kilohertz and more. True, the distance of confident reception is noticeably declining.

After the signal passed through a strip filter, it enters amplitude detector and integrating filter. The integrating filter is required to suppress short single signal bursts that may be caused by interference. Next, the signal comes on thresholdand then on output transistor.

For sustainable operation of the receiver, the gain of the adjustable amplifier is monitored by the automatic gain control system ( ARU). Since the useful signal is a package of pulses of a certain duration, then due to the inertiality ARU, the signal has time to pass through the gain path and the rest of the circuit nodes.

In the case when the duration of the pulse package is excessive, the AGAR system is triggered, and the receiver ceases to receive a signal. Such a situation may occur when an IR receiver is littered with a fluorescent lamp with electronic ballastwhich works at frequencies of 30 - 50 kilohertz. In this case, the industrial infrared radiation of vapor mercury lamps can pass a protective strip filter of the photodetector and cause ARU's triggering. Naturally, the sensitivity of the IR receiver falls.

Therefore, you should not be surprised when the photodetector of the TV does not take commands from the remote control. Perhaps he just prevents the illumination of fluorescent lamps.

Automatic adjustment of the threshold ( Arp) Performs a similar function as ARU, controlling the threshold of the threshold device. An ARP exhibits the level of the threshold threshold in such a way as to reduce the number of false pulses at the module output. In the absence of a useful signal, the number of false pulses can reach 15 per minute.

The form of the IR module body contributes to the focusing of the received radiation on the sensitive surface of the photodiode. The material of the case passes radiation with a wavelength from 830 to 1100 nm. Thus, an optical filter is implemented in the device. To protect the elements of the receiver from the effects of external electric fields, an electrostatic screen is installed in the module. The photos are shown by IR brand modules HS0038A2. and TSOP2236.. For comparison, ordinary IR photodiodes are shown next to KDF-111V. and FD-265.

IR receivers

How to check the health of the IR receiver?

Since the IR signal receiver is a specialized chip, in order to reliably check its serviceability, the supply voltage is used on the chip. For example, the nominal supply voltage for the "high-voltage" IR modules of the TSOP22 series is 5 volts. Current consumption is Milliamper units (0.4 - 1.5 mA). When the power is connected to the module, it is worth considering the ceiling.

In a state where the signal is not given on the receiver, as well as in pauses between the pulse packs, the voltage at its outlet (without load) is almost equal to the power voltage. The output voltage between the total output (GND) and the output output can be measured using a digital multimeter. You can also measure the current consumed by the current module. If the consumption current exceeds typical, then most likely the module is faulty.

About how to check the health of the IR receiver using the power supply, the multimeter and the remote control do read.

As we can see, the receivers of the IR signals used in the remote control systems in the infrared channel have a sufficiently sophisticated device. These photodigtors often use fans of microcontroller techniques in their homemade devices.

Zaguka or "How the device began"

... when I came, Victoria sat on the sofa, staring at the TV. The day turned out to be heavy, so she did not want to do anything. For several minutes we watched some pop series, then he ended, and Vika turned off the TV. The room has become dark. It rained on the street, and it seemed that at home was also cold.
Vika rose from the sofa and began to touch, look for a switch from the lamp. The wall lamp hung, for some reason, not at the sofa, but on the other wall and had to stall across the room to light the light. When she finally turned it on, the room was filled with warm light bulb incandescent.
Near me, on the obstinate sheet, lay a remote from the TV. The lower buttons without identifying characters and, most likely, were not used. And here I had an interesting thought ...
- Vic, and you want, I will do that your lamp can be included with the bullet from the box? There's even an extra buttons ...

Concept
Our device should be able to receive a signal from the IR console, distinguish the "its" button from the other, and control the load. The first and last items are simple as an ax. But with the second a little more interesting. I decided not to be limited to some specific console (why? - "Not interesting so!"), But make a system that can work with different models remotes from different equipment. If only an IR receiver did not save, and confidently caught a signal.

We will catch a signal using a photodetector. Moreover, not every receiver will suit - carrier frequency must coincide with the frequency of the console. The carrier frequency of the receiver is indicated in its marking: Tsop17xx - 17 is a model of a receiver, and xx - frequency in kiloherts. And the carrier frequency of the console can be found in the documentation or in the internet. In principle, the signal will be accepted, even if frequencies do not coincide, but the sensitivity will be fig - you will have to poke the console directly into the receiver.

Each company producing household appliances, It is forced to comply with standards in the manufacture of "iron". And modulation frequencies at the consoles, also standard. But the developers are cut off on the program part - a variety of exchange protocols between the console and the device simply amazes. Therefore, I had to come up with a universal algorithm, which to do not care about the exchange protocol. It works like this:

In memory of the device stored control points. For each such point you need to record the time and state of exit from the IR receiver - 0 or 1.
When receiving a signal from the console, the MK will consistently check each point. If all points coincided - it was the same button on which the device was programmed. And if the output from the receiver at least at one point did not coincide with the template, the device does not respond.

However, no one canceled the bugs! It is possible that the signal will differ from the template, but
At check points, the values \u200b\u200bwill be the same. It turns out a false response. It would seem - a rare zaplast, and the pipets are difficult to fight him! But in fact, not everything is so bad (and even well in some places).

First, we have a digital signal, which means that the impulses go with constant delays (timings) and simply do not appear. Therefore, if the points are tight enough, you can not be afraid that some impulse will be missed.

Secondly, small noise (usually looks like rare short impulses) in most cases goes the forest - for if it does not fall directly at the checkpoint, then the system will not affect the system. So we have natural noise protection.

The second type of error (AKA "command pass") happens due to the fact that the point is too close to the front of the pulse (to the place where the signal at the output of the receiver changes its level).
Imagine that after a few microseconds after the control point, the signal must vary with High on Low. And now imagine that the console gave the team a little faster than usual (quite often happens). The front of the pulse moved over time, and now it happens until the control point! Exit from the receiver does not match the template and the system will reset.
To this not happen, you need to place control points away from the fronts.

"Everything is cool" - you will say - "But how can I take control points?" So I still tupil over it. As a result, I decided to entrust the placement of the points to you.
On the device there is jumper J1. If when it is turned on it is closed - the device will be stupidly transmitted through UART everything that the IR receiver is issued. On the other side of the Wire, this data takes my program that gives the pulse with TSOP to the computer screen. You only have the mouse to scatter the control points on this schedule, and flash them in EEPROM. If the ability to use the UART is not, Jumper J2 comes to the rescue. When it is closed - the device does not give data on the UART, and folds them in EEPROM.


Scheme
Easy to disgrace. As a controller, I took Attiny2313. Frequency 4 megahertz, from quartz, or inner RC chain.
On a separate connector, the RX and TX lines are displayed for communication and nutrition. There - the reset is displayed in order to be able to reflash the MK without removing from the device.
The output of the photodetector is connected to the int0, it will be pulled into the power to the resistor in 33k. If there are strong interference, you can put a smaller resistor there, for example, 10k.
D4 and D5 pines hang jumpers. Jumper1 on D5 and Jumper2 on D4.

Pin D6 is drawn by a power module. And Simistor, I took the smallest of those that I had - BT131. The current is 1a - not cool, but the case is not too big - TO92. For fine load the most. I made a tunner on MOC3023 - She has no zero intersection sensor, which means it is suitable for smooth load control (here I have not implemented it).

The port B is almost completely removed on the connector - you can hook an indicator or anything else. I use the same connector when the device is firmware. PIN B0 is busy LED.

It feeds the whole thing through the LM70L05 and the diode bridge. That is, you can serve aC voltageFor example, from the transformer. The main thing is that it does not exceed 25 volts, and then the stabilizer either will die or Conder.

The fee turned out this:


Yes, it is slightly different from the board that lies in the archive. But this does not mean that I made myself a Uber-advanced fee, but you slipped the demo version :). On the contrary, my fee has a couple of shortcomings that are not in the end version: I did not get a leg of the RESET on the pin, and the LED hangs on PB7. And this does not really contribute to intrahemal programming.

Firmware
The device can operate in two modes. In the first - when J2 is closed - it simply transmits pulses from the photodetector in the UART. From him and start:

The UART operates at a speed of 9600, i.e, at a frequency of 4 MHz to the UBRR register, write 25.

... We are waiting until the photodetecting leg is twig. As soon as it sank (originally it hangs on a Pull-Up resistor) we run the timer (Timer / Counter1, the one that is 16 bits) and pervise the interrupt Int0 to any login change - Any Logical Change (ICS00 \u003d 1). Timer ticks ... waiting.

The pulse from the console ran out - the output from the photodek shot up, the interrupt worked. Now write in memory the timer value and reset the timer. You still need to increment the record pointer to write in the next interrupt to another memory cell.

Another impulse ... The output is twitching ... Interrupt ... Record the value of the timer in memory ... Reset the timer ... Pointer + 2 (we write two bytes at a time) ...

And it will continue until it becomes clear that the end (RAM) is close. Or, until the signal is over. In any case, we will stop the timer and turn off the interrupts. Then, slowly throw out everything they have made, in the UART. Or, if J2 is closed - in EEPROM.

At the end, you can fasten to the infinite loop and wait for the reset - the mission is made.
And at the output will be a sequence of numbers. Each of them is the time between changes in the state of the TSOP output. Knowing why this sequence began (and we know! This is a drop from High on Low), we can restore the whole picture:

After initialization, we sit down and wait until Tsop rifles. As soon as it happened - we read the first point from EEPROM, and in a simple cycle, inspiring as much as it is written. At the same time, we consider packs of 32US. Coming out of the stupor, check - something there at the output of the receiver.

If the output did not coincide with what we expected is not our team. You can safely wait for the end of the signal and start everything first.

If the output matches our expectations - load the next point and check it. So as long as I do not go to the point, the time of which \u003d 0. This means that there are no more points. So the whole team coincided, and you can pull the load.

So, it turns out, a simple algorithm. But the fact is easier, the more reliable!

Softina
At first I thought to make the automatic memorization of the template. That is, you closure jumper, poke the console in Tsop, and the MK itself puts the control points and folds them in EEPROM. Then it became clear that the idea of \u200b\u200bdelusional: the more or less adequate algorithm will be too complex. Or will not be universal.

The second idea was a program for a computer in which you can separate the control points. Not too technologically, but it's better to trust this business MK.


We teach the device to respond to the desired button:

1) closer jumper J1.

2) We connect the UART. If there is no possibility to connect it, then jamper j2 jumper. Then the device will drop data in EEPROM.

3) We give meals.

4) If we decided to use the UART, we start the software and look at the status bar (below the window). There must be written "COM port is open." If not written, we are looking for a jamb in connecting and poke the "Connect".

5) Take the console and poke the right button in TSOP. As soon as the device honors that the signal went - the LED will turn around. Immediately after that, the device will start passing by UART (or write in EEPROM) data. When the transfer is over, the LED goes out.

6.1) If you work on the UART, then click the "Download by UART" button. And rejoice in the inscription "Uploaded the schedule ..." in the status bar.

6.2) If you work via EEPROM, I read the EEPROM memory programmer and save the * .bin file. (Exactly bin!). Then click the "Download.bin" button in the program and select the file with EEPROM.

7) We look at the loading schedule - this is the signal with Tsop'a. There is a slider on the side panel - they can be changed. Now poke the mouse in the schedule - we put the control points. Right-button point is removed. Just do not need to put them too close to the fronts. It turns out something like this:


8) Click "Save.bin" and save points. Then we flash this file in EEPROM. So as we stuff the time between two points of 7 bits, it is limited to 4ms. If the time between two points exceeds this value - the program will refuse to lock the points into the file.

9) Remove jumpers. Restart the device. Ready!

Video from testing