![]() |
||||||||||||
|
I am a fan of transmitters and receivers, and that's why I experimented and designed this infrared remote controller. The blocks used for this design are pretty common in electronics and easy to design. Here I assume you have proper knowledge of essential electrical components and circuits. Nowadays designing a remote controller of any kind is not much of a challenge. Everything is integrated into ICs (Integrated Circuits) or as they say chips. You just use one of them that fits your requirements and put very few external components to make it complete. Well, some years ago when I had just finished my bachelor I designed all different blocks of the remote myself and what I'll show you here is based on my experience. Depending on the chip you select for the design, some blocks might be used inside chips and some might be implemented externally. But never the less the same blocks exist in every design. Let's start simple, how infrared transceivers (transmitter, receiver) work. Similar to any other kind of transceiver such as laser optical fiber, radio frequency (RF) and etc. there is a transmitter where in the case of infrared is an infrared LED (Light Emitting Diode) and a receiver which is a light sensitive diode which has a transparent body that mostly lets the infrared through. If you wonder what infrared is, it is light with a frequency lower than red light which falls in a region that is no longer visible to a human eye. Do you still want to see it?! OK, take a look at an infrared source such as a remote using a digital camera which has a display. They show the light as a white light. Why don't we use visible lights? I've never thought about it! Maybe because it is less distracting than visible light. Another thing is that they can get focused easier similar to Laser, which can also be in the infrared frequency region. This is important because if you focus the transmit power towards the receiver, you will need less transmit power as most of the power reaches the receiver. Below is the block diagram of the transmitter:
And here is the block diagram of the receiver:
Transmitter Code Generation In the transmitter circuit, there is a human interface, here a keyboard that is scanned by the processor unit. A processor is always driver by a clock generator. Processor assigns a digital code consisting of zeros and ones as bits to the key pressed that is specific for each key. Then it makes a packet of data that has to be sent in series. For example let's assume if the key #1 is pressed, processor assigns this code: "01100110". This is just an example as the code could be anything depending on the designer's interest and criteria. Note that sometimes the way the coding is designed is very important in some data transmission protocols. But for our purpose here, the code is not that critical. There is another important code that has to be added to the key code to make a proper packet of data to be transmitted. This extra code is called a "header". Headers are very common in data transmission and you can always find them in digital packets. Headers can contain very important data for the receiver, such as the length of the packet, encryption methods of a packet, correction bits, start of a packet and etc. A receiver reads the header first and then it will know how to treat the rest of the packet in order to recover the data. For our purpose hear, the header doesn't need to be so complicated. The reason we use a header here is that first we want to show the receiver that there is a packet coming. Without a constant header, every packet would be different and the receiver doesn't know if it is hearing from the middle of the data or it is just reading the environmental noise. But when the receiver always reads a proper and unique header, then it knows that the consequent bits are the data. In very low noise systems only one bit can be enough to show the start of the packet. But for an infrared signal that is passing through the air, there can be different sources that are able to create something similar to that one bit and lure the receiver into believing there is a data packet coming. Therefore we must choose a more complicated header. The second reason we use a header here is that we want to differentiate our system with the neighbor's system so that they can't control our devices and wise-versa. Therefore we choose a proper number of bits for the header to provide as many different remote systems as we wish. Let's assume we have an eight bit header. Another thing we must consider when providing a suitable header is that the first bit in the header must generate a transition from the ideal state. If the first bits are similar to what receiver receives for the ideal state, then there is no point to send them. Therefore to provide a more efficient header the first bit must provide a transition. Let's assume a digital "one" provides a transition. Therefore for our system we can provide a header such as: "10001110". This header will be added to the generated key code to make a packet. Another thing is the Bit Rate of the serial data. It shouldn't be very slow as it will cause a delay in the receiver response and also makes the system much more sensitive to noise. Noise can cause fake transitions in the digital signal every once in a while depending on the noise level of the system. If the transmission is so slow, you make sure at least one fault happens in the transition due to noise and corrupts the data. Therefore sending the data faster will reduce the probability of noise corrupting the data. It is OK if the fault happens in the header, because then the packet is assumed not related to the specific receiver and is discarded. But a fault happening in the data is not good as the data may be interpreted wrong. There are methods to capture the fault. One of the easiest ways is to add a "Parity Bit" to the packet end. A Parity Bit simply contains information on if the number of Ones or Zeros in the packet is odd or even. If a fault happens the number of Ones or Zeros change and hence their odd and even situation. For example if the parity bit says the number of Ones is odd and what receiver reads has even number of Ones, there is a fault and receiver discards the data and waits for the next packet. You may say that two faults may happen and the parity may remain the same despite of the faults. That's true and if it can happen with a high probability then the error capturing method must be more sophisticated. But the probability of two faults happening is much less than one and in many systems a parity bit does the job. An example of a packet for key#1 would be like below:
When this packet is transferred in serial it will look something like below:
Modulation After the code generation, the code goes to a modulator. This step is also inside the processor. In simple words, a modulator takes the data to be transferred and changes it into a signal that is suitable for transmission on a specific transmission channel (here air). Let's assume we use ASK (Amplitude Shift Keying) as our modulation. ASK is the digital form of AM (Amplitude Modulation) that we all use in our AM/FM radios. First we need to choose a carrier frequency. A carrier is a constant frequency that mixes with the data and carries the data to the receiver. The importance of a carrier is its fixed known frequency that can be filtered out. Therefore after the filtering the receiver only hears that carrier and no other interfering environmental noise. The carrier frequency is the highest frequency that our transmitter, the infrared LED, must also be able to generate. Therefore it is important to know what is the fastest response time of the LED, which should be available in its datasheet. Also the packet bit rate and the carrier frequency must be far different. Let's say if the bit rate is 1KHz, the carrier is better to be over 10KHz. In ASK modulation we provide different signal amplitudes for the carrier and these different levels each represent a specific digital level. For binary we simply use one level for a digital One and another for digital Zero. For example we use a high level of carrier amplitude for digital one and zero or no carrier for digital zero. Therefore our packet after modulation will look similar to below:
Power Amplifier the processor outputs are usually not capable of driving high powers to the LED. Therefore there should be an external amplifier for this purpose. Why do we need an amplifier? Simply because if we generate more power out of the LED, we increase the reception distance between the transmitter and the receiver because the signal is still high enough in further distances to be read correctly. The maximum power is limited by the LED itself. LEDs can tolerate a specific maximum continuous power and in your design you should keep a safe margin to that power to increase the life time of the LED. The maximum power can be small. But there are ways to increase the power of the LED, and that is you provide a very high power for a short period of time. When we average the power over time, this average must be lower than the maximum continuous power of the LED. Let's do the math: Assume the above method of modulation. We know that our LED will blink On and Off only with the carrier frequency. If in the worst case we assume that our number of digital Ones in the packet is 10, the bit rate is 1KHz and the carrier frequency is 10KHz we have the following data: - Bit rate = 1KHz, therefore bit period is 1ms which for 10 digital Ones it will be 10ms. With the above information, if for example the LED can have a continuous power of 50mW, we can drive a maximum power of 50mW/1.5% = 3.3W every time the LED turns on for a short period of time!! This is a very large power to pass through the LED! Well this is the theory but you have to consider the maximum pulse current allowable though the LED as well. This is a very good way to increase the transmit power. You can calculate the current you need through your LED to achieve this power and design the power driver circuit. The driver circuit can be a simple one as below:
A FET transistor is used as a switch to turn on the LED. It is good because virtually it doesn't need input current and therefore input power to turn on, but note that in higher frequencies the input parasitic capacitances of the transistor draw some current and slow down the switching speed. The resistor in series with the LED is to limit the current to the desired value. Receiver Receiver Biasing Circuit The infrared receiver is a kind of diode that is sensitive to light and is usually filtered for the infrared light. There are light sensors that are not diodes as well, but the structure of the fast response time sensors is usually similar to a diode. The light sensor works such that its resistance changes by the level of light. If you simply put a resistor in series of a sensor and bias the circuit with a voltage and measure the voltage across the sensor, you will see that the voltage changes by different levels of light. There is an issue with the sensor though, it is sensitive to any light more or less. When you turn on or off the room light it will effect the receiver, or even worse the 50 or 60Hz of the house power will actually make the lights to flicker with twice the frequency, 100 and 120Hz. Of course it is not visible to a human eye but the sensor can easily pick it up. You may ask why do they flicker by twice the frequency, because no matter if the voltage is at its positive peak or the negative peak, the light has it's higher brightness and it is only minimum when the voltage is zero. The best bias voltage for the receiver is somewhere close to the middle of the circuit power rails, let's say in the middle of the so called VCC and Ground. If the biasing voltage is close to one of the power rails the resulted signal will be smaller. The circuit below helps to keep the biasing in the middle for any variations in the room light:
You can see that the sensor is reverse biased. A diode in reverse bias doesn't pass current through and shows a very high resistance. That's what this sensor does when there is no light. But when there is light the reverse biased diode starts showing less resistance and more current can go through. The OpAmp provides a negative feedback that keeps the voltage of the sensor equal to the voltage provided to its negative input with a resistor divider. The feedback is connected to the positive input of the OpAmp because the transistor at its output inverts the signal. The combination of the feedback resistor Rf and the capacitor Cf provides a low pass filter. This filter must be adjusted so that it passes the low frequencies below 200Hz which come from the room lights. This way the OpAmp and its negative feedback can act upon these frequencies and force the Vout not to be effected by these noises. But the carrier frequency which is much higher is filtered and can't reach the positive input of the OpAmp. Therefore you see that the OpAmp only cancels the low frequencies through it's feedback and lets the carrier frequency to pass to Vout and to the next circuit. Filter and Amplifier The filter and the low noise amplifier can be designed together. A filter is a frequency selective circuit that here is designed to filter out any unwanted frequencies other than the carrier frequency. This helps a lot to clean the signal from noise and makes it much more easier for the circuit to interpret the signal. The filter used here is an active filter using an OpAmp as shown below:
If the resistors and capacitors of this circuit is adjusted properly, it can sharply filter the carrier frequency to the output and clean it of any other noise in other frequencies, while also amplifying the weak signal received by the receiver. The output of the circuit should look something similar to below which is the same modulated signal transmitted to the receiver without the DC component.
De-Modulator Now it is time to extract the bits from the modulated signal and discard the carrier. For ASK modulation it can be done easily by using an amplitude follower or an envelope detector circuit. This circuit is shown below:
The capacitor and the resistor are adjusted such that they pass the bits easily but filter the carrier out. Now the serial bits are ready and if their level is not high enough it maybe a good idea to pass them though an extra amplifier or comparator to shape the signal. Otherwise they can go straight to the processor/controller. Processor The processor or controller IC simply reads the input continuously. If there is a transition in the input it will check the next bits to see if they match the header of the packet. If they do then it will read the rest as the data and acts upon its program to control any device connected to it. The processor/controller is a whole other course to learn and I leave it up to you. A processor is slightly different than a controller as they are used for different purposes. For controlling purposes that less processing is required such as the remote here, controller ICs are used such as the 80x51 controller family. This chips have very limited memory inside, which often is enough for the purpose they are used. The designer should write a program and load it into the IC which afterwards it will behave as it is programmed to. It is very fun to work with the controllers and you can see how easily they can replace circuits that would be so large and expensive if designed with discrete digital circuits. So go to a library and take a book on controllers/processors and start learning!
|
||||||||||||
Please feel free to forward your comments to: info@designcabana.com |