12.09.2023

What can you do with an IR receiver? A simple infrared control circuit. Control panel diagram


It’s more convenient to listen to music and watch movies on the computer if you are not on a chair in front of the monitor, but on the sofa, and you don’t need to get up to control it, you just need to press a button on the remote control. But where can I get the remote control with the receiver? You can buy it in a store, but the cost of such a kit is quite high. However, fortunately, making an IR receiver for any remote control (almost) is quite simple.

You will need:

  • IR receiver TSOP1738;
  • com port cable;
  • resistors 10 KOhm, 4.7 KOhm;
  • silicon diode (any);
  • capacitor 10 uF 16 V;
  • wires.

DIY IR receiver

The TSOP1738 photodiode at the output produces ready-made bits that are sent to the com port, so we do not need to solder complex circuits using controllers.

As you can see, nothing complicated. The receiver circuit is so simple that it can be assembled using a canopy. This assembly used a KD105G diode. As you can see in the photo, the anode is marked yellow paint. If you use a different diode, then you need to find out the polarity from reference books. You should also observe the polarity of the capacitor (the negative terminal is marked on the body).

Back side.

Solder the other end of the wire to the com port connector.

To reduce the size of the diagram, you can carefully bend it. Make sure that the leads and the parts themselves do not come into contact with each other, otherwise a short circuit will result.

You can fill it with epoxy resin or, as in this case, Glue Gun plastic. This will protect the device from external influences.

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 a loggia and was pleased with the stability of operation and the absence of false alarms. 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. As long as there is no violation of the perimeter, the modulated radiation of the IR LED of the transmitter freely passes to the receiver and signal no anxiety either. As soon as the invisible beam is crossed by an intruder, an alarm sounds.

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

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

The sensitivity of the Z timer trigger input depends on the value of resistor R3, which is the load of phototransistor VT3 - the higher the value, the higher the sensitivity of the receiver. The DA1 timer itself is connected according to the classic scheme of a missed pulse detector. While pulses from the photosensor pass to input 2 of the microcircuit, the timer is constantly restarted without completing the operating cycle. On his way out constantly high level. Transistor VT4 is open, SCR 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 completed normally and a low logical level will be set at pin 3 of the timer. Transistor VT4 will close, thyristor 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 working cycle of the timer, it is enough to miss several pulses from the transmitter - the alarm is triggered when a tennis ball flies between the transmitter and the receiver. To reduce sensitivity, it is enough to increase the value of resistor R6 or capacitor C3. After the passage of the IR beam is restored, the circuit will return to its original state with the exception of the SCR, which will remain open and will not remove the alarm signal until its supply circuit is briefly interrupted by switch SA1.

About the details. The transmitter can use transistors KT315A - B, KT375A-B, KT3102B-E (VT1). In place of VT2, KT3107A or KT361A - G will work. Capacitor C2 is an oxide type K50-20. The transmitter circuit practically does not require adjustment. In the receiver you can use transistors KT312B - V, KT315A - B or any other low-power n-p-n structures(VT4). Relay RES15 with passport RS4.591.004 or RES10 with passport RS4.524.302 is used as K1. SCR - KU101 or KU201 with any letter index. In the second case, you may have to select the value of 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 source with a voltage of 9 - 15 V is suitable as a power source for the system. Current consumption in security mode (receiver + transmitter) is 25 - 30 mA.

When you turn it on for the first time, due to a discharged capacitor C3, the timer will immediately work and an alarm will sound; to turn it off, just briefly turn off switch SA1.

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

An interesting and educational diagram for a novice radio designer on organizing sound transmission over a distance in the infrared (IR) range of light. An excellent starter kit for experimenting and constructing an optical telephone with your own hands. Do you want to establish a “closed” communication channel, for example, with your friend who lives in direct line of sight in a neighboring high-rise building? To start designing, this diagram is for you! Below is the process of assembling two base boards - an IR audio transmitter and an IR audio receiver. The sound receiver has a speaker output. Block diagrams, photos of block assembly and video demonstrations of functionality are presented. The price of purchasing a DIY Kit kit in an online store will not affect your budget in any way.

