Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

Relay IR control unit. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Clocks, timers, relays, load switches

Comments on the article Comments on the article

According to IR commands given by any remote control from household appliances operating under the common NEC protocol (or similar), the proposed unit controls ten electromagnetic relays installed in it, which, in turn, can turn on and off various electrical appliances. It is possible to programmatically set the correspondence between the pressed buttons of the used remote control and the relays that change states on these pressings.

Since ten relays are installed in the block, in the author's version, the digital buttons on the remote control "0" - "9" are selected to control them. When such a button is pressed, the relay corresponding to it closes its contacts, when pressed again, it opens them, when pressed again, it closes again, and so on. If you press the "VOL-" button, the contacts of all relays will open, and on the "EQ" button they will close. LEDs are provided to control the state of the relay. When all the relays have been activated, the unit consumes a current of 15...17 mA from a 24...200 V AC (or 250 V DC) source. This value depends on the applied relays.

For the manufacture and adjustment of this unit, there is no need to know in advance the codes of commands given by the remote control used when pressing its buttons. You just need to make sure that the remote control works according to the protocol that matches NEC in terms of the encoding of the transmitted information and its volume (each command is four bytes). Please note that remote controls from different devices, even those operating on the same protocol, when you press functionally identical buttons, usually generate commands with different codes. To determine these codes, I developed a special program PriemNEC_Eeprom, which must be loaded into the microcontroller of the assembled device and, after performing simple operations, transfer the received codes to the working program of the microcontroller.

IR relay control unit
Rice. 1 (click to enlarge)

The diagram of the IR control block is shown in fig. 1. It does not contain unusual technical solutions, as well as scarce and too expensive parts. The commands sent using the remote control are received by the IR receiver module U1, the signals of which are fed to the input PD3 of the microcontroller DD1. The supply voltage of the microcontroller (5 V) was obtained from a voltage of about 1 V rectified by the diode bridge VD24 using an integrated stabilizer DA1. It is impossible to replace the imported 7805 stabilizer here with domestic KR142EN5A or KR142EN5V, since their permissible input voltage is only 15 V (unlike 35 V for 7805).

Chips DD2 and DD3 - sets of electronic keys on composite transistors (maximum switching current 130 mA, voltage - 50 V). The K1-K10 relays are of the G2L-113P-V-US-24VDC type (winding resistance 1200 Ohm), the contacts of which are capable of switching current up to 5 A at alternating voltage up to 250 V.

IR relay control unit
Fig. 2

A board with dimensions of 120x110 mm, the drawing of printed conductors of which is shown in fig. 2 is made of textolite foiled on one side. The details on its opposite side of the printed conductors are located, as shown in fig. 3.

IR relay control unit
Fig. 3

In addition to them, there are two jumpers made of bare wire. The dash-dotted line shows the contour of the plate heat sink of the stabilizer DA1. The height of the heat sink is 25 mm (according to the height of the relay). For the DD1 microcontroller, a panel must be provided on the board into which it is inserted already programmed.

On the side of the printed conductors, the boards are mounted as shown in fig. 4, two groups of jumpers. Jumpers of one group are depicted with black lines. They are made from thin insulated wire. The red lines show the jumpers of another group, connecting the relay contacts in the required order with the XT1 terminal block. The cross section and insulation of the wire from which they are made must correspond to the current and voltage switched by the relay.

IR relay control unit
Fig. 4

Before proceeding with the manufacture of the board, it is necessary to make sure that the remote control with which it is to be used works according to a protocol similar to NEC. To do this, you can use a simple node, assembled according to the scheme shown in Fig. 5 by connecting it to the microphone input of the computer's sound card.

IR relay control unit
Fig. 5

The remote control is directed to the IR-sensitive window of the U1 module and, using the "Sound Recorder" program included in the Windows package (or another similar one), the signals emitted by the remote control when its buttons are pressed are recorded in computer wav files. You can view the waveforms of the recorded signals, for example, by running the WAVE editor built into the NERO software package.

