Contacts

Install an additional IR receiver in the satellite receiver. Infrared barrier do it yourself to collect IR learning receiver with your own hands

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 particular console (why? - "not interesting so!"), But to make a system that can work with different models of remotes from different technology. 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 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, 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, 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. (It is 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

Listen to music, watch movies on your computer. It is more convenient if you are not on a chair in front of the monitor, but on the sofa, while it is not necessary to get up to control, just press the button on the remote. But where to take a remote with the receiver? You can buy in the store, but the cost of such a set is quite high. However, fortunately make an IR receiver for any console (practically), quite simple.

It will take:

  • IR receiver TSOP1738;
  • port COM port;
  • resistors on 10 com, 4.7 com;
  • silicon diode (any);
  • condenser 10 μF 16 V;
  • wires.

IR receiver do it yourself

The TSOP1738 photodiode at the exit gives ready-made bits that are sent to the COM port, we do not need to solder challenges with the use of controllers.

As you can see anything complicated. The receiver scheme is so simple that it can be collected by a canopy. In this assembly, a diode KD105G was used. As you can see in the photo, the anode is marked with yellow paint. If you use another diode, the polarity must be learn from reference books. Polarity and the condenser should also be observed (negative conclusion is marked on the housing).

Back side.

The other end of the wire is soldered to the port COM connector.

To reduce the size of the circuit, it can be safely bent. Make sure that the findings themselves do not come into contact with each other, otherwise it turns out a short circuit.

You can pour epoxy resin or in this case with plastic Glue Gun. It will save the device from external influences.

Someone had such that late in the evening according to TV there is an interesting movie, and the wife is going to make a TV quieter, the child is sleeping ?? What to do? Headphones with wires are not convenient, wireless to buy expensive. But there is a way out.

I present you wireless headphones on IR rays. More precisely, the transmitter and receiver for headphones. The principle of operation is very simple, the transmitter connects to the audio output on TV or any other technology. In the transmitter of the establishment of IR diodes, the same as in the consoles from TV, the transmitter translates the sound from TV to the IR signals that are accepted by the receiver.

You don't need to flash in the scheme, just assemble the scheme and enjoy.

Here is the transmitter scheme itself:

It consists of not a large number of details, it will not be much difficult to collect her. You can even ride the fee, but to make all the mounted installation. The power of the transmitter is 12V, if it is less well, for example, 9V, everything will work, but in the headphones there will be a bit of the phoning. The transmitter in the setup does not need, the main thing to connect everything as in the diagram.

The transmitter board itself, after the assembly.

The diagram shows 4 IR diodes for transmission, but I applied only 3, it was more simply not. You can also put one, but what they are more, the easier it is to catch the transmission signal. Connecting IR diodes and photos of diodes below in the photo:

The receiver also consists of a minimum of details, even less than the transmitter.
Receiver scheme:

The heart of the receiver is the TDA 2822 microcircuit. There are a penny in stores.

A receiver is powered from 3-4.5V, from any power source.
The receiver board is compact enough.

And so, a suitable case for the receiver was found.

The whole filling is placed there very well, a lot of space remained.

It became for meals. I thought for a long time that to adapt and chose the batteries from the children's toys. As a result, you can simply charge the batteries, and not change the batteries.

Everything spoiled in the housing, the place was enough to the edge.

As a result, everything looks great.


The turn of the transmitter enclosure turns. The body put what I was at that time. After all, the food will be external, from the power supply.

9V power supply unit.
All is ready. To check the operability of the receiver, turn it on, we connect the headphones, we guide the simple remote control from the TV and press any button, the clicks must be heard, if they are, it means that the receiver works.

A single-channel receiver module with a relay, to respond from any standard infrared console, provides remote control of any load on the invisible IR channel. The project is based on the microcontroller PIC12F683, and the TSOP1738 is used as an infrared receiver. The microcontroller decodes the RC5 serial data project coming from TSOP1738 and provides an output control if the data is valid. The output can be installed various necessary states using jumpers on the board (J1). On the PCB there are 3 LEDs: power indicator, transmission and relay response. This scheme works with any RC5 remote control from the TV, center and so on.

Features of the scheme

  • Power receiver 7-12V DC
  • The current consumption of the receiver up to 30 mA
  • Radius of action up to 10 meters
  • RC5 Signal Protocol
  • Board sizes 60 x 30 mm

Although recently it became fashionable to use radio channels, including bluetooth, independently make such equipment at all. In addition, radio waves are susceptible to interference, and even intercept them elementary. Therefore, the IR signal in some cases will be preferable. Firmware, drawings of printed circuit boards and full description in English -

Yakora Sergey

Introduction

In the Internet, there are many simple devices based on the controllers of the PIC16F family and PIC18F firms of Microchip. I suggest your attention a rather complicated device. This article I think will be useful to everyone who writes programs for PIC18F, since you can take the source texts of the program to create your real-time system. Information will be plentious, ranging from the theory and standards, ending with the hardware and software implementation of this project. The source texts on the Asembler are equipped with complete comments. Therefore, it will not be difficult to understand the program.

Idea

As always, everything starts with the idea. We have a map of the Stavropol Territory. On the map there are 26 regions of the edge. Card size 2 x 3 m. It is necessary to control the backlight of the selected areas. The management should be remotely in the infrared control channel, then the text is simply an IR or IR Remote Control. At the same time, the control commands should be transmitted to the RS control server. When choosing a district on the map, the control server displays additional infomation on the monitor. By commands from the server, you can manage the display of information on the map. The task is delivered. Ultimately, we got what you see in the photo. But before all this had to be implemented, some stages had to go and solve various technical tasks.


View from the edge.

Device operation algorithm

From the remote control, the display management system should be controlled not more difficult than selecting a program on TV or task the track number on the CD. It was decided to take the phone ready from the Philips video recorder. Selecting the Room District is set to sequentially press the button buttons "P +" Next two digital buttons of the area number, end input "R-". When you first select the area, it is allocated, (the LED illumination is turned on) and the selection is removed when repeatedly selecting.
Card Management Protocol with RS Management Server.

1. Outgoing commands, i.e. Commands from the device in the PC:

1.1. When you turn on the power on the device in the RS comes the command: MAP999
1.2. When you turn on the area: Map (district number) 1
1.3. When the area is turned off: Map (district number) 0
1.4. When you turn on the whole card: MAP001
1.5. When you turn off the whole card: MAP000

2. Incoming commands:

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

When you turn off the last area, the "Turning off the entire card" command must also receive.
When you turn on the last non-inclusive area, the "Enable Map" command should also receive.
The area number is ASCII characters of numbers (0x30-0x39).

From ideas for implementation

Anticipating that the manufacture of own housing may be a rather difficult problem, it was decided to take the finished remote control from the serial machine. The IR control system of the RC5 control commands is selected as the basis of the IR control system. Currently, remote control (DF) on IR rays is very widely used to control various equipment. Perhaps the first type of household apparatus, where IR Du was used, were televisions. Now it is in most types of household audio and video equipment. Even portable music centers have recently equipped with a system of Du. But household appliances is not the only sphere of applying Du. Instruments with DF and production, and in scientific laboratories are quite widespread. In the world there are quite a lot of non-compatible systems of IR Du. The RC-5 system received the greatest distribution. This system is used in many TVs, including domestic. Currently, several modifications of the RC-5 remote controls are produced by different plants, and some models have quite a decent design. This allows you to get a self-made device with an IR Du. After lowering the details, why this system was selected, we will consider the theory of the construction system based on the RC5 format.

Theory

To understand how the control system works, it is necessary to penetrate, which is the signal at the output of the IR remote control.

The Infrared Remote Control System RC-5 was developed by Philips for the needs of managing household appliances. When we press the remote control button, the transmitter chip is activated and generates a sequence of pulses that have a filling with a frequency of 36 kHz. LEDs convert these signals to IR radiation. The radiated signal is received by photodiode, which again converts IR radiation into electrical impulses. These pulses are enhanced and demodulated the receiver microphop. Then they are served on the decoder. Decoding is usually implemented software using a microcontroller. We will talk about this in detail in the section on decoding. RC5 code supports 2048 commands. These commands make up 32 groups (systems) of 64 teams each. Each system is used to control a specific device, such as TV, video recorder, etc.

At the dawn of the formation of IR control systems, the signal generation was hardware. For this, specialized ICs were developed, and now increasingly the remote controls are made on the basis of a microcontroller.

One of the most common transmitter chips is the SAA3010 microcircuit. Briefly consider its characteristics.

  • Supply voltage - 2 .. 7 in
  • Current consumption in waiting mode - no more than 10 μA
  • Maximum output current - ± 10 mA
  • Maximum clock frequency - 450 kHz

The block diagram of the SAA3010 microcircuit is shown in Figure 1.

Figure 1. Structural scheme of SAA3010.

The description of the conclusions of the SAA3010 chip is given in the table:

Output Designation Function
1 X7. Input Lines Matrix Buttons
2 SSM. Logging mode selection
3-6 Z0-Z3. Input Lines Matrix Buttons
7 MDATA. Modulated output, 1/12 Resonator frequency, 2%
8 Data. Output
9-13 DR7-DR3. Scan outputs
14 VSS. Land
15-17 DR2-DR0. Scan outputs
18 OSC. Generator input
19 TP2. Test input 2.
20 TP1 Test input 1.
21-27 X0-X6. Input Lines Matrix Buttons
28 VDD. Supply voltage

The transmitter microcircuit is the basis of the remote control. In practice, the same remote control can be used to manage multiple devices. The transmitter microcircuit may address 32 systems in two different modes: combined and in single system mode. In the combined mode, the system is first selected, and then the command. The number of the selected system (address code) is stored in a special register and the command is transmitted relating to this system. Thus, to transmit any command, the sequential press of two buttons is required. It is not entirely convenient and justified only when working simultaneously with a large number of systems. In practice, the transmitter is more often used in the mode of one system. In this case, instead of the matrix of the system selection buttons, a jumper is mounted, which determines the system number. In this mode, to transfer any command to press only one button. By applying the switch, you can work with multiple systems. And in this case, pressing only one button is required to send a command. The transmitted command will relate to the system that is selected at this time using the switch.

To enable the combined mode to the SSM transmitter output (System Mode), you must submit a low level. In this mode, the transmitter microcircuit works as follows: during the rest of the X and the Z-line of the transmitter are in a high level state using internal P-channel tightening transistors. When the button in the X-DR or Z-DR matrix is \u200b\u200bpressed, the cycle of the cracking of the keyboard is started. If the button is closed for 18 clocks, the generator resolution signal is recorded. At the end of the bounce suppression cycle, DR-outputs turn off and two scan cycles are started, including each DR output. In the first scan cycle, the z-address is detected, in the second - X-address. When Z-input (system matrix) or X-input (command matrix) is detected in the zero state, the address is fixed. When you press a button in the system matrix, the last command is transmitted (i.e. all bits of the team are equal to one) in the selected system. This command is passed until the system select button is released. When you press the button in the command matrix, the command is transmitted along with the address of the system, stored in the register-clock. If the button is released before the start of the transmission, reset occurs. If the transmission started, then regardless of the button status, it will be fully fulfilled. If more than one z or x button is pressed simultaneously, the generator does not start.

To enable single system mode, the SSM output must have a high level, and the system address must be set by the corresponding jumper or switch. In this mode, during the rest of the X-line of the transmitter are in a high level state. At the same time, the Z-line is turned off to prevent current consumption. In the first of two scan cycles, the address of the system is determined and is saved in the register-lock. The second cycle defines the command number. This command is transmitted together with the address of the system, stored in the register-lock. If there is no z-DR jumper, then no codes are transmitted.

If the button has been released between the passing of the code, then the reset. If the button has been released during the rating suppression procedure or during the matrix scan, but before the button is pressed, the button is also discharged. The outputs of DR0 - DR7 have an open stock, at rest transistors open.

In the RC-5 code, there is an additional control bit that is inverted with each button release. This bit informs the decoder about whether the button holds or has a new press. The control bit is inverted only after fully completed parcel. Scan cycles are made before each premise, so even if you change the button to another during the transfer of the parcel, the system number and command numbers will be transmitted correctly.

OSC output is an input / output of a 1-output generator and is designed to connect a ceramic resonator to a frequency of 432 kHz. A sequential resonator is recommended to include a resistor with a resistance of 6.8 kΩ.

Test inputs TP1 and TP2 in normal operation must be connected to the ground. With a high logical level, the TP1 increases the scan frequency, and at a high level on TP2 - the frequency of the shift register.

At rest, the outputs of Data and MDATA are in Z-state. The generated by the transmitter at the output of the MDATA pulse sequence has a frequency of 36 kHz (1/12 of the clock generator frequency) with a standard of 25%. At the DATA output, the same sequence is generated, but without filling. This output is used in the case when the transmitter chip performs the functions of the built-in keyboard controller. The DATA output signal is fully identical to the signal at the output of the remote control receiver (but, unlike the receiver, it does not have inversion). Both of these signals can be processed by the same decoder. The use of SAA3010 as a built-in keyboard controller in some cases is very convenient, since only one interrupt input is consumed to survey the matrix to 64 buttons in the microcontroller. Moreover, the transmitter microcircuit allows power to be powered +5 V.

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


Figure 2. Data word format RC-5 code.

Starting bits are designed to install ARUs in the receiver IC. The control batch is a sign of a new press. The duration of the clock is 1.778 ms. While the button remains pressed, the data word is transmitted with an interval of 64 clock, i.e. 113.778 ms (Fig. 2).

The first two impulses are starting, and both are logical "1". Note that half of the bit (empty) passes earlier than the receiver will determine the actual start of the message.
Advanced RC5 protocol uses only 1 start-bit. Bit S2 is transformed and added to the 6th bits of the team, forming as a whole 7 bits of the team.

The third bit is the manager. This bit is inverted whenever the key is pressed. In this way, the receiver can distinguish the key that remains pressed, or periodically pressed.
The following 5 bits represent the address of the IR device, which is sent to the first LSB. The address follows 6 bits of the team.
The message contains 14 bits, together with the pause, have a total duration of 25.2 ms. Sometimes the message may be shorter due to the fact that the first half of the start-bit S1 remains blank. And if the last bit of the command is a logical "0", then the last part of the message bits is also empty.
If the key remains pressed, the message will be repeated every 114 ms. The control bit will remain the same in all messages. This is a signal for the receiver program to interpret it as a function of the auto helper.

To ensure good noise immunity, two-phase coding is used (Fig. 3).

Figure 3. Coding "0" and "1" in the RC-5 code.

When using the RC-5 code, you may need to calculate the average current consumed. Make it just enough if you use rice. 4, where the detailed package is shown.

Figure 4. Detailed RC-5 parcel structure.

To ensure the identical response of equipment on the RC-5 commands, the codes are distributed quite in a certain way. Such standardization allows us to design transmitters that allow you to control various devices. With the same commands of the commands for the same functions in different devices, the transmitter with a relatively small number of buttons can be controlled simultaneously, for example, an audio complex, TV and a video recorder.

System numbers for some types of household apparatus are shown below:

0 - TV (TV)
2 - Teletext
3 - video data
4 - Video Player (VLP)
5 - Cassette VCR (VCR)
8 - Video Tuner (Sat.tv)
9 - video camera
16 - Audio Preamplifier
17 - tuner
18 - Tape recorder
20 - compact player (CD)
21 - Player (LP)
29 - Lighting

The remaining system numbers are reserved for future standardization or for experimental use. Standardized also compliance with some command codes and functions.
Command codes for some functions are shown below:

0-9 - digital values \u200b\u200b0-9
12 - duty regime
15 - Display
13 - Mute.
16 - Volume +
17 - Volume -
30 - Search Forward
31 - Search Back
45 - Emission
48 - Pause
50 - Rewind Back
51 - Rewind forward
53 - Playback
54 - Stop
55 - Record

In order to build a finished remote control on the basis of a transmitter chip based on the LED driver, which is capable of providing a large pulse current. Modern LEDs work in the remote control of the remote control of about 1 A. The LED driver is very convenient to build on a low-level (LOGIC LEVEL) MOS-transistor, for example, KP505A. An example of a concept of the console is shown in Fig. five.

Figure 5. RC-5 console scheme.

The system number is set by the jumper between Zi and DrJ outputs. The system number will be as follows:

The code code that will be transmitted when the button is pressed, which closes the XI line with the DrJ line, is calculated as follows:

The IR Du receiver must restore data with two-phase coding, it should respond to large rapid signal level changes regardless of interference. The width of the pulse at the outlet of the receiver should differ from the nominal no more than 10%. The receiver must be insensitive to constant external lights. Satisfy all these requirements is not easy. The old implementations of the receiver of IR Du, even using specialized chip, contained tens of components. Such receivers often used resonant contours configured to a frequency of 36 kHz. All this made the design complex in the manufacture and configuration, required the use of good shielding. Recently, three-way integrated receivers of IR Du received great distribution. In one case, they combine the photodiode, a preamplifier and the formator. An ordinary TTL signal is formed at the outlet without filling 36 kHz, suitable for further processing with a microcontroller. Such receivers are made by many firms, this SIEMENS SFH-506 firms, TEMIC, ILM5360 manufactured by "Integral" and others. Currently, there are more miniature variants of such chips. Since other standards that differ, in particular, the frequency of filling, exist, except, in particular, are integrated receivers for different frequencies. To work with the RC-5 code, you should select models calculated on the fill frequency of 36 kHz.

A photodiode with an amplifier-shaper can also be applied as a receiver of IR Doo, which can serve as a specialized KR1568HL2 microcircuit. The diagram of such a receiver is shown in Figure 6.

Figure 6. Receiver on the KR1568Hl2 chip.

For the display management system, I chose an integral receiver IR DB. As a receiver of optical radiation in the TSOP1736 chip, a highly sensitive PIN photodiode is installed, the signal from which enters the input amplifier that converts the output current of the photodiode to the voltage. The transformed signal enters the amplifier with the ARU and on the strip filter, which highlights the signals with a working frequency of 36 kHz from noise and interference. The dedicated signal enters the demodulator, which consists of a detector and integrator. In pauses between pulses, the ARU system is calibrated. Manages this control scheme. Thanks to this construction, the microcircuit does not respond to continuous interference even at the operating frequency. The active level of the output signal is low. The microcircuit does not require the installation of any external elements for its work. All its components, including the photodetector, are protected from an external fitting with an internal electric screen and flooded with a special plastic. This plastic is a filter that cuts off the optical interference in the visible range of light. Thanks to all these measures, the microcircuit differs very high sensitivity and the low probability of appearance of false signals. And all the integrated receivers are very sensitive to nutritional interference, therefore it is always recommended to use filters, for example, RC. The appearance of the integral photodetector and the location of the conclusions are shown in Fig. 7.

Figure 7. Integral receiver RC-5.

RC-5 decoding

Since the basis of our device is a microcontroller PIC18F252 Decoding of the RC-5 code will be programmatically. The RC5 code reception algorithms proposed in the network are mostly not suitable for real-time devices, what is our device. Most of the proposed algorithms use program cycles to form temporary delay and measurement intervals. For our case, this is not suitable. It was decided to use the Signal Slow Interrupts at the INT Input Input Microcontroller PIC18F252, Time Parameters Measure using TMR0 PIC18F252 microcontroller, the same timer generates an interrupt when the next pulse waiting time has expired, i.e. When the pause occurred between two parcels. The demodulated signal from the release of the DA1 chip, enters the int0 microcontroller input, in which it is decrypting and issuing a decrypted command to shift registers to control keys. The decryption algorithm is based on measuring the time intervals between the interrupts of the microcontroller PIC18F252. If you carefully look at Figure 8, you can notice some features. So if the interval between the interrupts of the microcontroller Pic18F252 was equal to 2T, where t is the duration of a single pulp RC5, then the received bit may be 0 or 1. It all depends on which bit before it. In the program below with detailed comments, it is very clearly visible. Fully all project is available for download and use for personal purposes. When reprinting the link is required.



Did you like the article? Share it