How to assemble an infrared receiver and sound transmitter with your own hands

Description:
The set implements the functions of amplitude modulation by electrical signals of the brightness of an infrared LED and the reception of modulated infrared radiation, its conversion into an electrical signal, and amplification of the signal to ensure the operation of the connected speaker. The signal transmission range in this version depends on the accuracy of pointing the diodes at each other and can reach several meters without the use of additional optics.

1. Electrical characteristics of the kit boards
Infrared transmitter
Operating voltage: 12V
PCB size: 19*25mm

Infrared receiver
Operating voltage: 4~12V
Connected speaker power: 0.5W-10W
PCB size: 17*39mm

2. Operating principle
IR transmitter: the audio signal through a 3.5 mm jack and electrolytic capacitor C3 is supplied to transistor Q1 of the S8050 type, the transistor modulates the electrical signal, which leads to modulation of the IR radiation emitted by LED D2.
IR receiver: IR LED receives radiation, converts it into an electrical signal, the signal through capacitor C1 goes to the input of the ULF assembled on the LM386 chip, the signal from the chip is sent to the speaker.





3. List of components

IR receiver

quantity
2 × 620 kOhm, 1K resistor R1 and R2 respectively
3 × 0.22 µF, 0.1 µF and 0.1 µF capacitors C1, C4 and C6, respectively
3 × 10 µF, 100 µF and 100 µF capacitors C2, C3 and C7, respectively
1 × Red LEDs D1
1 × IR receiving LED D2
1 ×
1 × speaker terminal block
1 × LM386 chip U1
1 × printed circuit board

IR transmitter

quantity Designation and marking of the part on the diagram
2 × 100 Ohm, 51K resistor R1 and R2 respectively
3 × 0.001 µF, 100 µF and 4.7 µF capacitors C1, C2 and C3, respectively
1 × S8050 transistor Q1
1 × Red LEDs D1
1 × IR transmitting LED D2
1 × power supply pin block
1 × 3.5mm audio input jack
1 × Printed circuit board

Assembly of IR receiver and IR transmitter

The design of the circuits is simple; any novice electronics engineer can handle the assembly. When assembling, you must be careful and careful.

  • it is necessary to check the contents of the packages and their compliance with the specification;

  • determine resistor values ​​using a tester or color code;
  • start installing the parts and soldering them onto the board, during assembly you must observe the polarity of the installation; the transistor and the chip block are installed using a key on the board, see photos and videos;





    Good luck with your assembly and long-distance communication in the IR range

Single-channel receiver module with relay, to be triggered by any standard infrared remote control, provides remote control any load via an invisible IR channel. The project is based on PIC12F683 microcontroller and TSOP1738 is used as the infrared receiver. The microcontroller decodes the RC5 serial design 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 printed circuit board: power indicator, transmission presence and relay activation. This circuit works with any RC5 remote control for a TV, center, etc.

Features of the circuit

  • Receiver power supply 7-12V DC
  • Receiver current consumption 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, making such equipment yourself is not at all easy. In addition, radio waves are subject to interference, and it’s easy to intercept them. Therefore, the IR signal will be preferable in some cases. Firmware, drawings printed circuit boards And Full description in English -

The beginning or “How the device began”

...When I arrived, Victoria was sitting on the sofa, staring at the TV. It had been a hard day, so she didn't want to do anything. We watched some pop series for a few minutes, then it ended and Vika turned off the TV. The room became dark. It was raining outside, and this made it seem like it was cold at home too.
Vika got up from the sofa and began, by touch, to look for the light switch. For some reason, the wall lamp hung not by the sofa, but on another wall, and I had to stomp across the room to turn on the light. When she finally turned it on, the room was filled with the warm glow of an incandescent bulb.
Next to me, on a rumpled sheet, lay the TV remote control. The bottom buttons are unmarked and most likely unused. And then I had an interesting thought...
- Vic, do you want me to make it so that you can turn on your lamp using the remote control from the box? There are even extra buttons...

