Dick Cappels' project pages

HOME

 
TRF VHF WIRELESS DATA RECEIVER
     

Downloads
decoder code
REMEMBER TO SELECT THE EXTERNAL CRYSTAL OSCILLATOR WHEN PROGRAMMING.),


 The circuit:

This receiver is little more than a crystal set with gain. Operating voltage range spans 3V to 5 V. The one on my bench runs down below 2.5 V.

 Why TRF? The beauty of this approach lies in its simplicity and lack of critical components. A transistor is used as an RF detector/amplifier, with the emitter and collector at AC ground (no such thing as Miller capacitance here!). All the gain occurs at baseband, and most of that gain occurs in a very inexpensive but good dual op amp. If the LC resonant frequency is pretty close to the transmitter's frequency, it will work.

Many different microcontrollers can be used as the decoder, including the Atmel AT90S2323, AT90S2313, AT90S1200, and ATtiny12 because as the code is written, it only uses one subroutine call and no interrupts. In the breadboard, the receiver was tuned to about 55 MHz.

 How it works: Starting with the antenna and going straight through to the indicator LED on the output:

This receiver is intended to be operated within one wavelength of the transmitter, so the antenna really isn't so much an antenna as it is a capacitive coupling to the transmitter's antenna. In this case, there is no ideal tuned length for the antenna -the longer it is (within reason) the more range you're going to get. I was able to get about 5 meters in my garage with only about a 10 cm length of wire. The other half of the antenna system which is necessary for coupling the t transmitter's signals to the receiver is the ground. In the case of this receiver, it can be either the capacitance from the circuit to the hand of the person holding it, and that person's capacitance to ground (often a couple thousand picofarads, almost a dead short at VHF and higher frequencies. If it is mounted in an instrument connected to a lot of cables or even the power lines, so much the better. The least sensitive case would be to have the receiver suspend in the air, or mounted on a tiny vehicle since in this case there would be only a small coupling to ground along with the already small coupling to the radiating antenna.

The antenna capacitively couples electric fields from the transmitter into a resonant circuit made of the inductor, the 15 pf capacitor, and the shunt capacitance of the base of the transistor and the antenna itself. When signals at the same frequency as the input filter is resonant at are coupled into the resonant circuit comparatively large voltages (tens of micro volts) are developed across the resonant circuit.

The voltages appearing across the resonant circuit is demodulated by the transistor and the RC filter on its output. The transistor is a self-baised amplitude modulation detector. The collector voltage is maintained at just high enough of a voltage to keep the transistor biased on. As such, the collector voltage is about 1 volt. In this implementation, bias is supplied by a diode, though it would work just as well if the diode was replaced with a large resistor. The only advantage to using a diode is that the circuit settles much quicker when power is switched on. The transistor, in conjunction with the collector load resistor forms a nonlinear amplifier and the low pass filter that results from putting the 470 pf capacitor to ground when the load resistor is 39K averages the collector current. When there is a RF signal present, the collector draws more current than when there isn't an RF signal present, thus, the voltage on the transistor's collector has negative-going pulses on it when RF pulses are transmitted. The time constant of the collector filter, by the way, is 18 microseconds, which is fast enough to support a 9600 bit per second transmission channel.

The transistor detector is followed by an amplifier with a gain of about 100X. This gain is flat from the highest frequency of interest down to about 1.6 Hz, below which, its gain rolls off towards unity at DC. This connection of the op amp allows high AC gain while allowing simplified biasing from the single power supply. A second op amp, contained in the same package as the first op amp, acts as a comparator, comparing the pulses on the output of the first op amp with the average DC level on the 100 uf capacitor. Note that this capacitor can be made smaller to speed up setting time in cases where the receiver is switched off and on to conserve battery life. The comparator slices the incoming signal, which is from several millivolts to tens of millivolts in amplitude, into a digital signal suitable for driving an input port on the AVR microcontroller. One could use the comparator on the AVR controller, but dual op amps are not expensive, the analog performance of the comparator is better characterized, and having the comparator external makes trouble shooting a little easier since the quality of the digital signal can be directly observed via oscilloscope.

The Decoder.

The decoder is all in the firmware. In operation it is pretty simple. See the data format description elsewhere in the pages. Data is pulse frequency encoded, so the the decoder measures the time between positive-going edges in the incoming signal to determine whether a "1" or a "0" was received. When enough pulses are successfully received to fit within the data format, then the two byes that are received in the process are used to determine what to do.

In the example code (The assembly listing for the decoder code is here.-REMEMBER TO SELECT THE EXTERNAL CRYSTAL OSCILLATOR WHEN PROGRAMMING.), if the device address is 1 and the data type is 0, then the record is interpreted further. If the data bye in the record has a value of $A5, the signal on PORTB, bit 1 is low. If the data byte is any other value, the signal on PORTB, bit 1 is set high.

