This is only a preview of the May 2004 issue of Silicon Chip. You can view 16 of the 96 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "Component Video To RGB Converter":
Items relevant to "StarPower: A Switching Supply For Luxeon Star LEDs":
Items relevant to "Wireless Parallel Port":
Items relevant to "Poor Man's Metal Locator":
Purchase a printed copy of this issue for $10.00. |
Wireless
Parallel Port
Low-cost design uses a 434MHz UHF data link
Incorporating a UHF data link, this Wireless
Parallel Port is just the shot for computer
control of irrigation systems, solenoids,
robots, lights or just about anything. It’s
based on pre-built UHF radio modules and
is low in cost.
By NENAD STOJADINOVIC
T
HE NOVEMBER 2003 issue of
SILICON CHIP included an article
entitled “Smart Radio Modem
for Microcontrollers”. This was basically a low-cost data link that could
send up to 16 bytes of data at a time
across the radio “ether” over a range
of 150-200 metres.
The project described here expands
on that basic concept by serving up the
received data in parallel format. This
makes it much easier for the novice
to use and opens up a world of ap-
plications that were designed for the
parallel port.
Fig.1 shows the basic scheme for
the Wireless Parallel Port. It’s based
on a transmitter and receiver pair
using Laipac brand 433.92MHz UHF
modules, with PIC microcontrollers
handling the “smarts”.
As shown in Fig.1, the transmitter is
exactly the same as used for the Smart
Radio Modem. For those who haven’t
seen it before, the modem transmitter
can be driven by any microcontroller
Fig.1: the basic scheme for the UHF Wireless Parallel Port. It’s based on
pre-built UHF transmitter and receiver modules.
66 Silicon Chip
such as a PICAXE, Stamp, etc. Alternatively, it can be attached to a computer
COM port via an RS232-TTL adapter
(also described in the November 2003
issue) and will accept the download of
up to 16 bytes of data at a time.
The downloaded data bytes are
subsequently sent on their way by
simply pulling the transmitter’s SEND
pin low for a short period (eg, 0.25s).
The modem receiver then outputs the
data, giving the effect of a serial cable
that can be up to 200m long.
The parallel port receiver differs
slightly in that it only receives and
then outputs one byte of data per
transmission. This data byte is latched
on the output pins until the next byte
comes along.
Basic functions
We will assume here that you have
read the November 2003 article, so we
won’t cover the same material again. If
you don’t have a copy, it is available
as a back issue for $8.80 (including
postage).
Basically, this unit is designed to be
as easy to use as possible. For example,
to transmit data to the Wireless Parallel
Port using a communications program
such as Hyperterminal, you simply
send the number of the receiver pin
that you want to turn on (ie, raise to
+5V or logic “high”). You then briefly
pull the SEND pin low on the transmitter module.
Unfortunately, Hyperterminal
(which comes standard with Windows) will not allow you to directly
control the SEND pin (connected to
the COM port’s RTS line), so using it
requires a pushbutton switch between
the SEND pin and ground. As a result,
siliconchip.com.au
Fig.2: this is the complete circuit for the receiving end of the UHF Wireless Parallel Port. PIC microcontroller
IC1 receives data from the UHF receiver, decodes it and outputs the data (D0-D7) to pins 2-9 of a DB25F
connector. LED1 flashes to indicate when data is being received.
it’s more convenient to use a COM port
test program which can drive the port
directly. I use “Simple Term” which
is available from www.ptronix.com.
This program allows you to load the
data, toggle the SEND (RTS) pin and
watch the BUSY (DSR) pin all from the
comfort of the computer screen – very
convenient.
Thus, to turn on pins 3, 4 & 5, you
simply type in 345 (ie, no spaces) and
toggle the SEND pin. In Simple Term,
you type 345 in the blue bar, click
Send and then change the RTS radio
button to light green and back to dark.
Sending 128 (for example) would then
turn off the above pins and turn on
pins 1, 2 & 8. Sending “0” turns all
the pins off.
Using a password
The ability to use a password is a
useful option with this unit and there
are a couple of reasons why you might
want to do this. If your neighbour has
a similar unit, for example, the use
siliconchip.com.au
of a password will prevent interference between them. Alternatively,
you might want to have a number of
receivers, each responding to its own
password.
The password allowed is rudimentary. It simply consists of a single
character but it does give you up to
256 different choices.
To load a password, you simply type
in “P” (without the quotes) and then
the password; eg, P*. Note that you
must use a capital P and the “learn
link” must be in place on the board
during this procedure – see Fig.2.
Once that’s done, the receiver will
only respond to commands prefaced
by the password; eg, *145.
To remove the password, just send
the character “X” with the learn link
in place.
For advanced users
Sending a byte to switch each of the
pins is all very well but it can also be
very useful to simply send a single byte
that will be transferred to the port as
binary data.
To do this, simply send the “B”
command followed by the binary data.
Thus, B<01h> will set the port’s D0
pin high. Similarly, B<FFh> will set
them all high. This function works in
conjunction with a password if you
have one in place.
Circuit details
The complete receiver circuit is
shown in Fig 2. Apart from the UHF
receiver module, it uses a PIC16F84
microcontroller (IC1) and a few other
bits and pieces.
The circuit essentially emulates a
parallel port and outputs its data to
D0-D7 (these are pins 2-9 on a standard
DB25 connector). Pins 11, 12 & 13 of
the DB25 connector are also connected
to the microcontroller and may be
used in future projects. In addition,
an RX (received) data indicator is fitted, consisting of a LED connected to
pin 13 via a 560Ω resistor. This LED
May 2004 67
Fig.3: the PC board should only take you 30 minutes to assemble. Take care to ensure that the receiver module
is correctly oriented – see photo. The PC board pattern at right is shown full size.
lights and the pin goes high briefly
when ever a valid data transmission
has been received.
The previously mentioned “learn
link” is connected to pin 17 (RA0) of
IC1. Fitting this link pulls pin 17 high
(it’s normally pulled low via a 10kΩ
resistor) and places the microcontroller in the “learn” mode.
Parts List
1 PC board, code 07105041, 60
x 60mm
1 4MHz 3-pin ceramic resonator
(CR1)
1 DB25 female PC-mount connector
1 18-pin IC socket
1 2-way connector
1 2-pin SIL header plus jumper
shunt
1 8-pin straight SIL header
1165mm length of light-duty
hookup wire
Semiconductors
1 Laipac RLP-434 UHF receiver
module
1 PIC16F84 programmed microcontroller (IC1)
1 1N4004 diode (D1)
1 5mm LED (LED1)
1 78L05 voltage regulator
(REG1)
Capacitors
2 0.1µF monolithic
Resistors (0.25W, 1%)
2 10kΩ
1 560Ω
68 Silicon Chip
All outputs to the port can be monitored via connector CON1, while a
4MHz ceramic resonator (CR1) provides the clock signals.
The unit can be powered by an DC
supply from 8-15V (eg, a plugpack).
Diode D1 provides reverse polarity
protection, while regulator REG1 provides a stable +5V rail to power IC1
and the UHF receiver module.
Construction & testing
With only a handful of components,
the construction is not challenging.
Fig.3 shows where all the parts go.
Install the smallest components first
and watch the orientation of everything except the resistors.
Don’t forget the wire link and be
sure to use a socket for IC1. Note that
the UHF receiver module is installed
with its red coil facing towards IC1
– see photo. The antenna consists
simply of a 165mm length of insulated
hookup wire.
If you are using the receiver to control a board (eg, a relay board) that
doesn’t have its own power supply,
you will need to organise power to
both. The DB25 connector is tied to
ground, so you will probably only
need to connect a positive lead from
one board to the other.
If you have any doubts about how
it all goes together, you can leave out
the PIC and the UHF receiver module
until the power supply is sorted out.
That way, they cannot be damaged if
you make a mistake.
In fact, it’s a good idea to check that
there is +5V on pin 14 of IC1’s socket
before switching off the power and
installing the microcontroller and the
receiver module.
Testing simply involves sending
data to the receiver and checking that
the LED blinks. You can then check
which pins have been set (ie, taken
high) by using a multimeter to measure
the voltages on CON1.
Practical applications
The accompanying photo shows the
receiver connected to an 8-channel
relay board, as sold by Oatley Electronics (see SILICON CHIP, September 2000).
Basically, you can use any board which
only requires eight data inputs (D0-D7)
and requires no control lines.
With six standard and two heavy
duty relays, driving just about any
load is no problem and password
activation means you can selectively
drive up to 256 separate relay boards.
This view shows the transmitter board
plugged into its companion RS232
interface board (see SC, Nov. 2003).
siliconchip.com.au
The UHF Wireless Parallel Port is ideal for controlling this 8-Channel Relay Board, as sold by Oatley Electronics.
You can control any board which only requires eight data inputs (D0-D7) and requires no control lines.
That’s a lot of relays!
I’ve been using these boards in the
garden to control irrigation solenoids
and currently the back and front yards
have one each, controlled by their own
password. I had what is essentially a
PIC-based alarm clock left over from
another project and I simply set the
start and stop times during the day
for each relay. For example, in pseudo
code:
At 10:35 am:
Send *1 ;Turn on relay 1 on card
with the password “*”
At 11:20 am:
Send *0 ;Turn off all relays on card
with the password “*”
I imagine that this would be a very
simple program for the PC, perhaps
with a scheduling grid to show what
SC
is on and off at what time.
siliconchip.com.au
Where To Get The Parts
Kits plus individual parts for this project are available from the author. Prices
are as follows (kit prices include the PC board plus on-board parts only):
(1). Wireless Parallel Port Receiver ................................................... $46.00
(2). Matching Transmitter Kit ............................................................. $28.00
(3). Transmitter/Receiver Kit Package Deal ....................................... $69.00
(4). RS232 Interface Kit For Transmitter ............................................ $25.00
(5). Programmed Microcontroller With Resonator ...... Rx $18.00; Tx $15.00
(6). Rubber Duck Antenna (see November 2003 article) ......... $19.00 each
All prices include postage within Australia and GST. To order, write or email
the author as follows:
Nenad Stojadinovic, PO Box 320, Woden, ACT 2606.
email: vladimir<at>u030.aone.net.au
The Laipac UHF transmitter and receiver modules are also available from
Commlinx Solutions at www.commlinx.com.au
May 2004 69
|