Concept
Our device must be able to receive a signal from an IR remote control, distinguish “its” button from others, and control the load. The first and last points are as simple as an axe. But the second one is a little more interesting. I decided not to limit myself to any specific remote control (Why? - “That’s not interesting!”), but to make a system that can work with different models remote controls from different equipment. If only the IR receiver didn’t give up and confidently caught the signal.

We will catch the signal using a photodetector. Moreover, not every receiver is suitable - the carrier frequency must match the frequency of the remote control. The carrier frequency of the receiver is indicated in its marking: TSOP17xx - 17 is the receiver model, and xx is the frequency in kilohertz. And the carrier frequency of the remote control can be found in the documentation or on the internet. In principle, the signal will be received even if the frequencies do not match, but the sensitivity will be crap - you will have to poke the remote control directly at the receiver.

Every company that produces household appliances, is forced to comply with standards in the manufacture of hardware. And the modulation frequencies of the remote controls are also standard. But the developers have a blast on the software side - the variety of exchange protocols between the remote control and the device is simply amazing. Therefore, we had to come up with a universal algorithm that does not care about the exchange protocol. It works like this:

Control points are stored in the device memory. For each such point, you need to record the time and output status from the IR receiver - 0 or 1.
When receiving a signal from the remote control, the MK will sequentially check each point. If all the dots matched, then this was the very button for which the device was programmed. And if the output from the receiver does not match the template at least at one point, then the device will not react in any way.

However, no one canceled the bugs! It is possible that the signal will differ from the template, but
at control points the values ​​will be the same. This will result in a false positive. It would seem like a rare bastard, and it’s really hard to fight him! But in fact, not everything is so bad (and in some places it’s even good).

Firstly, we have a digital signal, which means that the pulses come with constant delays (timings) and simply do not appear. Therefore, if the points are dense enough, then you don’t have to be afraid that some impulse will be missed.

Secondly, small noise (usually looks like rare short pulses) in most cases goes through the forest - because if it does not hit the control point directly, then it will not affect the system at all. This means we have natural protection from noise.

The second type of errors (aka “Missing a command”) occurs due to the fact that the point is located too close to the edge of the pulse (to the place where the signal at the receiver output changes its level).
Imagine that a few microseconds after the checkpoint, the signal should change from HIGH to LOW. Now imagine that the remote control issued a command a little faster than usual (happens quite often). The pulse front has shifted in time, and now it occurs BEFORE the control point! The output from the receiver will not match the pattern and the system will reset.
To prevent this from happening, you need to place control points away from the fronts.

“Everything is cool,” you say, “But where can I get control points?” So I've been stuck on this for a long time. As a result, I decided to entrust the placement of points to you.
The device has jumper J1. If it is closed when turned on, the device will stupidly transmit via UART everything that the IR receiver outputs. On the other side of the wire, this data is received by my program, which displays pulses from the TSOP on the computer screen. All you have to do is use your mouse to scatter control points along this graph and flash them into the EEPROM. If it is not possible to use UART, then jumper J2 comes to the rescue. When it is closed, the device does not output data via UART, but stores it in EEPROM.


Scheme
Simple as hell. I took ATTiny2313 as the controller. Frequency 4 megahertz, from quartz, or internal RC chain.
The RX and TX lines for communication and power supply are provided on a separate connector. There, RESET is displayed so that you can reflash the MK without removing it from the device.
The output of the photodetector is connected to INT0, it is connected to the power supply through a 33k resistor. If there is strong interference, then you can put a smaller resistor there, for example, 10k.
There are jumpers on pins D4 and D5. Jumper1 on D5 and Jumper2 on D4.

The power module is connected to pin D6. Moreover, I took the smallest triac that I had - BT131. Its current is 1A - not cool, but the body is not too large - TO92. For small loads that's it. I made the optocoupler on the MOC3023 - it does not have a zero-crossing sensor, which means it is suitable for smooth load control (I never implemented this here).

Port B is almost completely connected to the connector - you can attach an indicator or something else there. I use this same connector when flashing the firmware of the device. Pin B0 is occupied by the LED.

The whole thing is powered through LM70L05 and a diode bridge. That is, an alternating voltage can be supplied to the input, for example, from a transformer. The main thing is that it does not exceed 25 Volts, otherwise either the stabilizer or the condenser will die.

