Dick Cappels' project pages http://www.projects.cappels.org

return to HOME

RS-232 to 100 MHz RF desktop channel adapter

The only thing leaving the box besides RF is
the RS-232 cable, exiting to the right.

Notice: This section describes an experimental low power, low bandwidth data signaling system that operates at 100 MHz (In the FM broadcast band in the U.S.). Before operating a radio transmitter, find out what kind of transmitter operation, if any, is permitted in your locality. Radio transmitter operation is a serious legal matter. In the United States, operation of unlicensed intentional radiators is covered by Part 15 of Title 47 of the Code of Federal Regulations. This design can be readily adapted to different frequencies and different power levels. If you choose to build and operate the transmitter described here, you do so at your own risk. I'm only publishing this as an example of what can be done, and to show how easy it is to build a simple but functional receiver.

AVR Studio assembler source code 2jun2002version.asm
AVR Studio hex file 232lin.hex

This is an adapter that allows a terminal to communicate via a 100 MHz data channel with peripherals on the same desk top. Keystrokes from the terminal are are received through the RS-232 connection and sent through the 100 MHz RF data channel. See the page, Digital Wireless for the Desktop, on this site, for the basics of the transmitter, receiver, and data format. The reason I made this was to make a simple method of switching between instruments on my desktop. I was staring to accumulate a number of microcontroller-based devices that I want to be able to switch my computer among quickly and this provided the simplest desktop networking solution I could think of.

Any data received over the 100 MHz RF data channel addressed to the terminal is decoded and sent to the terminal. The transmit and receive address of the terminal is set by the user and stored in EEPROM. The address field has a range of 0..7, and the transmit and receive address can be changed by entering an escape sequence. The sequence{<ESC>,T,3}, for example, sets the transmit address to 3. This flexibility allows the terminal to "connect" on any of multiple devices on the desktop by merely entering the appropriate escape sequence. It is planned that most devices will be test instruments and will speak only when spoken to (that is, in response to a request), and that they will all send data to the terminal. This simplifies things a lot because only the transmit address will have to be changed.


A frequency meter, based on the AT90S2313 frequency meter and pulse generator described 
elsewhere on this website was chosen as the first desktop instrument to control over this link.
Here is a description of the Frequency Meter with RF Data Channel.



All transmission and reception occurs at 100 MHz, which means that communications are simplex only. RS-232 is 9600 baud. No need to go faster since the RF data rate is quite a bit slower. Note that at boot time the microcontroller fetches the send and receive addresses from EEPROM, so the first time it is run, the addresses will be garbage until they are set from the keyboard, unless you write the EEPROM while programming the chip. This part is left as an exercise for the student.

The code described here is written for an Atmel AT90S2313. I decided to use the '2313 because it has a hardware UART and RAM for a nice deep stack, so I didn't have to worry about stack usage. The hardware UART made it possible for the microcomputer to both poll the UART and check for incoming data over the RF link frequently enough to avoid loosing data. The RF data channel format is bit-banged and occupies much of the CPU's time.

Here is the RS-232 to RF adapter assembly code . For convenience, here is the Intel hex file.


Schematic diagram of the RS-232 to 100 MHz desktop data channel adapter.
Click on image to see full size schematic (8k GIF).

The transmitter and receiver are those described in the Digital Wireless for the Desktop pages on this site. In this particular instance, I didn't have any 22uf capacitors, so the input bias and decoupling capacitor is 100 uf. This is unfortunate because it will slow down receiver recovery from overload. Since the transmitter operates at 100 MHz, the signals are in the middle of the FM broadcast band, and even though the signals are of short duration, you need to be careful about causing interference to this service.

The RS-232 Interco was borrowed from Atmel's AVR910 application note.

The power supply is a rechargeable NiMh 8.4 volt transistor radio battery. The battery is connected to a 7805 voltage regulator when negative voltage from the RS-232 input is detected, thus there is on on/off switch as the adapter turns it self on whenever it is connected to a working terminal, and turns itself off whenever the terminal is off or disconnected. This makes the period between battery charging longer. This also makes for a very easy to connect peripheral -just connect the RS-232 connector and start using it.

Circuit Assembly and Construction.(Also read the relevant sections of Digital Wireless for the Desktop pages on this site.)

All the circuitry was built on prepunched phenolic with pre-etched donuts around each hole, and the components connected point-to-point. Placement of components was carefully selected so as to minimize the use of jumper wires - for the most part, connections are made by bending the component leads over to the leads of the components they need to connect to, and soldered in place. This method of wiring results in a compact assembly with a minimum of parasitic to make the circuit less predictable. If you can make this on a ground plane printed circuit board, it might even have better performance, but make sure to clear the ground plane away from under the inductors. The loading effect, particularly on the transmitter's coil, will reduce the range.

