May 15, 2012
Join the "CWTD Yahoo Group" for email discussion in between our weekly sessions by clicking here.
Remote Control Techniques for Homebrewing Hams
The term "Remote Control" is as common to today's homebrewing hams as just about anything else we deal with. We regularly deal with, or hear about: remote control over the Internet, up at the top of the tower, to the other side of the world, and of course to our television and audio sound systems. But how it is technically accomplished sometimes eludes us.
So our CWTD session this week deals with this simple-yet-elusive topic from a "seminal" standpoint ... Meaning that we'll establish a base understanding of some common remote control mechanisms, and then we'll build up some foundational implementations of a given technique that we can use later in our individual and unique applications.
And further, in the way regular CWTD attendees have come to appreciate, we have an inexpensive way in which everyone can experiment on their own for a "special" project we often have in the back of our mind!
73, George N2APB & Joe N2CX
Audio Recording ... (Listen to the MP3 podcast)
<20:06:09> "George - N2APB": For those joining the session now, plesse be sure to follow along with our discussion on our "whiteboard" at http://dl.dropbox.com/u/43021514/CWTD/RemoteControl/May15.html
<20:07:24> "George - N2APB": We are startong out at "hardware" or transport layer ... these are the devices that we solder up into a given application.
<20:08:11> "George - N2APB": Typically a link consists of a "sender" and a "receiver" ... something to transmit the control signal and the other to receive it.
<20:09:22> "George - N2APB": Usually, there's no "smart" included at this layer, unless it is CW-like "on-off keying" being used. The control signals we are using "ride along on top" the transport layer.
<20:10:58> "George - N2APB": We usually need to "modulate" the contyrol sugnal on top of the carrier in some way. Either to extend the range of discrete tones or to allow the data we are sending to be immune to the noise or RF in the system
<20:12:37> "Alan - W2AEW": ..or, use a 433 or 2.4G link with a homebrew dish antenna, etc.
<20:16:35> "Joe N2CX": Lynx is a manufacturer of UHF keyfob type controllers like remote keylock for autos. These modules can be used for simple RV remote control.
<20:17:45> "Joe N2CX": Errr RC remote control - no camping involved...
<20:20:59> "Joe N2CX": re beer - how about a robot beer maid to deliver your beverage?
<20:25:15> "Alan - W2AEW": Tuning of the Yaesu ATAS-120A screwdriver antenna is accomplished using DC over the coax, similar to the bias-tees shown
<20:40:51> "Frank N3PUU": I've been using xbees for remote control work here (sorry no mic tonight)
<20:41:18> "George - N2APB": What's Xbees?
<20:41:42> "Frank N3PUU": like your modems on the whiteboard, but on steroids
<20:42:04> "Frank N3PUU": various protocol support, error correction, confirmation, built in adc & gpio..
<20:42:15> "Frank N3PUU": http://www.digi.com/xbee/
<20:43:07> "Lee KM4YY": Doesn't ICOM use the similar thing to control the down stream tuner and it 2KL amplifier?
<20:43:08> "Frank N3PUU": cost is about $23/ea
<21:02:15> "Joe N2CX": Can also pump 9V power over coax to Remote Rookey
<21:07:51> "Lee KM4YY": A wonderful presentation as usual! TNX!
<21:16:15> "Terry WB4JFI": Sparkfun and seeedstudio are great places to look for boards and tools
<21:20:08> "Mike KD5KXF": http://blog.makezine.com/
<21:20:13> "Gary VK2KYP": Thank you for this discussion, it is great to have a technical amateur radio podcast. I am listening from work 73 gary VK2KYP
<21:20:57> "Mike KD5KXF": Yeah... nice stuff isnt it Gary? I am melting solder and listening on netbook.
<21:25:33> "Armand WA1UQO": As always Guys - great intro presentation! I'm primed and ready to play. Thanks again.
<21:26:07> "George - N2APB": Thanks everyone! Great session, thanks to your input and questions along the way. Goodnight!
REMOTE CONTROL TECHNIQUES
- Different "transport layers"
VHF -- Little 433 MHz transceiver "modem" boards -- http://www.ebay.com/itm/433-M-Wireless-Transmitting-Receiving-Module-Modulation-Transceiver-XL1101-D01S-/290712483696?pt=LH_DefaultDomain_0&hash=item43afd07770
UHF -- Even smaller 2.4 GHz modem boards http://www.ebay.com/itm/2pcs-NRF24L01-2-4GHz-Antenna-Wireless-Transceiver-Module-For-Microcontr-/251044600998?pt=LH_DefaultDomain_0&hash=item3a736c9ca6
Direct wire connect
Audio Sound & Tones -- PLL repeater control, DTMF control
- Commands or Data must be sent <======> And must be received and decoded to create the desired Function
Turn the antenna rotator CW/CCW
Switch relays in a remote Antenna Tuning Unit at base of tower or at the antenna feedpoint
Close relays to actuate motors to turn ATU capacitors and roller inductors
Remotely turn antenna switches to select which antenna feedline to bring into the house
Up/Down control of a rig's volume control across the room
Remotely control a radio's tuning while listening from another room
Turn on the microwave to start popping the popcorn
- Injectibng audio and DC remote control signals into a coax carrying RF
SAMPLE APPLICATIONS OF REMOTE CONTROL FOR HAM PURPOSES
How can remote control be effectively used around the ham shack? Well, suppose you had an antenna tuning unit (ATU) out at the base of your tower in the backyard and you wished to remotely control its tuning. Instead of running a separate/ expensive multi-wire cable out for the control of the ATU functions, you might consider sending one of four audio tones to it via modulated laser beam, or over and FM radio, or by an IR optical path, or even by just a single pair of twisted wire. The audio pulse generator in your shack would generate the proer sequence of tone pulses that are sent over the "medium of choice", which are then decoded by the Rookey board. Thus, the motors in your ATU could be commanded to turn CW or CCW, or the power turned on/off, or whatever else you might want to control.
Remote ON-Off Keying
The Rookey "Decoder" Setup:
FM receiver, audio patch cable, Decoder board, ear buds,
and the 9V battery. (Battery not included in kit.)
The Rookey Kit consists of the audio Decoder pc board and all on-board components, a small FM receiver, audio patch cord, ear buds and an 9V battery clip. The microcontroller IC supplied with the Decoder board is preprogrammed with the BASIC software program that decodes the incoming audio pulses to illuminate any one of the four LEDs.
An extra (blank) Rookey pc board is also supplied in the Rookey Kit and is easily modified for use as a mating Encoder board to generate the coded audio signals that would be sent (with a user-supplied FM transmitter) over the "transport medium" of the FM band. Alternatively, the Encoder's audio pulses could be sent to the Rookey using IR, Bluetooth, hf/vfh ham band or ultrasonic transceivers. You could even just connect the Rookey Encoder and Decoder board pair with a long run of ordinary twisted pair wires to deliver multi-function control to the end-point.
The Rookey Encoder and Decoder boards use the simple and reprogrammable PICAXE microcontroller, thus allowing you to easily customize the project by changing the codes and adding other features to suite your remote control project ideas. All encoder/decoder software is freely available on this web page.
Additional software is available for the Rookey boards, provided by PICAXE-enthusiast David Gwillim, KB2TQX. Dave's programs allow the Rookey board to function as a Randon Morse Generator, Iambic Keyer, Koch Method Generator and a temperature controller. This source code is also freely available here.
Remote control (R/C) has long been both a fascination and a useful tool for amateur radio operators. The uses for R/C around the ham shack are plentiful -- some are obvious, such as for controlling a remotely-located antenna rotator or ATU; while others R/C applications are not as obvious, such as for gathering telemetry data when testing an antenna. See the Example Applications section below for more ideas.
Designers N2CX and N2APB developed the Remote On-Off-Keyer "Rookey" project as a simple way to handle remote control needs around the radio shack. Realizing that we hams are a frugle lot, we designed a low-cost, yet reliable system to generate specially-coded audio tones that could be delivered to a remote location over a transport medium and decoded there to control multiple functions. The result is the Rookey Kit consisting of an "encoder" board and a"decoder".
The Decoder is a small pc board that accepts a specially-coded train of audio on/off pulses in order to control one-of-four functions on the remote end of the link. An LED is provided for each decoded function, and a fifth LED is used to detect presence of the incoming 1 kHz tone which is useful to have for the initial self-calibration and later for indication of active link operation. All parts are provided for this Rookey decoder board, including an FM receiver, audio patch cable, ear buds to observe the 1 kHz tone pulses being received, and a 9V battery clip. A PICAXE microcontroller IC is at the heart of the Rookey decoder board and serves to decode the pulse audio tones in order to turn on one of the four function LEDs. Typically, the outputs of the PICAXE drining the LEDs would be connected to your own custom electronics requiring the remote control signaling -- e.g., a driver circuit that controls your remotely-located antenna switch.
The Encoder is another board very similar to the Decoder board described above, but easily modified to produce the pulsed audio tones in the right sequence based on the settings in the two switches connected to the board. Note that a blank pc board is provided for the Encoder function in the Rookey Kit; thus you will need to populate the board according to the specific, custom way in which you wish to use the Rookey system. Several recommended modifications are shown in the Encoder section of this web page. As shown in the primary example of Figure 2, two small toggle switches are used to instruct the PICAXE microcontroller to generate the proper code for turning on functions 1, 2 3 or four on the mating Decoder board. Software for the Encoder is provided here on this web page for easy download and programming into your Rookey Encoder board.
No matter how you build up your Rookey system -- whether you use the basic four-function example Encoder and Decoder circuits and software provided here, or modify the circuits and software to suit your own needs -- you'll have the beginnings of a flexible and powerful remote control system that could be used in many ways around your shack to provide extended control to your various radio components.
System Block Diagram:
A code generator produces 1 kHz audio pulses in a specific protocol (sequence). The audio tones are delivered over whatever convenient medium that might be available to the user. The tones are delivered to the Rookey board for decoding and ultimately controlling 1-of-4 functions.
When using an FM transmitter-receiver pair as the transport medium, the FM radio receives the tone-encoded R/C transmission and delivers the audio to the Rookey board's "phase locked loop" (LMC567) which turns the on-off keying into an equivalent logic level waveform. The PICAXE microcontroller then decodes the pulse sequence in order to activate the corresponding function.
The timing of the audio pulses generated in the Encoder software, and correspondingly decoded in the Decoder software, is shown below. A 1 kHz tone is generated for 500ms to serve as a start bit, thus allowing the Decoder to synchronize the the Encoder timing.
The data bit periods follow as a
series of 50ms windows in which audio is present, or it is not. A logic "1" is
assumed when there is no audio present, and a logic "0" is assumed when there is
audio present during the data window. (Yes, it seems illogical to have it this
way, but the Decoder board actually sees a "0" when the tone is present.)
1) The first 50ms window is always quiet (no tone).
2) The next three data periods, shown as Win Sequence 0, 1 and 2, are essentially unused now.
(They previously contained the proper sequence of the acquired transmitters being used in the Atlanticon QRP Forum competition.)
3) The final two data periods, shown as Transmitter 0 and 1, are the binary-coded bits indicating which function LED is illuminated when decoded by the Decoder board.
The protocol finishes up by presenting a 500ms quiet period (no tone) as a further aid to synchronizing the encoder and decoder logic.
Rookey Decoder Schematic:
The Rookey operates by receiving a low-level train of 1 kHz audio pulses from a remotely-located transmitter. For example, properly-sequenced 1 kHz audio pulses may be fed to an inexpensive, low-power FM transmitter in order to send the command codes to the remotely-located Rookey decoder board. The a conventional broadcast-band FM radio would receive the specially-coded tones and deliver them to the Rookey board for decoding and activation of one of the four functions.
The user is able to hear the audio tones being received using earbuds plugged into J2 of the Rookey board. With all jumpers in the "normal" position (as shown in the schematic and photos), the tone is delivered to an audio tone detector U1 (LMC567) whose components are selected to detect a 1 kHz tone. When that audio pulse is detected, the output of U1 goes low, turning on the "Signal" LED and delivering that low logic level to the input of a PICAXE microcontroller U2. The PICAXE is running a simple BASIC program that watches for the proper sequence of pulses being delivered to the Rookey board, and when it detects that correct sequence it turns on the appropriate LED to indicate successful receipt of a remote control command.
Programming the Rookey Boards
The PICAXE microcontroller (U2) on the Rookey encoder and decoder boards can be easily programmed using the J3 connection to the serial port on your PC. Using a conventional 9-pin RS-232 connector (DB9S, female), and using the photo below as a guide, wire the three connections as follows ...
1) the tip of a 1/8" stero plug to pin 5 (the gray wire);
2) the ring (the yellow middle conductor on the plug) to pin 3; and
3) the sleeve (the copper braid outermost shell conductor) to pin 2.
Using the free PICAXE Programming Editor program on your PC, you can then open the BASIC program you wish to load into your Rookey card, and then select the Run menu item to transfer the program to your target board.
The Decoder software is decoder_v1.0.bas. Right-click this link and save the file to your local computer in the working directory that your PICAXE Editor uses. Don't forget to remove the .txt extension on the filename after downloading - the PICAXE Editor only operates on files ending in .bas.
Programming adapter allows typical DB9 serial cable from
computer to load new software into the Rookey cards.
The Rookey board may be easily set up by placing the three jumpers into the "test" positions. When power is applied, the PICAXE microcontroller detects the test mode and generates a 1 kHz tone that is delivered to the input of the '567 (U1). The user then adjusts the R10 trimpot until a steady tone detection is indicated in the Signal LED. Although you will see the "Signal" LED start to flicker on and off when the 20-turn trimpot is adjusted towward one end or the other, the ideal position of the trimpot will likely be at the mid-position (10 turns in from either end). Once the steady LED "on" position is achieved near midpoint of the adjustment, just return the jumpers to the Normal positions and power cycle the Rookey board to ready it for decoding action.
1) Move JU1, JU2 and JU3 to the TEST positions.
2) Apply circuit power.
3) Adjust trimpot in LMC567 tone decode circuit until Signal LED is consistently illuminated. The 20-turn trimpot setting will be approximately in the center (i.e., at turn #10). If the process is started with the setting all the way to one end, you will see the LED start to flicker ON at about turn 5-or-so. Then it'll become solid ON from there through turn 15-or-so. Back the turns up to the mid-position of these two "flicker extremes" and you'll have the best setting.
4) Move JU1, JU2, and JU3 back to the NORM positions.
5) Remove and re-apply circuit power to begin normal operation.
The following circuit may be built up on the blank Rookey pc board supplied in the Rookey Kit in order to create an Encoder board.
When power is applied, the Encoder program generates the protocol sequence that specifies the state of the two Function Selectors: switches Code0 and Code1.
Operation of the Decoder is simple ... the LED
"functions" are selected according to the received value of the Code 1 and Code
0 bits ...
00 = function 0 = LED D5 on (rightmost)
01 = function 1 = LED D4 on
10 = function 2 = LED D3 on
11 = function 3 = LED D2 on (leftmost)
The functions are mutually exclusive - i.e., only one function is active at a time.
The code switches are "positive logic", meaning that the encoder bits are a "1" when the switch is open (or when the jumper is off), thus allowing the pin to be pulled high.
The Encoder software is encoder_v1.0.bas. Right-click this link and save the file to your local computer in the working directory that your PICAXE Editor uses. Don't forget to remove the .txt extension on the filename after downloading - the PICAXE Editor only operates on files ending in .bas.
Rookey Encoder Schematic
The following wires need to be added to the bottom of the bare "Encoder" and KMMT boards supplied.
Parts List (Decoder)
Interfacing Ideas for the Rookey Decoder
The Rookey Decoder outputs driving the LEDs could be used directly to control up to four functions, as exemplified by when the individual LEDs are turned on. As explained in the Encoder section above, when you wish to turn on LED D3 the Encoder would be programmed to send a "10". This function selection drives the PICAXE output pin to a low level and thus turns on LED D3. If you had an interface circuit connected to that output pin, it would be activated with that low level. So you see how you can turn on any individual LED by sending the appropriate function ...
00 = function 0 = LED D5 on (rightmost)
01 = function 1 = LED D4 on
10 = function 2 = LED D3 on
11 = function 3 = LED D2 on (leftmost)
But what do you do when you need to control more than four functions? And oftentimes you need to provide some kind of buffer or interface to the relays or other components you want to control. So, let's explore some ways to expands and buffer the outputs of the basic Rookey Decoder board.
The PICAXE outputs are capable of driving simple low current loads without any extra circuitry. They will easily drive LEDs with addition of no more than a current limiting resistor. When driven high (by the program) the each output pin will provide a 5V output with up to 20 ma capability. When driven low each output pin will “sink” as much as 20 ma for a load connected to 5V.
To drive higher current loads you have to add an external driver. The very simplest is merely an inexpensive bipolar transistor and a resistor as shown below.
When a connected PICAXE output pin goes high, it turns the transistor on and when it goes low the transistor turns off. The load to be driven is connected between a positive voltage of choice (up to 35V or so) and the driver transistor. A common NPN silicon transistor such as the 2N2222, 2N3904 or 2N4401 will drive a load of up to 100 ma or so quite well. If the load is inductive, such as a motor, an actuator or a relay, a diode needs to be connected as shown to “snub” the inductive spike generated when the transistor turns off.
Even simpler is the Mosfet driver shown above. The PICAXE output pin is connected directly to the device’s gate with no need for a current limiting resistor. The 2N7000 will drive 200 ma loads connected to supply voltages up to 60 V. As with the bipolar transistor a “snubbing” diode is required to protect the device when using inductive loads.
There are also IC’s designed specifically for driver use. A handy one is the ULN2003 which has seven drivers in one 16-pin DIP as shown schematically below.
Each Darlington transistor driver section has its own current limiting resistor and a “snubbing” diode. The cathodes of each protective diode is connected to a common pin for ease of connection to the positive supply voltage. Each driver section can drive a 500 ma load fed from up to 50V.
The schematic above shows a means of getting additional outputs from the limited pinouts of the PICAXE08M. The 74HC138 decoder chip incorporates multiple internal logic gates to produce eight outputs. Unfortunately the outputs of this chip are “low” when selected so a multiple inverter chip like the 74HC240 does the trick. The result is illustrated in a logic truth table shown to the right of the schematic diagram. When all of the input pins are “low” (0V), “O0” (Output 0) pin goes high. This may or may not be useful. However the other combinations “high” (5V) inputs to the decoder each give a unique output on pins O1 through O7. You can note that the inputs are a binary number whose decimal equivalent corresponds to the output pin driven to 5V.
One handicap of the 74HC240 is that its outputs can drive only 5 ma or so and are limited to 5V. While you can use the individual drivers described previously, using the ULN2003 provides seven drivers, one each for outputs O1 through O7.
Additional Circuits and Programs
Be sure to see the next
page for a number of clever and useful programs developed by David Gwillim,
KB2TQX using the Rookey ...
o Random Morse Generator
o Koch Method Morse Trainer
o Iambic Keyer
o Temperature Sensor
Although we designed the Rookey pc dimensions to fit in the popular Altoids mint tins, if you wish to put the kit in any type of metal enclosure (like the Altoids tin), you must be especially careful to isolate the serial programming jack's (J3) threaded metal sleeve from the metal enclosure, as shown in the photo at the top of this page. The metal enclosure is likely at ground potential when the board is attached, but the threaded sleeve of J3 is unconventionally used and carries the SerOut connection directly from the PICAXE controller. If this metal sleeve touches ground while the controller is sending data, that pin of the controller will be blown and you will no longer be able to program the device.
(We followed the lead of the PICAXE supplier, World Educational Services in providing a programming port J3 on the Rookey pc board. The programming port uses a standard 3.5mm stereo jack for a cable to a computer serial port; however WES connects the sleeve of the connector, which is usually grounded in most designs, to the SerOut line from the PICAXE chip.)
This is not a problem with a
free-standing pc board, or if you choose to use a plastic enclosure. However if
you mount the pc board in a metal enclosure you must insulate the threaded shell
of the programming connector from ground. If you simply thread it through a hole
and use a nut to secure it to the chassis, you can short circuit the programming
data output from the PICAXE chip and you will damage it. The solution can be
simple however: you may cut the hole a bit larger and wrap the sleeve of J3 with
a small piece of electrical tape to keep it isolated from the metal enclosure.
(Of course, you must also not use a nut to attach the threaded sleeve to the
So, if you mount the Rookey in a metal enclosure be
sure to insulate the threaded sleeve of J3 from the metal box!
PURCHASING THE ROOKEY KIT
See the Rookey Kit on the Midnight Design storefront.
REMOTE CONTROL REFERENCES
Back to CWTD Home