What is an IR receiver? We install an additional IR receiver in the satellite receiver. IR receiver connection diagram

diagram from the magazine "Young Technician".

An interesting direction in radio electronics, which has supplemented this electronics with new advantages of “invisible” light (infrared light). So I propose a circuit of a simple (for example) receiver and transmitter based on infrared rays. The basis: operational amplifier k140ud7 (I have ud708 here), emitting and receiving IR photodiodes, ULF (k548un1a (b,c - indices) - for two channels) (although where to “turn on” the second channel of the amplifier is up to you - the transmitter circuit is designed for one channel, t .e. mono). Power supply for the device: I generally recommend it with decent current stabilization (otherwise the “dandy” adapter irritates the background of the “network”). Method: the amplitude-modulated signal of the transmitter is amplified by the receiver 1000 times.

How the device works. I suggest you watch a short video testing the IR remote control “by ear”. You can quickly check the functionality and signal strength by sound.

IR receiver and IR transmitter circuit

When assembling, capacitors C1 and C2 should be as close to the amplifier as possible! You can connect high-impedance headphones to the output (low-impedance ones require a separate ULF). Photodiode FD7 (I have FD263: “tablet” with a focusing lens); 0.125W resistors: R1 and R4 set the signal amplification factor by 1000 times. The receiver is set up simply: the photodiode is directed to a source of IR radiation, for example, a 220V-50Hz lamp: the filament will be fonit with a frequency of 50Hz or the remote control from the TV (video, etc.). The sensitivity of the receiver is high: it normally receives signals reflected from the walls .

The transmitter has AL107a IR LEDs: any will do. R2 2 kOhm, C1 1000μFx25V, C2 200μFx25V, any transformer too. Although it is quite possible to do without a transformer - supply an amplified audio signal to capacitor C2.

Device diagram

IR receiver circuit with ULF

Recently, out of necessity, I assembled an IR receiver for testing IR remote controls (TVs and DVDs). After finalizing the circuit, I installed a mono ULF TDA7056. This amplifier has good gain characteristics of about 42 dB; operates in a voltage range from 3V to 18V, which allowed the IR receiver to operate even at a voltage of 3V; TDA gain range from 20 Hz to 20 kHz (UD708 passes up to 800 kHz) is quite enough to use the receiver as audio accompaniment; has short circuit protection on all “legs”; protection against "overheating"; weak self-interference coefficient. Overall, I liked this compact and reliable ULF (our price is 90 rubles).
There is to him with detailed description. Figure 1 shows an example of using an amplifier.


Photo TDA7056


Fig.1. Amplifier circuit with TDA7056

The result is an IR receiver, Fig. 2, which operates in the voltage range from 3V to 12V. I recommend using batteries or rechargeable batteries to power the receiver. When using a power supply, a stabilized source is required, otherwise the background of the 50Hz network will be heard, which amplifies the UD708. If the device is located near a source of mains voltage or radio emissions, interference may occur. To reduce interference, it is necessary to include capacitor C5 in the circuit. The TDA7056 is designed for a 16 Ohm output speaker, unfortunately I don’t have one. I had to use a 4 ohm 3 watt speaker, which was connected through a one watt 50 ohm resistor. Too low speaker coil resistance causes excess power and overheats the amplifier. In general, due to the additional resistor, the ULF does not heat up, but provides quite acceptable amplification.

Receiver of IR remote control commands remote control For driving household appliances can be easily done using a CD4017 decimal counter, NE555 timer and TSOP1738 infrared receiver.

Using this IR receiver circuit, you can easily control your household appliances using the TV remote control, DVD player, or using the remote control circuit described at the end of the article.

IR receiver circuit for remote control

Pins 1 and 2 of the TSOP1738 IR receiver are used to power it. Resistor R1 and capacitor C1 are designed for stable operation and suppression of various noise in the power supply circuit.

When IR rays at a frequency of 38 kHz fall on the TSOP1738 IR receiver, a low voltage level appears at its output 3, and when the IR rays disappear, a high level appears again. This negative pulse is amplified by transistor Q1, which passes the amplified frequency signal to the input of the decimal counter CD4017. Counter pins 16 and 8 are intended to power it. Pin 13 is connected to ground, thereby enabling its operation.

The output of Q2 (pin 4) is connected to the reset pin (pin 15) to make the CD4017 operate in bistable multivibrator mode. During the first pulse, log1 appears on Q0, the second clock signal causes log1 to appear on Q1 (Q0 goes low), and on the third signal it outputs log1 on Q0 again (Q2 is connected to MR, so the third clock signal resets the counter).