When a positive going edge is detected, the microcontroller qualifies the signal based on the time until the next positive edge. If its too short, the message reception is started over, beginning with looking for the run in code. If the cycle is too long to be a qualified fast cycle (a "1"), but too short too be a qualified slow cycle (a "0") or is too long to be a qualified long cycle, the reception is started over.

This qualification can be observed on PORTB, bit 0. whenever the receiver seen a positive edge on the incoming signal on PORTB, bit 2. it takes PORTB, bit 0 low for the duration of the processing of that signal. By observing PORTB, bit 0 with an oscilloscope, it can be seen that the microcontroller spends a lot of time responding to noise, but it usually determines its noise and stops processing it within a few milliseconds.

The hedder and byte recive routines are straight line code to minmize the use of registers and the stack. it should be apparent how to redcue the number of bytes by using loops or even adding a "Get Byte" subroutine. These changes can be easily made once the rest of the controller's requiremens have been determined.

This is probably a good place to note that an alternative method of measuring cycle time, that of using the external interrupt to detect transition and the internal timer to measure the times, was considered and would be a good choice for a controller that had to perform multitasking.

Adjustment

The breadboard works at about 55 MHz using an inductor of about 8 turns of about 5 mm in diameter. The turns are spread or squeezed to give the best tuning, which can be easily observed by watching pin 1 of the op amp with an oscilloscope, of it you don't have that, by tweaking the coil to get the best range. A little more tedious process. be sure to use a nonconductive tool to move the coil loops around. A plastic toothpick would be ideal. I use a plastic alignment tool that only has a tiny metal blade, and it seems to work well enough for what I'm doing. This is the only adjustment to the circuit. See below for a way to eliminate this adjustment.

Variations

This can work over a wide range of frequencies, it in merely necessary to change the resonant frequency of the input circuit. I have not experimented to determine the practical upper limit, but I suspect it is several hundred megahertz and this upper limit will depend heavily upon the components being used and as the RF frequency increases, layout will be come more crucial. Both the capacitor and inductor can be changed to change the received frequency. it might be necessary to use a transistor with lower base capacitance, or to modify the DC feedback to obtain a higher collector voltage, thus reducing base-collector capacitance.

Receiver sensitivity can be improved by connecting the base of the transistor to a tap on the inductor about 1/3 of the way from the bottom so as to drive the base with little lower impedance. Also, to improve the Q of the circuit, the detector transistor can be made into a darlington. When I tried this, I tied the collector fo the first transistor in the darlington pair to V+.

Notice that the lower end of the LC circuit is decoupled to ground using a 22 uf electrolytic capacitor. This is a normally considered poor design practice as the effectiveness of the resonant circuit will be greatly affected by the characteristics of this capacitor because electrolytic capacitors tend to look more like inductors than capacitors at high frequencies. The net effect is that there will be fairly poor selectivity and some loss of sensitivity because of this. If, for some reason you want better frequency selectivitiy or more sensitivity, it would probably help to add a small ceramic capacitor (like 1000 pf) in parallel with the 22 uf capacitor. I got away with using only an electrolytic because I can accept the performance obtained with only an electrolytic capacitor, I only had to make a few of these work (this is NOT a production design), and I don't have to please anybody but myself. Your needs may be different.

If you have a power sensitive application, you can cycle the power. In this case, circuit settling time can be improved by reducing the 22 uf and the 100 uf capacitors. The 100 uf bypass capacitor allow operation from crummy batteries that have a high impedance. Without this capacitor, I have seen the output of the op amp oscillate, which ultimately reduces receiver sensitivity. Another way to reduce power is to use a micro power op amp. The LM358 draws 500 micro amps. Compare that with the LHC6022 from National Semiconductor, which draws less than 100 micro amps. Since the bandwidth of the detector is much greater than is necessary for the slow data rate, power can be further reduced by increasing the 39 k resistor. To pass the 638 Hz signal used here, the 39 k resistor might be able to go as high as 470k -be sure an check timing margins if you do increase the collector resistor.

The only adjustment the tuned circuit on the input, can be replaced with a resistor. Simply remove the 15 pf capacitor and the inductor and put a large (say 47 k to 200 k resistor) in its place. The drawback is that the detector will then respond to signals all over the spectrum, including broadcast stations. it does eliminate the only adjustment in the receiver, but the net result is a reduction in sensitivity.

 

 HOME

Use of information presented on this page is for personal, nonprofit educational
and noncommercial use only. This material (including object files) is copyrighted
by Richard Cappels and may not be republished or used directly for commercial
purposes without explicit permission For commercial license,
click HERE.

Please see the liability disclaimer on the HOME page.

Contents ©2002 Richard Cappels All Rights Reserved. http://projects.cappels.org/