The payment turned out like this:


Yes, it is slightly different from the board that is in the archive. But this does not mean that I made myself an uber-advanced board and handed you a demo version :). On the contrary, my board has a couple of shortcomings that are not present in the final version: I do not have the RESET pin connected to the pin, and the LED hangs on PB7. And this is not very conducive to in-circuit programming.

Firmware
The device can operate in two modes. In the first - when J2 is closed - it simply transmits pulses from the photodetector to the UART. Let's start with it:

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

...we wait until the leg of the photodetector twitches. As soon as it drops (initially it hangs on the pull-up resistor), we start the timer (TIMER/COUNTER1, the one with 16 bits) and turn on the INT0 interrupt for any input change - any logical change (ICS00 = 1). The timer is ticking...we are waiting.

The pulse from the remote control ended - the output from the photodetector shot up, the interruption worked. Now we write the timer value into memory and reset the timer. You also need to increment the write pointer in order to write to another memory cell at the next interrupt.

Another pulse... the output twitches... interrupt... writing the timer value to memory... resetting the timer... pointer + 2 (we write two bytes at a time)...

And this will continue until it becomes clear that the end (of the RAM) is near. Or until the signal ends. In any case, we freeze the timer and disable interrupts. Then, we slowly throw everything we have collected into the UART. Or, if J2 is closed - to EEPROM.

In the end, you can go into an endless loop and wait for a reset - the mission is completed.
And the output will be a sequence of numbers. Each of them is the time between changes in the state of the TSOP output. Knowing where this sequence began (And we know! This is the transition from HIGH to LOW), we can restore the whole picture:

After initialization, we sit and wait for TSOP to move. As soon as this happens, we read the first point from the EEPROM, and in a simple loop we depress as much as is written there. In this case, we count the time in packs of 32us. Coming out of the stupor, we check to see what is there at the receiver output.

If the output did not coincide with what we expected, it is not our team. You can calmly wait for the end of the signal and start all over again.

If the output matches our expectations, we load the next point and check it. So until we come across a point whose time = 0. This means that there are no more points. This means the whole team has coincided, and you can pull the load.

So, it turns out, a simple algorithm. But the simpler, the more reliable!

Softina
At first I thought about making the template automatically memorized. That is, you close the jumper, poke the remote control into TSOP, and the MK itself places control points and puts them in the EEPROM. Then it became clear that the idea was crazy: a more or less adequate algorithm would turn out to be too complex. Or it won't be universal.

The second idea was a program for the computer in which you can set control points yourself. Not very technologically advanced, but anything is better than entrusting this matter to MK.


We train the device to respond to the desired button on the remote control:

1) Close jumper J1.

2) Connect UART. If there is no way to connect it, then close jumper J2. Then the device will dump data into EEPROM.

3) Turn on the power.

4) If we decide to use UART, then launch the software and look at the status bar (at the bottom of the window). It should say “COM port open”. If it is not written, then we look for a jamb in the connection and press the “Connect” button.

5) Take the remote control and press the desired button in TSOP. As soon as the device senses that the signal has arrived, the LED will light up. Immediately after this, the device will begin transmitting data via UART (or writing to EEPROM). When the transmission is completed, the LED goes out.

6.1) If we are working via UART, then click the “Load via UART” button. And we are happy with the inscription “Loaded the chart...” in the status bar.

6.2) If we work through EEPROM, then we read the EEPROM memory with the programmer and save it to a *.bin file. (Exactly bin!). Then click the “Load.bin” button in the program and select the file with the EEPROM.

7) We look at the loaded chart - this is a signal from TSOP. There is a slider on the sidebar - you can use it to change the scale. Now we point the mouse at the schedule and set control points. The right button deletes the points. Just don't put them too close to the fronts. It turns out something like this:


8) Click “Save.bin” and save the points. Then we flash this file into the EEPROM. Since we cram the time between two points into 7 bits, it is limited to 4ms. If the time between two points exceeds this value, the program will refuse to push the points into the file.

9) Remove the jumpers. Reboot the device. Ready!

Test video