Let's assume the counter has reset (Q0 is high and the rest are low). When you press the remote control button, the clock signal affects the counter, which leads to a high level on Q1. Thus, LED D1 lights up, transistor Q2 turns on and the relay is activated.

When the remote control button is pressed again, log 1 appears at pin Q0, the relay turns off and LED D2 lights up. LED D1 indicates when the device is on and LED D2 indicates when the device is off.

You can use your TV remote control for control or assemble a separate one according to the diagram below.

  • Input voltage: 2.7 ... 5.5 V
  • Current consumption: 0.65 ... 1.05 mA (at Vcc = 5V) nominally 0.9 mA
  • Carrier frequency: 38 kHz
  • Light wavelength: 850 ... 1050 nm (passed by the filter more than 80%)
  • Sensitivity: 0.17… 30000 mW/m2 (to luminous flux power)
  • Reception distance: up to 45 m
  • Working temperature: -25 … 85 °C
  • Directional angle: ±45°

All modules of the "Trema" line are made in the same format

Connection:

The module connects to any digital pin of arduino. The kit includes a cable for quick and easy connection to Trema Shield.

It is convenient to connect the module in 3 ways, depending on the situation:

Method - 1: Using a wired cable and Piranha UNO


The library uses a second hardware timer,

DO NOT OUTPUT PWM SIGNALS TO 3 OR 11 OUTPUT!

Read more about installing the library in our...

Additional information on working with the module:

Packages: Almost all remote controls send not only an information packet (indicating the type of device and the code of the button pressed), but also repeat packets, informing the device that the button is being held down. Thus, the receiving device can respond to pressing the button once or for the entire time it is held.

For example: by pressing and holding the button with the TV channel number, the TV will switch to this channel just one time. While pressing and holding the volume up button, the TV will increase it for the entire time the button is held.

Number of information packages Most remote controls have one, but some devices, such as air conditioners, use 2, 3 or more information packets.

Package contents: The information package contains information about the manufacturer's code, device type, code of the button pressed, etc. Repeat packets can partially or completely coincide with an information packet, copy its bits with inversion, or not carry any information, representing a sequence of several identical bits for each repeat packet.

Duration of pauses between packets: usually does not exceed 200ms.

Data transfer protocols: determine the following basic parameters:

  • carrier frequency;
  • method of encoding information, duration of pulses and pauses of transmitted bits;
  • number of information packages:
  • composition of the information package and repetition packages;
  • duration of pauses between packets;
  • presence and form of Start, Stop and Toggle signals;

Carrier frequency: for most remote controls it is 38 kHz; it is this frequency that the Trema IR receiver is tuned to.

Information coding: This is the principle of transmitting data bits. Let us highlight three main types of encoding, in which each bit is transmitted in a sequence of one pulse and one pause:

  • pulse length encoding - first a pulse is transmitted, the length of which depends on the value of the transmitted bit, then follows a pause, the length of which does not depend on the value of the bit. For example: in the SIRC protocol (Sony), the pulse length for bit “1” = 1200 µs, and for bit “0” = 600 µs, the length of pauses is always 600 µs. In this way, you can distinguish “1” from “0” by the pulse length.
  • coding of long pauses - first a pulse is transmitted, the length of which does not depend on the value of the transmitted bit, then follows a pause, the length of which depends on the value of the bit. For example: in the NEC protocol, the pause length for bit “1” = 1687.5 µs, and for bit “0” = 562.5 µs, the pulse length is always 562.5 µs. Thus, you can distinguish “1” from “0” by the length of the pause.
  • biphase coding - the length of the pulse is equal to the length of the pause, and their sequence determines the type of transmitted bit. For example: in the RS5 protocol (Philips), for bit "1" a pulse follows a pause, and for bit "0" a pause follows a pulse. For the NRC protocol (Nokia), on the contrary, for bit “1” a pause follows a pulse, and for bit “0” a pulse follows a pause.

Start, Stop and Toggle signals: according to their name, they are located at the beginning, end or middle of the package.

Stop: When encoding a long pause, it is impossible to determine the value of the last bit in the packet, since the packet is followed by a long pause, and the last bit will always be defined as “1”, so the Stop signal is added to the packet, which is a pulse that does not carry any information.

Start: With biphase coding, a Start signal is required, since it is impossible to start transmitting a packet from a pause.

Toggle: This is a bit that changes its value with each new button press, used in the RS5, RS5X, RS6 (Philips) protocols, where repeat packets completely repeat the data of the information packet. This way, the receiving device can differentiate between holding the button and pressing it again.

Examples:

