E-Gizmo now brings you your building block module8 / 16-bit RF Wireless Remote Output that you can control using your PC. E-gizo's kit operates at 433MHz unlicensed ISM frequency, far from the interfering signal frequencies coming out of your microcontroller circuits. A wireless controlling distance within your arm's reach will not look impressive at all.
E-Gizmo now brings you your building block module8 / 16-bit RF Wireless Remote Output that you can control using your PC. E-gizo's kit operates at 433MHz unlicensed ISM frequency, far from the interfering signal frequencies coming out of your microcontroller circuits. A wireless controlling distance within your arm's reach will not look impressive at all.
E-Gizmo now brings you your building block module8 / 16-bit RF Wireless Remote Output that you can control using your PC. E-gizo's kit operates at 433MHz unlicensed ISM frequency, far from the interfering signal frequencies coming out of your microcontroller circuits. A wireless controlling distance within your arm's reach will not look impressive at all.
You always wanted wireless control of your project with a PC. e-Gizmo now brings you your building block 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 build gadgets 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 overseas suppliers, spending 12,000 pesos, perhaps a bit more. Others resort to buying RC (Radio Controlled) cars, tearing it apart, tak- ing only the much needed RF remote parts. A cheap RC car with two output functions can cost as little as 600 pe- sos. This seems to be attractive enough to jump into this solution, except that: Unless you are an experienced electronics geek, find- ing the correct output and matching it with your circuit can 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 noise interference within these frequency bands. This severely affects the reception ability of the receiver circuit, re- ducing the control distance range to only a couple of meter or so. Of course, a wireless controlling distance within 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 (Industrial Scientific 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 nominal 430-439 MHz Transmitter Side: Output Power: 0dBm (1mW) Harmonics: 2nd < -15dB 3rd 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 Central All 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 ON and OFF through pin 3's (TX) output of the serial port. In other words, the serial data output itself turns ON and OFF the transmitter, effecting a Amplitude Modu- lated system. D1 keeps the voltage to the transmitter from 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 com port. It is Visual Basic friendly, 10 lines of code is enough to 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 RF module UC1817. I used this module because (after some modification) of its good frequency stability over temperature and time, although it contains no saw filter component at all. Of course, a 433 MHz saw filter-stabi- lized oscillator circuit would give much better frequency stability, but you'll need a load of luck to find one in the local hobby market. J2 CON1 1 JDR1 CONN DSUB 9-R 5 9 4 8 3 7 2 6 1 5 9 4 8 3 7 2 6 1 J3 CON6 1 2 3 4 5 6 R2
R1 J1 CON6 1 2 3 4 5 6 D1 5V1 age to -0.6V in case pin 4's output suddenly decides to go negative. The receiver circuit is a bit more complicated, it will make more 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 R 1 5 k 6 C 1 0 R 7 R 1 1 C 4 1 p F C 1 2 C 3 1 n R 3 1 5 k C 1 6 + 5 L 1 C H O K E
R F L 2
+ C 1 3 C 1 0 . 5 p F Y 1 C R Y S T A L C 1 7 C J 6 C O N 2 12 + C 9 R 1 2 R 1 7 C 5 3 3 0 p F C 1 8 + V Q 1 N P N
B C E R 6 R 2 1 5 k J 2 C O N 1 1 U 3 L 7 8 0 5 / T O 2 2 0 1 2 3 V I N G N D V O U T R 1 5 D 1 1 N 4 1 4 8 R 4 5 6 k + C 1 4 J 3 P H O N E J A C K 123 R 1 0 R 9 R 1 3 R 8 + C 8 +- U 2 B L M 3 5 8 56 7 +- U 2 A L M 3 5 8 32 1 84 C 1 1 R 5 R 1 4 U 1 Z 8 6 E 0 4 5 6 7 1 4 1 1 1 2 1 3 1234 1 5 1 6 1 7 1 8 89 1 0 V C C X T A L 2 X T A L 1 / C E G N D P 0 0 / C L R P 0 1 / C L K P 0 2 / P G M P 2 4 / D 4 P 2 5 / D 5 P 2 6 / D 6 P 2 7 / D 7 P 2 0 / D 0 P 2 1 / D 1 P 2 2 / D 2 P 2 3 / D 3 P 3 1 / O E P 3 2 / E P M P 3 3 / V P P C 6 1 0 n + C 7 C 2 3 3 0 p F C 1 5 C A P F i g u r e
2 a .
C o m p l e t e
s c h e m a t i c
d i a g r a m
o f
t h e
R e c e i v e r
M o d u l e . 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 its finite length, it favors radio signals with frequencies that falls within half wavelength, which, by design, is 433MHz. The receiver is more picky. It will work only on 433MHz signals, totally ignoring all others. The very weak signal from the antenna is greatly amplified, at the same time demodulated in this block, resulting in the recovered data signal from the receiver output. The receiver block consists of components Q1, R1 to R4, C1 to C7, L1, L2 and D1. The recovered data signal however is still too weak and is mixed with all sorts of noise. The amplifier stage boosts the signal to a more usable level, using to its advantage its inability to amplify high frequency noise, thereby improving its signal to noise ratio. Then, this preconditioned signal is fed to a pulse shaper where data signal is reconstructed into nice digital signals the microcontroller can now understand. The amplifier cir- cuit consists of U2A and associated components, the pulse shaper is formed by U2B and associated parts wired as Schmitt trigger. The microcontroller then assembles the received data into an 8-bit data format. As wireless transmission is very prone to error due to unaccountable external influ- ences, extra bits are transmitted and received as a form of error checking. If everything matches the error-check- ing code, then the received data is fed to its 8-bit output port. A successful data transmission is indicated by a flashing 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 a Z86E02 microcontroller U1. U3 converts the DC supply input into a stable 5V source to supply the whole circuit. ASSEMBLY INSTRUCTIONS Part of the circuit, the receiver circuit in particular, works at a very high RF frequency (UHF 433 MHz). The choice of components becomes very important. At this fre- quency, the PCB layout becomes very much part of the circuit. Each component is carefully laid out to minimize unwanted interaction against each other. Merely repo- sitioning these components can have an astonishing effect on the performance of the circuit. Many people who do not understand this suspects that RF design is engineering mixed with witchcraft, or maybe the other way around. Figure 3. Component side of the receiver module. Figure 4. Bottom side of the receiver module. Four components 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 choose not to, you may be buying yourself into trouble you must be certain you know what you are doing. Treat each component with reasonable care. The ICs are particularly susceptible to damage due to ESD (Elec- trostatic Discharge) and must be handled properly. Sol- dering workmanship is very important, this project must be built by a soldering iron master! Recommended reading: General PCB Assembly procedure www.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 all components lead as short as possible. Q1, U1, U3 and D1 are surface mount components - they are soldered directly 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 insulated hook 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. One problem we noticed though is the antenna does not like to be touched (i.e. hand effect). Grabbing the antenna with one hand will detune the receiver and can alto- gether stop reception. Swaying the antenna, will also have the same effect, although to a much lesser extent. Figure 6. The receiver module antenna. Double side layout is used for the receiver board, with the component side copper used mainly as a ground plane. Some components must be soldered on the com- ponent side copper trace ( if the PCB you are using is not a plated through hole type), these are shown and are listed as follows: This phenomena is caused by insufficient isolation of the receiver's tuned circuit with the input port. We can easily solve this problem by winding the base portion of the antenna 8 turns around a 5mm diameter temporary form, forming it as shown in the picture be- low. Of course, this solution is a compromise, we do this at the expense of reduced transmission distance. But still, the control distance goes more than 100 feet in an open field. 8/16-bit Wireless Remote Output Page 6 Transmitter Board Assembly Building the transmitter board is a breeze! You only have to solder a couple of resistor R1 and R2, a zener diode D1, the transmitter module, a DB-9 female connector, Figure 7a. Transmitter component side. Figure 7b. The RF module is soldered on the copper side. TEST and ALIGNMENT EQUIPMENT NEEDED: a) Personal Computer (PC) with microsoft Visual Basic 6 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 module as you align it for the farthest control distance. Use a 9V battery to temporarily power it while doing the alignment. Solder the battery snap red wire to the + pin of C14, with the black wire going to - pin of the same capacitor. 4. Working close to your transmitter, tune coil L2 using the screwdriver alignment tool until the receiver LED indicator D4 flashes. Hold the PCB module near the and the antenna and its done. The antenna is formed out of solid AWG 16 tw wire cut to 35cm length. data terminal connector J1 and keep your fingers away from the high frequency receiver area as you do the adjustments. 5. Keeping an eye on the LED, move farther away from the transmitter until the LED stops flashing. 6. Slowly readjust L2 until the LED flashes again. 7. Repeat steps 5 and 6 until no further improvements can be obtained. You should have moved at least 100 feet away (open space) from the transmitter by the time the LED stops flashing if L2 is properly adjusted. Final distance will vary considerably if you do the alignment indoors, but it should not be less than 50 feet when obstructed with two concrete walls in between. Page 7 Copyright 2005 e-Gizmo Mechatronix Central USING THE WIRELESS SYSTEM Wireless control is accomplished by sending a stream of data from the PC to the transmitter through the serial communications port (com1, com2,.. and so on). The serial data is then picked-up from a remote location by the receiver module and then reconstructed to appear as an 8 or 16 bit parallel data on its output. But serial transfer cannot be reliably accomplished in wireless realm by simply throwing data all by itself. A lot of things could happen as signal travels through space towards the receiver side. And when these things hap- pens, it always leads to a erroneous data appearing on the receiver side. Obviously, we have to devise some way for the receiver to recognized whether the data it receives is intact or invalid. We can easily do this by transmitting extra data used mainly for error checking. Communications Format Aside from the 8-bit data of interest, we have to throw in two extra bytes of data preceding and succeeding the 8 bit data. Let us call these extra bytes as the Header and the Checksum. The communications format is then more 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 receiver that data transmission is started. This is a fixed data 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] (results truncated to 8 bits) Upon reception, the receiver checks the integrity of the header and proceeds to compute its own checksum and compares it with the received checksum. If the checksum matches, 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, the receiver rejects the data set by ignoring it. This data transmission scheme is very easy to imple- mented in Visual Basic. The downloadable test program source 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 capable of directly driving two TTL loads only. Do not connect any inductive load to the outputs directly, unless it is really your intent to kill the IC U1. Examples of highly inductive loads are solenoids, relays, and motors. An output interfacing circuit example is shown in figure 8. The transistor circuit allows on/off control of loads and is capable of sinking up to 100mA. D1 is necessary when 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 when driving 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 to evaluate the transmitter and receiver. Instruments used: - Advantest R3261C 9khz-2.6GHz Spectrum Analyser. - Hewlett Packard HP8647A 1GHz RF Signal Generator - Tektronix TDS754A 500MHz 2Gs/S Digital Oscilloscope - Tektronix 2465B 400MHz Analog Oscilloscope - Hewlett Packard HP6633A System Power Supply - Wavetek model 166 50MHz Function and Pulse Generator. IF EIGHT IS NOT ENOUGH Throw in a couple of 374s and connect them as shown in the figure below and you get a 16-bit output. You can use 74LS374, or its HC and HCT equivalent. Power pins connections of the ICs (pin 10 - GND, pin 20 - Vcc) are not shown in the schematic, but you should connect them to the supply lines! For best results, add a 0.1uF multilayer capacitor across the Vcc to GND lines clos- est to the ICs. To output an 8 bit data on U1, use a hexadecimal &H54 header 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 latches allows 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 generator output is reduced until noise starts to show up on the digital pulse shaper output. The upper trace shows the output of signal amplifier U2A (1V/div) while the lower trace displays the pulse shaper output U2B. An analog oscilloscope is used to monitor the output so that all high frequency noise and artifacts can be seen, something a digital oscilloscope is not good at. Under the test criteria described above, and with the signal generator externally modulated with a 2.4kHz square wave signal at 80% modulation depth, the signal generator reveals a respectable 18dBu (7.94 uV) receiver input sensitivity. The 6dB RF bandwidth measured 2.7MHz, not impressive actually, but it is not fair either to expect more for this type of receiver circuit. The measured RF bandwidth is much wider than we need. We don't want excessive bandwidth because it makes the receiver more susceptible to noise and in- terference. On the other hand, we could make use of this 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 kind of deficiency, ensuring a good data transmission even if the transmitter frequency alignment stray by as much as 1MHz. 8/16-bit Wireless Remote Output Page 10 Adjacent frequency rejection at +/- 5MHz and +/-10MHz frequency were also measured. Results are as follows: 431.2MHz + 5MHz - 62dB 431.2MHz - 5MHz - 58dB 431.2MHz + 10MHz - 78dB 431.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 as 7V to as high as 16VDC. The transmitter was evaluated using a spectrum analyzer. The transmitter is both powered and modulated by the model 166 function generator output 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 at the analyzer input to prevent input overloading. The picture on the right shows the resulting trace scan at 100kHz span. Antenna hand effect was also measured and turned out 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 cause harmful 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 its spurious output signals. The second harmonic is 18db below the fundamental. The remaining harmonics are at least 30db below. We are currently measuring the short term and long term frequency drift, and how it behaves with chang- ing temperature. We will publish the results when data becomes available. 8 PARALLEL INPUTS REMOTE CONTROLLER If your application do not require a PC (such as microcontroller based circuits ), or you just need a remote 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, if a change is detected, the new input states is transmitted via the UC1817 transmitter module into the correct communications format. The receiver module then perfoms the action, as described in the Circuit Explained section of this article (page 2), turning ON or OFF its output port corresponding to the inputs of this controller. The remote controller inputs can, at your option, be configured in push-on/push-off mode : push to turn it on, push a second time to turn it off, a very useful feature with push button operation. The board comes complete with 8 push button switches (soldered on the copper side). A snap-on wafer connector connects it to a controller circuit of your choice. The full schematic diagram of the controller is shown in figure 12.
Z8 Microcontroller UC1817 Transmitter 8 inputs Figure 10. 8 parallel inputs remote controller module. Figure 11. Block diagram of the remote controller 8 / 1 6 - b i t W i r e l e s s R e m o t e O u t p u t P a g e 1 2 R 1 0 1 0 K R 1 4 1 0 K S W 4 1 4 2 3 R 6 1 0 K U C N 3 8 1 5 J 4 C O N 9 123456789 R 1 1 0 K R 3 2 K 2 J 3 C O N 6 123456 C 4 0 . 1 u S W 6 1 4 2 3 R 1 9 1 0 K S W 7 1 4 2 3 R 1 7 1 0 K S W 3 1 4 2 3 S W 8 1 4 2 3 C 1 2 2 p F R 1 6 1 0 K J 6 C O N 2 12 R 4 2 K 2 S W 2 1 4 2 3 R 2 1 0 K U 1 Z 8 6 E 0 2 5 6 7 1 4 1 1 1 2 1 3 1234 1 5 1 6 1 7 1 8 89 1 0 V C C X T A L 2 X T A L 1 / C E G N D P 0 0 / C L R P 0 1 / C L K P 0 2 / P G M P 2 4 / D 4 P 2 5 / D 5 P 2 6 / D 6 P 2 7 / D 7 P 2 0 / D 0 P 2 1 / D 1 P 2 2 / D 2 P 2 3 / D 3 P 3 1 / O E P 3 2 / E P M P 3 3 / V P P R 5 1 0 K + C 6 1 0 0 C 2 2 2 p F U 2 L 7 8 0 5 / T O 2 2 0 1 2 3 V I N G N D + Q 1 M P S 3 4 6 9 1 2 3 R 1 1 1 0 K R 2 0 1 0 K T R A N S M I T T E R
M O D U L E S W 1 1 4 2 3 R 8 1 0 K R 2 1 R E S I S T O R + C 5 4 7 u Y 1 3 . 5 8 7 4 M H z R 9 1 0 K R 7 1 0 K J 1 C O N 6 123456 R 1 2 1 0 K D 2 L E D S W 5 1 4 2 3 R 1 8 1 0 K R 1 3 1 0 K J 8 C O N 2 12 R 1 5 1 0 K F i g u r e
1 2 .
S c h e m a t i c
d i a g r a m
o f
t h e
8
p a r a l l e l
i n p u t s
r e m o t e
c o n t r o l l e r . Page 13 Copyright 2005 e-Gizmo Mechatronix Central 31 32 33 34 35 36 37 1 1 1 1 1 1 1 R16 U1 U2 U3 Y1 ANT 220 1/4 watt carbon film resistor Z86E04 - RFW Microcontroller IC LM358 OPAMP IC L7805/TO220 Voltage Regulator IC 3.583MHZ Crystal PCB - receiver AWG #25 solid insulated wire, 35cm long Transmitter Assembly 1 2 3 4 5 6 2 1 1 1 1 1 R1,R2 D1 JDR1 ANT 27 ohms 1/4 watt carbon film resistor 5V1 1/2W Zener Diode UC1817 (Modified) RF Module PCB Dsub-9 Female, PC Mount AWG # 16 solid TW wire, 35cm Long BILL OF MATERIALS 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 21 22 23 24 25 26 27 28 29 30 1 2 2 1 1 2 1 2 1 1 2 1 1 1 1 1 1 1 1 1 9 1 1 2 1 1 C1 C2,C5 C3,C18 C4 C6 C7,C9 C8 C11,C12 C13 C14 C15,C16 C17 D1 D4 J1 J3 L1 L2 Q1 R1 R2,R5,R7,R9,R11,R13, R14, R15,R17 R3 R4 R6,R8 R10 R12 ITEM QUANTITY REFERENCE PART Receiver Module 0.5pF Ceramic NPO 330pF Ceramic SL 1n Ceramic SL 1pF Ceramic NPO 4n7 Ceramic SL 47u/10V Electrolytic 4u7 Electrolytic 27p Ceramic SL 220u/6v3 Electrolytic 100u/16V Electrolytic 0u1 Multilayer Ceramic 39p Ceramic SL 1N4148 Signal Diode LED 3 or 5mm diameter 9 pin header connector with lock CROWN JACK 2u2H Adjustable Coil 2SC3707 5k6 1/4 watt carbon film resistor 10K 1/4 watt carbon film resistor 6K2 1/4 watt carbon film resistor 22K 1/4 watt carbon film resistor 1M2 1/4 watt carbon film resistor 56 1/4 watt carbon film resistor 220K 1/4 watt carbon film resistor 8/16-bit Wireless Remote Output Page 14 Transmitter Component Layout Transmitter Copper pattern (shown on component side) PCB ARTWORKS Important: 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 ARTWORKS Important: 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 (shown on component side) PCB ARTWORKS Important: For personal use only. Commercial reproduction is strictly prohibited!