The ICs are socketed. A six pin ISP connector was added because you just never know when you might want to improve the firmware. Besides, this particular AT90S2313 had had a hard life (this is its third project) and one of its pins is about to fall off, so it won't be going in an out the socket anymore.

The coils for the transmitter and receiver were wound on a 3 mm diameter bamboo satay stick using 24 gauge vinyl insulate solid copper wire. The insulation was stripped and the coils slipped off the stick and installed in the circuit.

Housed in a pencil box, this project approaches my ideal of no I/O connections.


There are two adjustments on this board. The coils for the transmitter and receiver need to be stretched or otherwise deformed to tune it to 100 MHz. Using an FM broadcast receiver turned to 100 MHz, adjust the transmitter first. The receiver can then be adjusted using a transmitter as a signal source. Adjustment of the coils is quite critical, so use a pair of small (or pointy) dieletric instruments (in this case, I used two bamboo sticks, one with a sharp point, and the other carved to resemble a screwdriver blade. Find out where the transmitter is transmitting by tuning around the FM band. Once you find it, you can increase the transmitter's frequency by stretch in the coil, and lower the frequency by compressing the coil. Patiently stretch and squeeze the coil until it is tuned to 100 MHz.

As for tuning the receiver, the quickest and easiest method is to use an oscilloscope to monitor the output of the first op amp in the receiver (pin 1 in the schematic on this page) and tune for the most negative peak of the data signal from the transmitter. Lacking an oscilloscope, a peak detector like the one featured on this site (See Precision Audio Frequency Peak Detection Probe on this site) can be used to monitor the most negative peak. A reasonable substitute for this purpose can be built by connecting a PNP emitter follower to the output of the first op amp (where the signal is still analog), grounding the collector, and use a 100K resistor from the emitter to the positive power supply and a 10 uf capacitor from the emitter to ground. This makes a negative peak detector for signals above ground. Monitor the voltage across the capacitor with a high impedance voltmeter set to 2 volts full scale and patiently tune for the lowest output voltage. You might have to reposition the transmitter with respect to the receiver as you get the receiver tuned in so as to have a large enough signal to observe on the meter but so large that it makes the receiver clip the signal. I tried this and found it to work very well. Capacitively coupling a high impedance earphone to the op amp's output also helps to get the receive into the right range quickly (tune for loudest signal on the earphone then fine tune using the meter.)

There is some art to doing the actual tuning, like returning your hands and arms to the same position and keeping them very still after each adjustment while you wait for the circuit to settle so you can see the result of the adjustment. Be patient and also be aware that if you change the coil too much at one time, you might go past the point of optimum tuning and you may have to compress the coil and back up a bit. If you don't mind putting in the extra parts, a variable capacitor or voltage variable capacitor would make this a lot easier.

Note that you will have to use a clip lead or jumper to keep power on the circuit while tuning it up, unless you happen to have the RS-232 connector plugged into a computer.

You can also tune up the receiver without any kind of tuning meter, but it takes a lot more patience. Operate a transmitter continuously. Position the receiver near the transmitter and adjust the coil in the receiver until the signal is decoded by the receiver. Then, move the receiver further away until the decoder stops working and retune until it starts working again. Continue until no further improvement can be found. This is tedious but it saves the expense of a trimmer capacitor on each board -and that is an alternative.



The receiver in this interface has disappointing sensitivity. I think this poor showing compared with other devices has to do with RF noise from the USB-to-RS-232 adapter. The receiver becomes much noisier when connected to the computer. I am puzzled by this since the field strength of the signals at 100 MHz from the adapter should be very low in order to FCC, CE and Japanese EMI marks. Also, I have noted that the receiver's range is greater when the antenna is more or less vertical, instead of tucked down inside the box, which is intuitive.

Making the 22 uf capacitor that bypasses the bottom of the detector's resonant circuit larger can increase sensitivity at the expense of increased overload recovery time. Bypassing this with a good high frequency bypass capacitor, such as a .001 uf ceramic (NOT Z5U type) should help decrease interference from out of band signals and also improve the sensitivity by increasing the RF base current.

This would be better if it had a low battery level warning which alerted the terminal whenever the battery voltage dropped below some threshold. Using a 90S2313 all that would be needed hardware-wise would be a voltage divider and a voltage reference of some sort. Checking the battery voltage could be done in the polling routine between checking for incoming Rf signals and inclining characters from the UART.

The power management circuit might be better if it were made to turn on whenever a character is received from the terminal and time out after some period of time, rather than turning the interface on whenever a terminal is connected. By the way, this interface draws about 13 milliamps while not actively sending data.


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. www.projects.cappels.org/