Checking the availability of data received from the IR remote control is carried out by the check() function. This function responds to pressing the buttons on the IR remote control, but if called with the true parameter, it will also respond to holding the buttons.

Reading data from any remote control, we respond only to button presses:

#include // Connect the library to work with the IR receiver iarduino_IR_RX IR(7); // Declare an IR object, indicating the pin to which the IR receiver is connected void setup())( Serial.begin(9600); // Initiate data transfer to the serial port monitor, at a speed of 9600 bps IR.begin(); / / Initiate work with the IR receiver) void loop())( if(IR.check())( // If the buffer contains data received from the remote control (the button was pressed) Serial.println(IR.data, HEX); / / Output the code of the pressed button Serial.println(IR.length); // Output the number of bits in the code ) )

In this sketch, the check() function is called without arguments, which means it only responds to button presses on the IR remote control.

Reading data from any remote control, we respond to pressing the buttons:

#include // Connect the library to work with the IR receiver iarduino_IR_RX IR(6); // Declare an IR object, indicating the pin to which the IR receiver is connected void setup())( Serial.begin(9600); // Initiate data transfer to the serial port monitor, at a speed of 9600 bps IR.begin(); / / Initiate work with the IR receiver) void loop())( if(IR.check(true))( // If the buffer contains data received from the remote control (the button is held down) Serial.println(IR.data, HEX); / / Output the code of the pressed button Serial.println(IR.length); // Output the number of bits in the code ) )

In this sketch, the check() function is called with the true parameter, which means it reacts both to pressing and holding the IR remote control buttons.

Reading data from any remote control, indicating how to respond to which buttons.

#include // Connect the library to work with the IR receiver iarduino_IR_RX IR(6); // Declare an IR object, indicating the pin to which the IR receiver is connected // bool flgKey1 = false; uint32_t codKey1 = 0xFF30CF; // Define the click flag and the code of button 1 bool flgKey2 = false; uint32_t codKey2 = 0xFF18E7; // Define the click flag and button code 2 bool flgKey3 = false; uint32_t codKey3 = 0xFF7A85; // Define the click flag and button code 3 bool flgKey = false; uint32_t tmrKey = 0; // Define a flag that allows data to be output to the monitor and the time of the last button press.

// void setup())( // Serial.begin(9600); // Initiate data transfer to the serial port monitor, at a speed of 9600 bps IR.begin(); // Initiate work with the IR receiver) // / / void loop())( // if(IR.check(true))( // If the buffer contains data received from the remote control (the button is held), then... if(millis()-200 > tmrKey)( / / If more than 200 ms have passed since the last received command, then flgKey1=false; // Consider that button 1 is not held flgKey2=false; // Consider that button 2 is not held flgKey3=false; // Consider that button 3 is not held) tmrKey = millis(); flgKey=true; // Save the time of the last response to the remote control and allow data output if(IR.data==codKey1)( if(flgKey1)(flgKey=false;) flgKey1=true; )else(flgKey1= false;) // We prohibit the output of button 1 data when it is held down if(IR.data==codKey2)( if(flgKey2)(flgKey=false;) flgKey2=true; )else(flgKey2=false;) // We prohibit the output of data button 2 while holding it if(IR.data==codKey3)( if(flgKey3)(flgKey=false;) flgKey3=true; )else(flgKey3=false;) // Prohibit the output of button 3 data when it is held down if(flgKey)( // If data output is allowed, then... Serial.println(IR.data, HEX); // Output the code of the pressed button buttons Serial.println(IR.length); // Print the number of bits in the code ) // ) // ) //

In this sketch, the check() function is called with the true parameter, which means it responds to both pressing and holding the IR remote control buttons. But data is output to the serial port monitor only when the flgKey flag is set, which is reset when the buttons with codes 0xFF30CF, 0xFF18E7 and 0xFF7A85 are held down. It turns out that the sketch reacts to 3 buttons only when pressed, and to the remaining buttons both when pressed and held.

#include // Connect the library to work with the IR receiver iarduino_IR_RX IR(5); // Declare an IR object, indicating the pin to which the IR receiver is connected void setup())( Serial.begin(9600); // Initiate data transfer to the serial port monitor, at a speed of 9600 bps IR.begin(); / / Initiate work with the IR receiver IR.protocol("Ae`` `|LJ` @@@@BPBp"); // Specify the data transfer protocol to respond to) void loop())( if(IR.check( true))( // If the buffer contains data received from the remote control (the button is held down) Serial.println(IR.data, HEX); // Output the code of the pressed button Serial.println(IR.length); // Output the number of bits in the code) )

In this sketch, in the setup() code, the data transfer protocol is indicated, which rarely coincides between different manufacturers of IR remote controls. This means that the check() function in the loop() code will only respond to those IR remote controls that support the specified protocol.

