How Encoders and Decoders work
The radio frequency spectrum is filled with noise and other
signals, especially those frequencies where unlicensed transmitter operation under FCC
part 15 rules is allowed. When using a wireless remote control system it is desirable to
have a way of filtering out or ignoring those unwanted signals to prevent false data from
One way to accomplish this is to use microprocessors at the
transmitter and receiver that are programmed with error detection and correction
algorithms something like those used in modems. A much simpler way is to use an encoder IC
at the transmitter and a decoder IC at the receiver. These ICs automatically generate and
decode multiple serial codes that must match before data is accepted as valid.
In the early days of "radio control", before these
coding ICs were available, radio controlled garage doors sometimes opened themselves when
they received transmissions from a plane passing overhead or a two-way radio operating in
the area. Encoding and decoding is now used in most wireless control systems to prevent
this type of interference and to provide security.
and decoding ICs are made by Motorola, Glolab
and others. We will
use the Glolab ED4GP encoder/decoder as an example of how these devices work.
The ED4GP can be used as an encoder by connecting pin 3
to ground (VSS) or as a decoder by connecting pin 3 to +5 volts (VDD).
The ED4GP has pin 3 connected to ground (VSS) to make
it function as an encoder.
The transmitter module is a Glolab
TM1V. D1 is a 1N914
diode for reverse polarity protection, IC2 is a Glolab VR5L micropower 5
volt regulator, CR4 is a 4 MHz ceramic resonator and C1 is a 0.1 microfarad
metalized film or ceramic capacitor. That's all you need except for a 6.7
inch long (1/4 wavelength) antenna wire and a 9 volt battery.
The ED4GP is available in
an18 pin DIP package. In addition to encoding and
decoding functions, these devices have four data channels.
All address and data inputs are pulled up to VDD by 200
microampere internal current sources so they can be left open if not used.
The ED4GP encoder has
4 address pins 6, 7, 8 and
can be left open or connected to
pulldown pin 2. This gives
addresses that you can program. If you don't want to select any address you can just leave
all 4 pins open. In addition to providing security the reason for using addresses is
so you can have several transmitters and receivers close together and control which
receiver responds to a transmission.
Upon being triggered by pulling any data input pin 10,11,12 or 13
low level (ground), the encoder automatically generates and serially sends
at least two groups of pulses containing address and data information from data out pin
18 to a transmit circuit or module. Each group repeats the same address and data
information. If any input is held at a
low level, transmission of the groups will continue
to repeat as long as it is held low.
When no data input is low (not
transmitting) the ED4GP goes into a low power sleep mode and draws less than
1 microampere of current from the power source. When one or more data inputs
are pulled low the ED4GP wakes up and draws about 3.5 milliamperes while
functioning. Pulldown pin 2 in the encoder and pin 10 in the decoder go high
when in sleep mode to prevent current draw from the address pins.
The ED4GP has pin 3 connected to +5 volts (VDD) to
make it function as a decoder.
The receiver module is a Glolab
RM1V. CR4 is a 4 MHz
ceramic resonator, IC2 is a 7805 voltage regulator and C1, C2 are 0.1
microfarad metalized film or ceramic capacitors.
The ED4GP decoder must have its address pins configured the same as the address
pins in the ED4GP encoder of a transmitter
in order to receive data from that transmitter. All
address pins in both a transmitter and receiver can be left floating.
If address selection is used the address pins should be
connected to pulldown pin 10. When the decoder
receives serial data into input pin 11 from a receiver circuit or module, it compares the
groups of address and data pulses. If two of the groups are the same,
the data is considered valid and is transferred to output pins 1
,2,17 and 18.
The data that appears at the
receiver output pins will be an inverted version
of the data that is applied to the transmitter inputs.
When a transmitter input is pulled low its corresponding receiver output
will go high. You can use these outputs to
drive individual circuits or devices, or since there are four pins you can send four bits
of information in binary format to represent a decimal count of 0 to 15.
Outputs can be momentary by leaving
pin 12 open or sequentially latched by connecting pin 12 to pulldown pin 10. In momentary mode, data remains on the output
pins only as long as data is being received. When any valid data is detected a
momentary valid transmit (VT) pin 13 goes
high only as long as valid data is being received.
The receiver uses a 7805 voltage
regulator that has an internal voltage drop of 2 volts but will accept an
input voltage up to 35 volts so it can be powered by a battery or a 9 or 12
volt wall transformer.
These devices do not provide error correction. They just accept
valid data and reject corrupted data. This means that a control signal that is corrupted
will not be received and must be sent again. This is usually not a problem when push
buttons are used as inputs since a large number of repetitive data bytes will be sent
before the button is released.
The encoder and decoder described above are simple to use and need
only one external ceramic resonator for the
internal oscillator. They can send and receive up to four bits of data
simultaneously. Data rate is 5000 bits per second.
Please read Characteristics of a
wireless system for more about data transmission and addressing.
MAKE YOUR NEXT PROJECT WIRELESS