
However, if we use a relatively wide lead-in pulse as a sync or STX indicator, the pulse does two things. It resets the AGC and ATC based on the signal strength and it signals the start of a transmission. We can measure the amplitude of the pulse at point A and measure the amplitude of the space at point B. The difference, A-B, indicates modulation depth and is a good proxy for Received Signal Strength Indicator (RSSI).
A frequent suggestion is to use RS232 and train the receiver with a preamble consisting of several $55 (01010101 binary) which is roughly equivalent to the closely spaced pulses at point C above. The problem with this approach is that it is hard to detect the 01010101s emerging out of the normal noise. See the screenshot at the bottom of the page in the RF Noise vs. Signal page. It is simpler and more reliable to look for a wide lead-in pulse and use something like the NEC protocol which incorporates error detection. Here is an example of simple transmit and receive routines using 8-pin PICs and PicBasicPro. If you have a lot of data to transmit, you can combine the wide lead-in pulse with RS232 strings although you will have to devise your own error detection - Manchester encoding is one method.
The linear output is input to a data slicer circuit like the one shown below. The capacitor, C1, will charge to the average signal strength. When the signal is above the average, the output is +5V. When the signal is below the average, the output is 0V. The result is the clean digital signal shown below the data slicer.
Closely spaced data pulses will raise the charge on C1 which will raise the threshold, decreasing sensitivity. Widely spaced data pulses will lower the charge on C1 which will lower the threshold, increasing sensitivity. The data pulses at C are the same width as the spaces with the average being equal to 1/2 the pulse amplitude. At D, the pulse widths are 1/3 the width of the spaces and the average is 1/4 of the pulse amplitude. It is desirable to have DC balance with pulses and spaces approximately equal over a relatively short time range. This prevents biasing the threshold towards either high or low sensitivity.


The NEC protocol, a variation of which is used by X-10, sends each data byte twice in bitwise complementary form. Each 1-bit in the first byte of the pair becomes a 0-bit in the second and each 0-bit in the first becomes a 1-bit in the second. This maintains DC balance over over the span of each data/complement byte pair. This also provides built-in error detection as the byte pairs equal zero when bitwise ANDed or 0xFF when summed or bitwise XORed. (e.g. A=%10101010, B=%01010101, A & B = 0, A + B = 0xFF, A ! B = 0xFF)

Copyright: No part may be reproduced except as authorized by written permission. This restriction extends to reproduction in all media.