Getting the data transfer protocol and encoding type:

#include // Connect the library to work with the IR receiver iarduino_IR_RX IR(4); // Declare an IR object, indicating the pin to which the IR receiver is connected void setup())( Serial.begin(9600); // Initiate data transfer to the serial port monitor, at a speed of 9600 bps IR.begin(); / / Initiate work with the IR receiver) void loop())( if(IR.check())( // If the buffer contains data received from the remote control (the button was pressed) Serial.println(IR.protocol()); / / Output the data transfer protocol string ) )

This example describes how to obtain the data transfer protocol for IR remote controls. The article describes how to transmit button codes using the specified protocol.

In this way, you can create an IR transmitter sketch to simulate the signals of various IR remote controls. As a result, devices will respond to the IR transmitter as if they were responding to their own IR remote control.

Description of the main functions of the library:

Connecting the library:

#include // Connect the library to work with the IR receiver. iarduino_IR_RX IR(PIN_NO[, INVERT]); // Declare an IR object, indicating the pin number to which the IR receiver is connected.

// The second parameter, of type bool, can indicate that the data from the receiver is inverted.

  • Function begin();
  • Purpose: initialization of work with the IR receiver
  • Syntax: begin();
  • Options: None.
  • Return values: None.
  • Note: Called once in setup code.
Example:

IR.begin(); // Initiate work with the IR receiver

  • Function check();
  • Purpose: Checking the availability of data received from the remote control.
  • Syntax: check([ HOLD ]);
    • HOLD - an optional parameter, type bool - indicating that it is necessary to respond to holding the remote control buttons.
  • Return values: bool - whether the data from the remote control was accepted or not.
  • Note: If the function is called without a parameter, or it is false, then the function will only respond to signals from the remote control when its buttons are pressed, and if you specify true, the function will respond to both pressing and holding the remote control buttons.
  • Note: Called once in setup code.
if(IR.check())( ... ;) // If data is received from the remote control, when you press its button if(IR.check(true))( ... ;) // If data is received from the remote control, when holding the button

Function protocol();

  • Purpose: Receiving, setting or resetting the data transfer protocol.
  • Syntax: protocol([ PARAMETER ]);
  • Getting the protocol: If the function is called without a parameter, it will return a string of 25 characters + the end of line character. The bits of this line carry information about the type of data transfer protocol of the remote control whose data was last received. This line can be used to set the protocol for the IR transmitter or IR receiver (see below).
  • Setting the protocol: If the function is called with a parameter in the form of a string of 25 protocol characters + the end of line character, then after this, the chek() function will respond only to remote controls that comply with the specified data transfer protocol.
  • Protocol reset: If the function is called with the IR_CLEAN parameter, then the chek() function will again respond to signals from any remote control.
  • Receiving protocol parameters: If the function is called with an int parameter, from 0 to 17, then it will return not a protocol string, but an int value with one of the parameters of the data transfer protocol of the console whose data was last received:
    • 0 - encoding type:
      • IR_UNDEFINED - encoding type is undefined;
      • IR_PAUSE_LENGTH - long pause coding;
      • IR_PULSE_LENGTH - encoding by long (width) pulse (PWM);
      • IR_BIPHASIC - biphasic coding;
      • IR_BIPHASIC_INV - biphasic encoding with inverted bits;
      • IR_NRC - repeat packets are identical, but the first and last packets are special;
      • IR_RS5 - PHILIPS encoding with toggle bit;
      • IR_RS5X - PHILIPS encoding with toggle bit;
      • IR_RS6 - PHILIPS encoding with toggle bit.
    • 1 - carrier frequency of data transmission (in kHz);
    • 2 - declared number of information bits in 1 packet;
    • 3 - declared number of information bits in the repeat packet;
    • 4 - pause duration between packets (in ms);
    • 5 - pulse duration in the start bit (in μs);
    • 6 - pause duration in the start bit (in μs);
    • 7 - pulse duration in stop bit (in μs);
    • 8 - pause duration in the stop bit (in μs);
    • 9 - pulse duration in the restart or toggle bit (in μs);
    • 10 - pause duration in the restart or toggle bit (in μs);
    • 11 - position of the restart or toggle bit in the packet (bit no.);
    • 12 - maximum pulse duration in information bits (in μs);
    • 13 - minimum pulse duration in information bits (in μs);
    • 14 - maximum pause duration in information bits (in μs);
    • 15 - minimum pause duration in information bits (in μs);
    • 16 - start bit presence flag (true/false);
    • 17 - stop bit presence flag (true/false);
    • 18 - flag for the presence of the restart or toggle bit (true/false);
    • 19 - repeat packet type (0-none, 1-with inverted bits, 2-identical to informational, 3-unique);
  • Return values: Depends on the presence and type of the parameter.
  • Note: If a protocol was previously set, then attempting to retrieve the protocol, or protocol parameters, will return the values ​​of the previously set protocol, and not the data transfer protocol of the console whose data was last received.
  • Note: Called once in setup code.
