wireless tx and rx modules
Post on 20-Jul-2016
18 Views
Preview:
TRANSCRIPT
Page 1 Copyright 2005 e-Gizmo Mechatronix Central
You always wanted wireless control of your project with a PC. e-Gizmo now brings you your buildingblock module-
8/16-bit RF Wireless Remote Output that you can control using your PC!
Designed and Written by Henry Chua
I met a lot of students and enthusi-asts who build or are trying to buildgadgets that they hope can be re-motely controlled by RF (Radio Fre-quency). Because of the unavailabil-ity of any locally-built RF remote cir-cuit boards, the moneyed ones sim-ply purchase this stuff from overseassuppliers, spending 12,000 pesos,perhaps a bit more.
Others resort to buying RC (RadioControlled) cars, tearing it apart, tak-ing only the much needed RF remoteparts. A cheap RC car with two outputfunctions can cost as little as 600 pe-sos. This seems to be attractive enough to jump intothis solution, except that:
• Unless you are an experienced electronics geek, find-ing the correct output and matching it with your circuitcan be very tricky.
• Most R/C toys operate on 27MHz to 49MHz frequen-cies. If you are planning to use a microcontroller or mi-croprocessor with your wireless, then you have a prob-lem. As those who already tried this found out,microcontroller circuits generate all sorts of RF noiseinterference within these frequency bands. This severelyaffects the reception ability of the receiver circuit, re-ducing the control distance range to only a couple ofmeter or so. Of course, a wireless controlling distancewithin your arm's reach will not look impressive at all.
Our wireless kit is designed to be free from these prob-lems. It operates at 433MHz unlicensed ISM (IndustrialScientific Medical) frequency, far from the interfering sig-nal frequencies coming out of your microcontroller cir-cuits. It is easy to use, fully documented. All available
Typical Performance
Frequency: 433MHz nominal430-439 MHz
Transmitter Side:
Output Power:0dBm (1mW)
Harmonics:2nd < -15dB3rd up < -25db
Receiver Side:
Sensitivity:8uV @ 2.4Khz 80%mod
RF Bandwidth (-6db):2.4 MHz typ
Adjacent Frequency Rejection fo +/- 5MHz:- 55dB
Control Distance:> 100ft in open space
Copyright 2005 by e-Gizmo Mechatronix CentralAll rights reserved.
No part of this publication may be reproduced in any form without the written consent of e-Gizmo Mechatronix. Content subject to change without prior notice.All informations contained herein are believed to be correct and reliable.
Before using this document, you must agree with the following terms and conditions:1. e-Gizmo Mechatronix and the author cannot be held liable for any damage that may occur with the use or misuse of any information contained in this document.
2. You are allowed to reproduce this publication and the product it describes for personal use only. Commercial reproduction is prohibited!
8/16-bit Wireless Remote Output Page 2
Figure 1. Complete schematic diagram of the transmitter unit.
Power to the transmitter is directly drawn from the RS-232C lines. With pin 4 (DTR) output permanently stay-ing at the V+ side, the transmitter can be switched ONand OFF through pin 3's (TX) output of the serial port.In other words, the serial data output itself turns ONand OFF the transmitter, effecting a Amplitude Modu-lated system. D1 keeps the voltage to the transmitterfrom exceeding 5.1V, at the same time, limits the volt-
Figure 2. The receiver circuit functional block diagram
I/Os are fully explained with some interfacing examples.The transmitters plugs into one of your PC serial comport. It is Visual Basic friendly, 10 lines of code is enoughto operate it.
CIRCUIT EXPLAINED
The wireless kit consists of two subsystems, the trans-mitter circuit, and the receiver/decoder circuit.
The circuit schematic of the transmitter is shown on Fig.1. The circuit is remarkably simple, thanks to the RFmodule UC1817. I used this module because (aftersome modification) of its good frequency stability overtemperature and time, although it contains no saw filtercomponent at all. Of course, a 433 MHz saw filter-stabi-lized oscillator circuit would give much better frequencystability, but you'll need a load of luck to find one in thelocal hobby market.
J2
CON1
1
JDR1
CONN DSUB 9-R
59
48
37
26
1
59
48
37
26
1J3
CON6
123456
R2
R1 J1
CON6
123456
D1
5V1
age to -0.6V in case pin 4's output suddenly decides togo negative.
The receiver circuit is a bit more complicated, it will makemore sense if we describe the circuit in its block dia-gram form as shown in Figure 2. The complete sche-matic of the receiver is shown on Figure 2a on page 3.
Page 3 Copyright 2005 e-Gizmo Mechatronix Central
R1
5k6
C10
R7
R11
C4
1pF
C12
C3
1n
R3
15k
C16
+5
L1 CH
OK
E R
F
L2
+C
13
C1
0.5p
F
Y1
CR
YS
TAL
C17
C
J6 CO
N2
1 2
+C
9
R12
R17
C5
330p
F
C18
+V
Q1
NP
N B
CE
R6
R2
15k
J2 CO
N1
1
U3
L780
5/TO
220
1
2
3V
IN
GND
VO
UT
R15
D1
1N41
48
R4
56k
+C
14
J3 PH
ON
EJA
CK1 2 3
R10
R9
R13
R8
+C
8
+ -
U2B
LM35
8
5 67
+ -
U2A
LM35
8
3 21
8 4
C11
R5
R14
U1
Z86
E04
5
67
14
11 12 13 1 2 3 415 16 17 18
8 9 10
VCC
XTA
L2XT
AL1
/CE
GND
P00
/CLR
P01
/CLK
P02
/PG
M
P24
/D4
P25
/D5
P26
/D6
P27
/D7
P20
/D0
P21
/D1
P22
/D2
P23
/D3
P31
/OE
P32
/EP
MP
33/V
PP
C6
10n
+C
7
C2
330p
F
C15
CA
P
Fig
ure
2a. C
ompl
ete
sche
mat
ic d
iagr
am o
f the
Rec
eive
r Mod
ule.
8/16-bit Wireless Remote Output Page 4
We all know the function of the antenna; it grabs what-ever radio signal wanders in its reach. Because of itsfinite length, it favors radio signals with frequencies thatfalls within half wavelength, which, by design, is433MHz.
The receiver is more picky. It will work only on 433MHzsignals, totally ignoring all others. The very weak signalfrom the antenna is greatly amplified, at the same timedemodulated in this block, resulting in the recovereddata signal from the receiver output. The receiver blockconsists of components Q1, R1 to R4, C1 to C7, L1, L2and D1.
The recovered data signal however is still too weak andis mixed with all sorts of noise. The amplifier stageboosts the signal to a more usable level, using to itsadvantage its inability to amplify high frequency noise,thereby improving its signal to noise ratio. Then, thispreconditioned signal is fed to a pulse shaper wheredata signal is reconstructed into nice digital signals themicrocontroller can now understand. The amplifier cir-cuit consists of U2A and associated components, thepulse shaper is formed by U2B and associated partswired as Schmitt trigger.
The microcontroller then assembles the received datainto an 8-bit data format. As wireless transmission isvery prone to error due to unaccountable external influ-ences, extra bits are transmitted and received as a formof error checking. If everything matches the error-check-ing code, then the received data is fed to its 8-bit outputport. A successful data transmission is indicated by aflashing LED indicator in the receiver board. Data trans-mission format is discussed in detail in the Program-ming section. The microcontroller section is based on aZ86E02 microcontroller U1. U3 converts the DC supplyinput into a stable 5V source to supply the whole circuit.
ASSEMBLY INSTRUCTIONS
Part of the circuit, the receiver circuit in particular, worksat a very high RF frequency (UHF 433 MHz). The choiceof components becomes very important. At this fre-quency, the PCB layout becomes very much part of thecircuit. Each component is carefully laid out to minimizeunwanted interaction against each other. Merely repo-sitioning these components can have an astonishingeffect on the performance of the circuit. Many peoplewho do not understand this suspects that RF design isengineering mixed with witchcraft, or maybe the otherway around.
Figure 3. Component side of the receiver module.
Figure 4. Bottom side of the receiver module. Fourcomponents are soldered on this side; U1, U3, Q1, and
D1.
Receiver Board Assembly
Use a PCB layout pattern which is a faithful reproduc-tion of the pattern shown in the downloads. If you choosenot to, you may be buying yourself into trouble youmust be certain you know what you are doing.
Treat each component with reasonable care. The ICsare particularly susceptible to damage due to ESD (Elec-trostatic Discharge) and must be handled properly. Sol-dering workmanship is very important, this project mustbe built by a soldering iron master!
Recommended reading:
General PCB Assembly procedurewww.e-gizmo.com/ARTICLES/ProjectB/Assembly.htm
Page 5 Copyright 2005 e-Gizmo Mechatronix Central
Mount and solder the components in the following or-der : resistor, capacitors, coils, transistor, diode, ICs,and whatever component is left out of this list. Keep allcomponents lead as short as possible. Q1, U1, U3 andD1 are surface mount components - they are soldereddirectly on the copper side of the PCB.
Figure 5. Components with leads soldered on the compo-nent side.
1 - C18 2 - C15 3 - R14 4 - C12 5 - R13 6 - Crystal Can 7 - C16 8 - U2 pin 4 9 - C6 10 - R1
Form the antenna by cutting an AWG25 solid insulatedhook up wire 35cm long. Note that this length corre-sponds to the half wavelength of the 433MHz RF sig-nal. Making this wire any longer or shorter will not im-prove reception, in fact, it will do just the opposite. Oneproblem we noticed though is the antenna does not liketo be touched (i.e. hand effect). Grabbing the antennawith one hand will detune the receiver and can alto-gether stop reception. Swaying the antenna, will alsohave the same effect, although to a much lesser extent.
Figure 6. The receiver module antenna.
Double side layout is used for the receiver board, withthe component side copper used mainly as a groundplane. Some components must be soldered on the com-ponent side copper trace ( if the PCB you are using isnot a plated through hole type), these are shown andare listed as follows:
This phenomena is caused by insufficient isolation ofthe receiver's tuned circuit with the input port.
We can easily solve this problem by winding the baseportion of the antenna 8 turns around a 5mm diametertemporary form, forming it as shown in the picture be-low. Of course, this solution is a compromise, we dothis at the expense of reduced transmission distance.But still, the control distance goes more than 100 feet inan open field.
8/16-bit Wireless Remote Output Page 6
Transmitter Board Assembly
Building the transmitter board is a breeze! You only haveto solder a couple of resistor R1 and R2, a zener diodeD1, the transmitter module, a DB-9 female connector,
Figure 7a. Transmitter component side. Figure 7b. The RF module is soldered onthe copper side.
TEST and ALIGNMENT
EQUIPMENT NEEDED:
a) Personal Computer (PC) with microsoft Visual Basic6 software installed.b) Non metal screwdriver alignment tool.c) 9V Battery with Battery Snap.
Alignment Procedure:
1. Download and run the Visual Basic test program.
2. Install the transmitter to serial communication port1(com1) of your PC.
3. You will be moving around with the receiver moduleas you align it for the farthest control distance. Use a9V battery to temporarily power it while doing thealignment. Solder the battery snap red wire to the +pin of C14, with the black wire going to - pin of thesame capacitor.
4. Working close to your transmitter, tune coil L2 usingthe screwdriver alignment tool until the receiver LEDindicator D4 flashes. Hold the PCB module near the
and the antenna and its done. The antenna is formedout of solid AWG 16 tw wire cut to 35cm length.
data terminal connector J1 and keep your fingersaway from the high frequency receiver area as youdo the adjustments.
5. Keeping an eye on the LED, move farther away fromthe transmitter until the LED stops flashing.
6. Slowly readjust L2 until the LED flashes again.
7. Repeat steps 5 and 6 until no further improvementscan be obtained.
You should have moved at least 100 feet away (openspace) from the transmitter by the time the LED stopsflashing if L2 is properly adjusted. Final distance willvary considerably if you do the alignment indoors, but itshould not be less than 50 feet when obstructed withtwo concrete walls in between.
Page 7 Copyright 2005 e-Gizmo Mechatronix Central
USING THE WIRELESS SYSTEM
Wireless control is accomplished by sending a streamof data from the PC to the transmitter through the serialcommunications port (com1, com2,.. and so on). Theserial data is then picked-up from a remote location bythe receiver module and then reconstructed to appearas an 8 or 16 bit parallel data on its output.
But serial transfer cannot be reliably accomplished inwireless realm by simply throwing data all by itself. A lotof things could happen as signal travels through spacetowards the receiver side. And when these things hap-pens, it always leads to a erroneous data appearing onthe receiver side.
Obviously, we have to devise some way for the receiverto recognized whether the data it receives is intact orinvalid. We can easily do this by transmitting extra dataused mainly for error checking.
Communications Format
Aside from the 8-bit data of interest, we have to throwin two extra bytes of data preceding and succeedingthe 8 bit data. Let us call these extra bytes as the Headerand the Checksum. The communications format is thenmore clearly described as:
[Header] + [Data] + [Checksum]
This is a three byte transmission. Each data set en-closed with bracket is 8-bit wide.
Header - The header is used mainly to tell the receiverthat data transmission is started. This is a fixeddata with a valid hexadecimal value of 54(&H54 in Visual Basic format) or 55.
Data - This is the actual 8 bit data you are sending.
Checksum - 8-bit Sum of [Header] + [Data] (resultstruncated to 8 bits)
Upon reception, the receiver checks the integrity of theheader and proceeds to compute its own checksum andcompares it with the received checksum. If the checksummatches, a valid data reception is assumed and the 8-bit data is outputted on the receiver output port. Other-wise, if error is found in either header or checksum, thereceiver rejects the data set by ignoring it.
This data transmission scheme is very easy to imple-mented in Visual Basic. The downloadable test programsource code serves as a sample showing how to do it.
Output interfacing
All outputs are 5V TTL/CMOS compatible, and follow-ing the specifications of the IC, each output is capableof directly driving two TTL loads only. Do not connectany inductive load to the outputs directly, unless it isreally your intent to kill the IC U1. Examples of highlyinductive loads are solenoids, relays, and motors.
An output interfacing circuit example is shown in figure8. The transistor circuit allows on/off control of loadsand is capable of sinking up to 100mA. D1 is necessarywhen the load is inductive. It prevents the switch-off tran-sient of the load from frying Q1.
Figure 8. A switching transistor circuit should be used whendriving inductive loads, such as a relay.
8/16-bit Wireless Remote Output Page 8
MEASURED PERFORMANCE NOTES
Performance test setup:
View of the test bench and equipment used toevaluate the transmitter and receiver.
Instruments used:
- Advantest R3261C 9khz-2.6GHz SpectrumAnalyser.- Hewlett Packard HP8647A 1GHz RF SignalGenerator- Tektronix TDS754A 500MHz 2Gs/S DigitalOscilloscope- Tektronix 2465B 400MHz Analog Oscilloscope- Hewlett Packard HP6633A System PowerSupply- Wavetek model 166 50MHz Function andPulse Generator.
IF EIGHT IS NOT ENOUGH
Throw in a couple of 374s and connect them as shownin the figure below and you get a 16-bit output. You canuse 74LS374, or its HC and HCT equivalent. Power pinsconnections of the ICs (pin 10 - GND, pin 20 - Vcc) arenot shown in the schematic, but you should connectthem to the supply lines! For best results, add a 0.1uFmultilayer capacitor across the Vcc to GND lines clos-est to the ICs.
To output an 8 bit data on U1, use a hexadecimal &H54header value in the data communications (see Com-munications Format). To output an 8 bit data on U2,use a header value of &H55.
Figure 9. Adding a pair of 374 latchesallows you to control up to 16 outputs.
Page 9 Copyright 2005 e-Gizmo Mechatronix Central
Close up view of the receiver module under test.Tetronix probe P6137 were used.
To measure receiver sensitivity, the signal generatoroutput is reduced until noise starts to show up on the
digital pulse shaper output. The upper trace showsthe output of signal amplifier U2A (1V/div) while the
lower trace displays the pulse shaper output U2B. Ananalog oscilloscope is used to monitor the output so
that all high frequency noise and artifacts can beseen, something a digital oscilloscope is not good at.
Under the test criteria described above, and with thesignal generator externally modulated with a 2.4kHz
square wave signal at 80% modulation depth, thesignal generator reveals a respectable 18dBu (7.94
uV) receiver input sensitivity.
The 6dB RF bandwidth measured 2.7MHz, notimpressive actually, but it is not fair either to expect
more for this type of receiver circuit.
The measured RF bandwidth is much wider than weneed. We don't want excessive bandwidth because itmakes the receiver more susceptible to noise and in-terference. On the other hand, we could make use ofthis excessive bandwidth to our advantage. Remem-ber, our transmitter is not saw filter controlled, mean-
ing, the frequency can wander a bit. The excess re-ceiver bandwidth actually makes it tolerant to this kindof deficiency, ensuring a good data transmission evenif the transmitter frequency alignment stray by as muchas 1MHz.
8/16-bit Wireless Remote Output Page 10
Adjacent frequency rejection at +/- 5MHz and +/-10MHzfrequency were also measured. Results are as follows:
431.2MHz + 5MHz - 62dB431.2MHz - 5MHz - 58dB431.2MHz + 10MHz - 78dB431.2MHz - 10MHz - 65dB
The nominal operating voltage of the receiver is 9V.At this supply voltage, it consumes 18mA current
(0.162W). It will work with supply voltage as low as7V to as high as 16VDC.
The transmitter was evaluated using a spectrumanalyzer. The transmitter is both powered and
modulated by the model 166 function generatoroutput set at 20Vp-p 2.4KHz square wave. This test
condition is chosen to simulate the working condi-tion when it is finally connected to an RS-232 PC
communications port. A 20dB attenuator is used atthe analyzer input to prevent input overloading.
The picture on the right shows the resulting tracescan at 100kHz span.
Antenna hand effect was also measured and turnedout to be less than 30KHz.
The transmitter output scanned to 1MHz span. Here,it also indicates a 0dbm (1mW) output for the trans-mitter. This low output makes it less likely to causeharmful interference to an appliance or equipment
operating near it.
Page 11 Copyright 2005 e-Gizmo Mechatronix Central
The transmitter output at full 2.6GHz span shows itsspurious output signals. The second harmonic is 18dbbelow the fundamental. The remaining harmonics are
at least 30db below.
We are currently measuring the short term and longterm frequency drift, and how it behaves with chang-
ing temperature. We will publish the results when databecomes available.
8 PARALLEL INPUTSREMOTE CONTROLLER
If your application do not require a PC (such asmicrocontroller based circuits ), or you just need aremote controller with push button functions, an 8-input remote controller transmitter is also available.
The operation of the controller is straightforward.The z8 microcontroller constantly read the inputs, ifa change is detected, the new input states istransmitted via the UC1817 transmitter moduleinto the correct communications format.
The receiver module then perfoms the action, asdescribed in the Circuit Explained section of thisarticle (page 2), turning ON or OFF its output portcorresponding to the inputs of this controller.
The remote controller inputs can, at your option, beconfigured in push-on/push-off mode : push to turnit on, push a second time to turn it off, a veryuseful feature with push button operation.
The board comes complete with 8 push buttonswitches (soldered on the copper side). A snap-onwafer connector connects it to a controller circuit ofyour choice.
The full schematic diagram of the controller isshown in figure 12.
Z8 Microcontroller
UC1817 Transmitter
8 inputs
Figure 10. 8 parallel inputs remote controllermodule.
Figure 11. Block diagram of the remote controller
8/16-bit Wireless Remote OutputPage 12
R10
10K
R14
10K
SW
4
14
23
R6
10K
UCN3815
J4 CO
N9
1 2 3 4 5 6 7 8 9
R1
10K
R3
2K2
J3 CO
N6
1 2 3 4 5 6
C4
0.1u
SW
6
14
23
R19
10K
SW
7
14
23
R17
10K
SW
3
14
23
SW
8
14
23
C1
22pF
R16
10K
J6
CO
N21 2
R4
2K2
SW
2
14
23
R2
10K
U1
Z86
E02
5
67
14
11 12 13 1 2 3 415 16 17 18
8 9 10
VCC
XTA
L2XT
AL1
/CE
GND
P00
/CLR
P01
/CLK
P02
/PG
M
P24
/D4
P25
/D5
P26
/D6
P27
/D7
P20
/D0
P21
/D1
P22
/D2
P23
/D3
P31
/OE
P32
/EP
MP
33/V
PP
R5
10K
+C
610
0
C2
22pF
U2
L780
5/TO
220
1
2
3V
IN
GND
+Q1
MP
S34
69
1
2
3
R11
10K
R20
10K
TRANSMITTER MODULE
SW
1
14
23
R8
10K
R21
RE
SIS
TOR
+C
547
u
Y1
3.58
74M
Hz
R9
10K
R7
10K
J1
CO
N61 2 3 4 5 6
R12
10K
D2
LED
SW
5
14
23
R18
10K
R13
10K
J8
CO
N21 2
R15
10K
Fig
ure
12. S
chem
atic
dia
gram
of t
he 8
par
alle
l inp
uts
rem
ote
cont
rolle
r.
Page 13 Copyright 2005 e-Gizmo Mechatronix Central
31323334353637
1111111
R16U1U2U3Y1
ANT
220 1/4 watt carbon film resistorZ86E04 - RFW Microcontroller ICLM358 OPAMP ICL7805/TO220 Voltage Regulator IC3.583MHZ CrystalPCB - receiverAWG #25 solid insulated wire, 35cm long
Transmitter Assembly
123456
211111
R1,R2D1
JDR1ANT
27 ohms 1/4 watt carbon film resistor5V1 1/2W Zener DiodeUC1817 (Modified) RF ModulePCBDsub-9 Female, PC MountAWG # 16 solid TW wire, 35cm Long
BILL OF MATERIALS
1234567891011121314151721222324
25
2627282930
12211212112111111111
9
11211
C1C2,C5C3,C18C4C6C7,C9C8C11,C12C13C14C15,C16C17D1D4J1J3L1L2Q1R1R2,R5,R7,R9,R11,R13,R14, R15,R17
R3R4R6,R8R10R12
ITEM QUANTITY REFERENCE PART
Receiver Module
0.5pF Ceramic NPO330pF Ceramic SL1n Ceramic SL1pF Ceramic NPO4n7 Ceramic SL47u/10V Electrolytic4u7 Electrolytic27p Ceramic SL220u/6v3 Electrolytic100u/16V Electrolytic0u1 Multilayer Ceramic39p Ceramic SL1N4148 Signal DiodeLED 3 or 5mm diameter9 pin header connector with lockCROWN JACK2u2HAdjustable Coil2SC37075k6 1/4 watt carbon film resistor
10K 1/4 watt carbon film resistor
6K2 1/4 watt carbon film resistor22K 1/4 watt carbon film resistor1M2 1/4 watt carbon film resistor56 1/4 watt carbon film resistor220K 1/4 watt carbon film resistor
8/16-bit Wireless Remote Output Page 14
Transmitter Component Layout
Transmitter Copper pattern (shown oncomponent side)
PCB ARTWORKSImportant: For personal use only. Commercial reproduction
is strictly prohibited!
Page 15 Copyright 2005 e-Gizmo Mechatronix Central
Receiver Component Layout
Receiver Component side
Receiver Copper pattern (shown on compo-nent side)
PCB ARTWORKSImportant: For personal use only. Commercial reproduction
is strictly prohibited!
8/16-bit Wireless Remote Output Page 16
Remote controller component Layout Remote Controller component side(Jumper)
Remote Controller Copper pattern (shownon component side)
PCB ARTWORKSImportant: For personal use only. Commercial reproduction
is strictly prohibited!
top related