An example of an oscillogram of the NEC protocol console signal is available in the article [1]. The only difference is that the recording was made using a digital oscilloscope, not a computer. If the pulses and pauses between them in the signals of the studied remote control are the same as in the example, the duration and the total amount of information transmitted in each command (four bytes) are the same - the remote control is suitable for use with the described device. A detailed description of the various protocols used in IR remote control systems can be found in [2]. From there, the prototype of the program for decoding code packets was taken.

Having assembled the described device, it is necessary, first of all, to determine which command codes correspond to the buttons pressed on the selected remote control. Most likely, they will differ from the remote control codes used by the author.

To do this, load the codes from the PriemNEC_Eeprom.hex file into the program memory of the ATtiny2313-20PI microcontroller, install the microcontroller in the panel intended for it on the board, and turn on the power.

Pointing the remote control at the IR receiver U1, press each of its buttons in turn at intervals of 2...3 s. Confirming each successful command reception, the HL1 LED on the board should flash briefly, and the HL3 state should change to the opposite. This is a sign that the code has been accepted and written to the EEPROM of the microcontroller. The maximum number of button presses that can be recorded in one launch of the program is 32. Their sequence must be remembered, or better, written down on paper.

IR relay control unit
Fig. 6

Next, the device should be turned off, transfer the microcontroller from its panel to the programmer panel, with which to read the contents of the EEPROM. On fig. 6 shows the window of the IC-Prog program with such content, obtained by the author in the study of the remote control he used from the car FM modulator. This remote control has 20 buttons and small dimensions (85x40x6mm).

IR relay control unit
Fig. 7

Each pressed button corresponds to four consecutive byte cells. The codes in the first two of them (0x40, 0xBF) do not change from button to button, while the third and fourth contain the actual code of the command given by the button and its inversion. In the device under consideration, only codes from the fourth cells are used. On fig. 7 they are written to the right of the images of the remote control buttons from the FM modulator. You have to draw up a similar scheme for your own remote control.

IR relay control unit

It remains to make changes to the work program that adapt it to the existing remote control. To do this, using the AVRStudio program development environment, you need to open the Plata_IR_upravlenie_rele2.asm file and find the lines labeled one, mesg and Wataa in it. They are shown in the table, and for convenience, each of the mesg and Wataa arrays is divided here into several parts, provided with comments.

The one constant contains the first two bytes of the command. As already mentioned, for all commands they are the same, but may vary from remote to remote. Those that your remote control transmits must be entered here instead of those in the program. The program does not analyze the third byte of the command, so its value is not required anywhere.

The mesg byte array lists the codes (fourth bytes) of commands given to each of the used remote control buttons from the FM modulator.

They should be replaced with the codes of the buttons of your remote control. Their maximum number is 15. Since only 12 buttons are used to control the relay, bytes from the thirteenth to the fifteenth are filled with non-existent button codes, instead of which, if desired, existing ones can be written, and these commands will be executed. The sixteenth byte contains the code 0xFF - a sign of the end of the array, it cannot be changed.

An array of 16-bit Wataa words contains codes that determine the device's actions when receiving a particular command. The words in it follow the same order as the command codes in the mesg array. The first code (remote control button) corresponds to the first word, the second - the second and so on. The high byte of the word specifies the operation to be performed: 0x00 - turn off all relays, 0x01 - change the state of port B bits and related relays, 0x02 - change the state of port D bits and related relays, 0x03 - turn on all relays. Units in binary digits (one or more) of the low word mark those bits of the port indicated by the high byte, the state of which, when received by this command, should change to the opposite. Please note that the state of the PD3 and PD5 bits cannot be controlled in this way. The level at the pins of the PD0-PD2 bits will be changed by commands, but on the described board they are not connected anywhere. To use them, refinement is required. With high bytes equal to 0x00 or 0x03, the low byte is not parsed and can be anything.

After making changes, the program must be assembled. As a result, a HEX-file of the working program adapted to the selected remote control will be obtained. Its contents should be loaded into the program (FLASH) memory of the microcontroller.

If when you press the remote control button, the HL1 LED signaling the receipt of the command does not blink, you need to select the value of the Delay_1125us constant, which is responsible in the program for the exact formation of the time intervals necessary for correct reception. In the assembler file of the program, the .equ statement that assigns the value $B6 to it is at the very beginning of the "basic constants" section. In the AVRASM assembler, the $ sign and the 0x prefix are equal signs of a hexadecimal number. The constant should be chosen very carefully, changing its value by one. After each change, the program must be reassembled and the microcontroller reprogrammed.