IR.protocol("AeQQV~zK]Kp^KJp[@@@@@@@Bp"); // Set the protocol. Now the receiver will receive data only from ELENBERG TV remote controls.

IR.protocol(IR_CLEAN); // Reset the previously installed protocol. Now the receiver will again respond to any remote control. if(IR.check())( Serial.println(IR.protocol()); ) // Get the protocol. As soon as the receiver receives the data, a string of 25 protocol characters will be displayed on the monitor. if(IR.check())( Serial.println(IR.protokol(12)); ) // Get one of the protocol parameters. As soon as the receiver receives the data, the monitor will display the maximum pulse duration of the information bit in microseconds.

  • Data variable
  • Value: Returns the button code received from the remote control;
Data type: uint32_t.

if(IR.check())( Serial.println(IR.data); ) // Print the code of the pressed button, if accepted

  • length variable
  • Value: Returns the size of the button code, in bits;
Data type: uint8_t.

if(IR.check())( Serial.println(IR.length); ) // Print the size of the pressed button code, if accepted

  • key_press variable
  • Value: Returns a flag indicating that the remote control button is being pressed rather than held;
Data type: bool.

if(IR.check(true))( if(IR.key_press)(Serial.println("PRESS");) // The text will be printed 1 time when the button is pressed else (Serial.println("HOLD ");) // The text will be displayed continuously while the button is held down)

  • control of robots, moving, flying and floating models, household and specialized equipment.
  • turning on/off lighting, heating, ventilation, watering, etc.
  • opening/closing doors, blinds, roof windows, vents, etc.

The IR receiver is a standard device that connects to the COM (RS-232) port and serves to remotely control the robot.

One of possible schemes IR receiver. Any 5-volt infrared receiver used in household equipment (TVs) will be suitable for the IR receiver. For example: TSOP1836, IS1U60L, GP1U52X, SFH506-36 or our domestic TK1833. The KREN5A voltage stabilizer is necessary to power the IR receiver with 5 V voltage, because 12 volts are supplied from the 7th pin of the COM port. The resistor can be selected from the range of 3-5 kOhm, capacitor 4.7-10 μF. Any low-power diode.

In the above circuit, the output signal is supplied to 1 contact COM port(DCD). This contact is not used by a standard mouse for a COM port, so if you do not have enough free COM port, this circuit can be used in parallel with a mouse (but not with a modem)! The output signal can be sent not only to the DCD, but also to other pins, such as CTS or DSR. All these parameters can be set in a program that works in the IR receiver. There are several program options, the most common is WinLIRC. I can also recommend using the Girder program.

Pinout and appearance of the main elements of the circuit

From left to right - two types of 5-volt IR receivers, and a KREN5A voltage stabilizer chip.

COM port pinout

Pinout and description of COM port contacts (25 pin).

The IR receiver plays an important role in our everyday life. With the help of this microcircuit, we have the opportunity to control modern household appliances, a TV, a stereo system, a car radio, and an air conditioner. This allows us to do this, the remote control (RC), let's take a closer look at its operation, circuit, purpose and testing. In the article, how to check the IR receiver yourself.

What is an IR receiver and how does it work?

This is an integrated circuit, its direct and main task is to receive and process the infrared signal, which is what the remote control emits. This signal is used to control the equipment.

This microcircuit is based on a pin photodiode, a special element, with a p-n junction and an i region between them, an analogue of the base of a transistor, as in a sandwich, so here is the abbreviation pin, a unique element in its own way.

It is turned on in reverse and does not pass electricity. The IR signal enters the i region, and it conducts current, converting it into voltage.


The next stages are an integrating filter, an amplitude detector, and at the finish line, output transistors await them.

As a rule, there is no particular point in buying a new IR receiver in a store, since it can be easily unsoldered from various electronic boards. If you are assembling a device for checking the remote control from scrap materials, without knowing the exact marking of the device, then you can determine the pinout yourself.


We will need a multimeter, a power supply or several batteries, connecting wires, installation can be done hanging.

It has three outputs, one is GND, plus 5 volts is supplied to the second, and the out signal comes out from the third. We connect the power to the first and second legs, respectively, and remove the voltage from the third.


It is in a state of waiting for a signal from the remote control, and on the multimeter we see five volts. We begin to switch channels or press other buttons by pointing the remote control at him.

If it is working, then the voltage will drop by about 0.5-1 volt. If everything happens as written here, the device is working, otherwise the element is faulty.

How to determine the pinout of an infrared receiver

For example, I took a microcircuit completely unknown to me, which was lying in a box with elements, the “minus” was determined by the point that is on the back of the element, the “plus” was experimentally determined through a resistor. I didn’t risk anything, since he was initially a worker, there was no hope.

To determine the pinout of the IR receiver, if it is soldered into the board, look at it, there may be pin markings. If nothing is written there, inspect the element itself, look for its name, and then look on the Internet for characteristics and data, this is a very competent way of doing things. Following the instructions, how to check the IR receiver yourself.

diagram from the magazine "Young Technician".

An interesting direction in radio electronics, which has supplemented this electronics with new advantages of “invisible” light (infrared light). So I propose a circuit of a simple (for example) receiver and transmitter based on infrared rays. Basis: operational amplifier k140ud7 (I have ud708 here), emitting and receiving IR photodiodes, ULF (k548un1a (b,c - indices) - for two channels) (although where to “turn on” the second channel of the amplifier is up to you to decide - the transmitter circuit is designed for one channel, i.e. mono). Power supply for the device: I generally recommend it with decent current stabilization (otherwise the “dandy” adapter irritates the background of the “network”). Method: the amplitude-modulated signal of the transmitter is amplified by the receiver 1000 times.

How the device works. I suggest you watch a short video testing the IR remote control “by ear”. You can quickly check the functionality and signal strength by sound.

IR receiver and IR transmitter circuit

When assembling, capacitors C1 and C2 should be as close to the amplifier as possible! You can connect high-impedance headphones to the output (low-impedance ones require a separate ULF). Photodiode FD7 (I have FD5.. some kind of “tablet” with a focusing lens - I don’t remember the exact name); 0.125W resistors: R1 and R4 set the signal amplification factor by 1000 times. The receiver is set up simply: the photodiode is directed to a source of IR radiation, for example, a 220V-50Hz lamp: the filament will be fonit with a frequency of 50Hz or the remote control from the TV (video, etc.). The sensitivity of the receiver is high: it normally receives signals reflected from the walls .

The transmitter has AL107a IR LEDs: any will do. R2 2 kOhm, C1 1000μFx25V, C2 200μFx25V, any transformer too. Although it is quite possible to do without a transformer - supply an amplified audio signal to capacitor C2.

Device diagram

Recently, out of necessity, I assembled an IR receiver for testing IR remote controls (TVs and DVDs). After finalizing the circuit, I installed a mono ULF TDA7056. This amplifier has good gain characteristics of about 42 dB; operates in a voltage range from 3V to 18V, which allowed the IR receiver to operate even at a voltage of 3V; TDA gain range from 20 Hz to 20 kHz (UD708 passes up to 800 kHz) is quite enough to use the receiver as audio accompaniment; has short circuit protection on all “legs”; protection against "overheating"; weak self-interference coefficient. Overall, I liked this compact and reliable ULF (our price is 90 rubles).
There is to him with. Figure 1 shows an example of using an amplifier.


Photo TDA7056



Fig.1. Amplifier circuit with TDA7056

The result is an IR receiver, Fig. 2, which operates in the voltage range from 3V to 12V. I recommend using batteries or rechargeable batteries to power the receiver. When using a power supply, a stabilized source is required, otherwise the background of the 50Hz network will be heard, which amplifies the UD708. If the device is located near a source of mains voltage or radio emissions, interference may occur. To reduce interference, it is necessary to include capacitor C5 in the circuit. The TDA7056 is designed for a 16 Ohm output speaker, unfortunately I don’t have one. I had to use a 4 ohm 3 watt speaker, which was connected through a one watt 50 ohm resistor. Too low speaker coil resistance causes excess power and overheats the amplifier. In general, due to the additional resistor, the ULF does not heat up, but provides quite acceptable amplification.



Fig.2. IR receiver circuit with ULF



Photo of IR receiver

In this lesson we will look at connecting an IR receiver to Arduino. We will tell you which library should be used for an IR receiver, demonstrate a sketch for testing the operation of an infrared receiver from a remote control, and analyze commands in C++ to receive a control signal.

IR receiver device. Principle of operation

Infrared radiation receivers received wide application in electronic technology, due to its affordable price, simplicity and ease of use. These devices allow you to control devices using a remote control and can be found in almost any type of equipment.

The operating principle of an IR receiver. Processing the signal from the remote control

The IR receiver on Arduino is capable of receiving and processing an infrared signal in the form of pulses of a given duration and frequency. Typically, an IR receiver has three legs and consists of the following elements: a PIN photodiode, an amplifier, a bandpass filter, an amplitude detector, an integrating filter, and an output transistor.

Under the influence of infrared radiation in a photodiode, which has between p And n regions created an additional region of semiconductor ( i-region), current begins to flow. The signal goes to an amplifier and then to a bandpass filter, which protects the receiver from interference. Interference can be caused by any household appliance.

The bandpass filter is set to a fixed frequency: 30; 33; 36; 38; 40 and 56 kilohertz. In order for the signal from the remote control to be received by the Arduino IR receiver, the remote control must be at the same frequency as the filter in the IR receiver is set to. After the filter, the signal goes to an amplitude detector that integrates the filter and the output transistor.

How to connect an IR receiver to Arduino

The housings of infrared receivers contain an optical filter to protect the device from external electromagnetic fields; they are made of a special shape to focus the received radiation on a photodiode. To connect the IR receiver to Arduino UNO They use three legs that connect to the ports - GND, 5V and A0.

For this lesson we will need the following details:

  • Arduino Uno board;
  • Bread board;
  • USB cable;
  • IR receiver;
  • Remote control;
  • 1 LED;
  • 1 resistor 220 Ohm;
  • Wires “folder-folder” and “folder-female”.

Connection diagram of the IR receiver to the Arduino analog port

Connect the IR receiver according to the diagram and the LEDs to pins 12 and 13 and upload the sketch.

#include // connect the library for the IR receiver IRrecv irrecv(A0); // indicate the pin to which the IR receiver is connected decode_results results; void setup () // procedure setup ( irrecv.enableIRIn (); // start receiving an infrared signal pinMode(13, OUTPUT); // pin 13 will be the output pinMode(12, OUTPUT); // pin 12 will be the output pinMode(A0,INPUT); // pin A0 will be the input (eng. “intput”) Serial.begin(9600); // connect the port monitor) void loop () // procedure loop ( if (irrecv.decode (&results)) // if the data has arrived, execute the commands( Serial . println ( results . value ); // send the received data to the port // turn on and off the LEDs, depending on the received signal if (results.value == 16754775) ( digitalWrite (13, HIGH); ) if (results.value == 16769055) ( digitalWrite (13, LOW); ) if (results.value == 16718055) ( digitalWrite (12, HIGH); ) if (results.value == 16724175) ( digitalWrite (12, LOW); ) irrecv.resume (); // receive the next signal on the IR receiver } }

Explanations for the code:

  1. The IRremote.h library contains a set of commands and allows you to simplify the sketch;
  2. The decode_results statement assigns the variable name results to the received signals from the remote control.

What to pay attention to:

  1. To be able to control the inclusion of the LED, you need to turn on the port monitor and find out what signal is sent by this or that button on the remote control;
  2. The obtained data should be entered into the sketch. Change the eight-digit code in the sketch after the double equal sign if (results.value == 16769055) to your own.

IR receiver device, operation and testing

IR receivers of infrared radiation have become widespread in television, household, medical equipment and other equipment. They can be seen in almost any type of electronic equipment; they are controlled using a remote control.


operation and block diagram of the IR receiver

Typically, an IR receiver microassembly has three or more pins. One is common and is connected to the power supply minus GND, the other to the plus V s, 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 positives, from background radiation and interference from other household appliances emitting in the IR range. Fluorescent energy-saving lamps with an electronic ballast circuit can create quite strong interference for the receiver.

The microassembly of a typical IR radiation receiver includes: PIN photodiode, variable amplifier, bandpass filter, amplitude detector, integrating filter, threshold device, output transistor

A PIN photodiode is from the family of photodiodes, in which another region of its own semiconductor (i-region) is created between the n and p regions - 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 influence of external IR radiation, current begins to flow through the diode. Which then goes to a variable amplifier.

Then the signal from the amplifier goes to a bandpass filter that protects against interference in the IR range. The bandpass filter is set to a strictly fixed frequency. Typically, filters are used that are set 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 to which the filter is configured.

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

The housings of IR modules are made of a special shape that facilitates focusing of the received radiation onto the sensitive surface of the photocell. The housing material transmits radiation with a strictly defined wavelength from 830 to 1100 nm. Thus, the device uses an optical filter. To protect internal elements from external influences. fields an electrostatic screen is used.

Checking the IR Receiver

Since the IR signal receiver is a specialized microassembly, in order to ensure its operation it is necessary to apply a supply voltage to the microcircuit, usually 5 volts. The current consumption 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. It's between GND and the signal output pin can be measured using 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, be sure to determine the pinout of its outputs. Usually this information is easy to find in our mega-directory of electronics datasheets. You can download it by clicking on the picture on the right.

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

As soon as packets of infrared pulses begin to arrive at the photodiode of the IR microassembly, 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, the screen will again display 5 volts.

As you can see, the IR radiation receiver responds correctly to the signal from the remote control. This means the module is OK. In a similar way, you can check any modules in an integrated design.

The infrared remote control is one of the most simple ways interaction with electronic devices. So, almost every home has several such devices: a TV, a stereo system, a video player, an air conditioner. But the most interesting use of an infrared remote control is remote control of a robot. Actually, in this lesson we will try to implement this control method using the popular Arduino Uno controller.

1. IR remote control

What does it take to teach a robot to obey an infrared (IR) remote control? First, we need the remote control itself. You can use a regular TV remote control, or you can purchase a miniature remote control for your car radio. These types of remote controls are often used to control robots. This remote control has 10 digital buttons and 11 buttons for manipulating music: volume, rewind, play, stop, etc. More than enough for our purposes.

2. IR sensor

Secondly, to receive a signal from the remote control we need a special IR sensor. In general, we can detect infrared radiation with a conventional photodiode/phototransistor, but unlike it, our IR sensor perceives infrared signal only at a frequency of 38 kHz (sometimes 40 kHz). It is this property that allows the sensor to ignore a lot of extraneous light noise from lighting lamps and the sun. For this tutorial we will use the popular IR sensor VS1838B, which has the following characteristics:
  • carrier frequency: 38 kHz;
  • supply voltage: 2.7 - 5.5 V;
  • current consumption: 50 µA.
Other sensors can be used, for example: TSOP4838, TSOP1736, SFH506.

3. Connection

The sensor has three leads (three legs). If you look at the sensor from the IR signal receiver side, as shown in the figure,
  • then on the left there will be an output to the controller,
  • in the center - negative power contact (ground),
  • and on the right - the positive power contact (2.7 - 5.5V).
Schematic diagram of connection Layout appearance

4. Program

Having connected the IR sensor, we will write a program for Arduino Uno. To do this, we will use the standard library IRremote, which is designed specifically to simplify the work with receiving and transmitting IR signals. Using this library, we will receive commands from the remote control, and to begin with, simply display them in the serial port monitor window. This program will be useful to us in order to understand what code each button gives. #include "IRremote.h" IRrecv irrecv(2); // indicate the pin to which the receiver is connected decode_results results; void setup() ( Serial.begin(9600); // set the speed of the COM port irrecv.enableIRIn(); // start receiving ) void loop() ( if (irrecv.decode(&results)) ( // if data arrived Serial .println(results.value, HEX); // print the data irrecv.resume(); // accept the following command ) ) Load the program onto the Arduino. After that, we try to receive commands from the remote control. Open the serial port monitor (Ctrl+Shift+M), pick up the remote control, and point it at the sensor. By pressing different buttons, we observe the codes corresponding to these buttons in the monitor window. Problem loading the program In some cases, when trying to load a program into the controller, an error may appear: TDK2 was not declared In his scope To fix it, just delete two files from the library folder. Let's go to the explorer. Go to the folder where the Arduino IDE application is installed (most likely “C:\Program Files (x86)\Arduino”). Then to the library folder:…\Arduino\libraries\RobotIRremote , and delete the files: And IRremoteTools.cpp IRremoteTools.h.

Then, we restart the Arduino IDE and try to load the program onto the controller again.

5. Control the LED using the IR remote control
  • Now that we know which codes correspond to the remote control buttons, we try to program the controller to turn on and turn off the LED when the volume buttons are pressed. To do this we need codes (may vary depending on the remote control):
  • FFA857 - increase volume;
As an LED, we use the built-in LED on pin No. 13, so the connection diagram will remain the same. So, the program: #include "IRremote.h" IRrecv irrecv(2); // indicate the pin to which the receiver is connected decode_results results; void setup() ( irrecv.enableIRIn(); // start receiving ) void loop() ( if (irrecv.decode(&results)) ( // if data arrived switch (results.value) ( ​​case 0xFFA857: digitalWrite(13, HIGH); break; case 0xFFE01F: digitalWrite(13, LOW); break; irrecv.resume(); // accept the following command ) ) Download to Arduino and test. Click vol+— the LED lights up. Click vol-- goes out. Now, knowing how it all works, you can control robot motors or other homemade microelectronic devices instead of an LED!