The microcontroller program can be downloaded from ftp://ftp.radio.ru/pub/2013/07/ir-upr.zip.

Literature

  1. Salimov N. Receiver of commands given by the remote control from the TV. - Radio, 2012, No. 3, p. 23-27.
  2. Theory of IR DE - woodocat.ru/IK.php.

Author: Yu. Svyatov

See other articles Section Clocks, timers, relays, load switches.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Machine for thinning flowers in gardens 02.05.2024

In modern agriculture, technological progress is developing aimed at increasing the efficiency of plant care processes. The innovative Florix flower thinning machine was presented in Italy, designed to optimize the harvesting stage. This tool is equipped with mobile arms, allowing it to be easily adapted to the needs of the garden. The operator can adjust the speed of the thin wires by controlling them from the tractor cab using a joystick. This approach significantly increases the efficiency of the flower thinning process, providing the possibility of individual adjustment to the specific conditions of the garden, as well as the variety and type of fruit grown in it. After testing the Florix machine for two years on various types of fruit, the results were very encouraging. Farmers such as Filiberto Montanari, who has used a Florix machine for several years, have reported a significant reduction in the time and labor required to thin flowers. ... >>

Advanced Infrared Microscope 02.05.2024

Microscopes play an important role in scientific research, allowing scientists to delve into structures and processes invisible to the eye. However, various microscopy methods have their limitations, and among them was the limitation of resolution when using the infrared range. But the latest achievements of Japanese researchers from the University of Tokyo open up new prospects for studying the microworld. Scientists from the University of Tokyo have unveiled a new microscope that will revolutionize the capabilities of infrared microscopy. This advanced instrument allows you to see the internal structures of living bacteria with amazing clarity on the nanometer scale. Typically, mid-infrared microscopes are limited by low resolution, but the latest development from Japanese researchers overcomes these limitations. According to scientists, the developed microscope allows creating images with a resolution of up to 120 nanometers, which is 30 times higher than the resolution of traditional microscopes. ... >>

Air trap for insects 01.05.2024

Agriculture is one of the key sectors of the economy, and pest control is an integral part of this process. A team of scientists from the Indian Council of Agricultural Research-Central Potato Research Institute (ICAR-CPRI), Shimla, has come up with an innovative solution to this problem - a wind-powered insect air trap. This device addresses the shortcomings of traditional pest control methods by providing real-time insect population data. The trap is powered entirely by wind energy, making it an environmentally friendly solution that requires no power. Its unique design allows monitoring of both harmful and beneficial insects, providing a complete overview of the population in any agricultural area. “By assessing target pests at the right time, we can take necessary measures to control both pests and diseases,” says Kapil ... >>

Random news from the Archive

Microphones for karaoke TeslaMic 03.02.2022

Tesla electric vehicle owners in China have received a new update that includes a karaoke feature. At the same time, Tesla introduced a set of TeslaMic microphones to the Chinese market for 1 yuan, which is equivalent to 199 USD.

Microphones from the set are automatically connected to the system. They can be used not only in the car. All microphones were sold out by Chinese motorists on the day of the start of sales.

In Asian countries, karaoke is one of the most popular entertainment. Data from iiMedia Research Group show that by the end of 2021, the audience of Chinese online karaoke services amounted to 500 million people. Thus, the inhabitants of Asian states really love to sing. The Chinese are no exception in this regard.

The set includes two microphones for karaoke. So far, it can only be purchased in China.

Other interesting news:

▪ Universal Donor Blood

▪ Motorola rollable smartphone

▪ Birth control pills affect fear

▪ 5,5" XOLO Q2000 Android smartphone

▪ center of shame

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ website section Television. Article selection

▪ article Useful tips for using miniDV cassettes. video art

▪ article Where was the wheel patented at the beginning of the 21st century? Detailed answer

▪ article Soldering gas soldering. Standard instruction on labor protection

▪ article Lacquer for tin. Simple recipes and tips

▪ article Dragonfly on the tip of a pencil. Focus Secret

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024