This is only a preview of the August 1999 issue of Silicon Chip. You can view 38 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 "Remote Modem Controller":
Items relevant to "Daytime Runnings Lights For Cars":
Items relevant to "Build A PC Monitor Checker":
Items relevant to "An XYZ Table With Stepper Motor Control; Pt.4":
Items relevant to "Making Negatives From Positives":
Articles in this series:
Purchase a printed copy of this issue for $10.00. |
Remote Modem
Are you a ‘control freak’? Want to control and measure
things from a distance? If you have an old modem sitting
idle, here’s the ideal project.
It simply connects to a standard modem and the flexible
interfacing makes it suitable for a vast array of control and
measurement applications.
By Leon Williams
H
ave you ever been away from
home, say on holidays, and
wished that you could turn on
the lights, feed the dog, see what the
temperature of the tropical goldfish
tank is or measure the voltage of your
burglar alarm battery?
Or ever been at the office and forgotten to water the garden, or worse,
forgotten to turn the sprinkler off?
Well, the answer is to build the
Remote Modem Controller (RMC).
Together with a PC and modem, the
RMC you can turn things on and off,
monitor inputs, measure voltages,
measure the temperature and count
events whether you are next door or
on the other side of the world.
You don’t need any
fancy software, as it
interfaces with just
about any PC running
terminal emulation
software.
The RMC is housed
in a standard plastic
instrument case and has
room for extra interfacing or transducer circuits.
The rear of the unit has a
DC input socket, a 9-pin male
D connector for the modem
and a 25-pin female D connector
for the serial cable to the PC.
Operation is simple. Before you
leave home, you connect the RMC
FEATURES
Easy to build single sided PC board
PIC16C73A microcontroller
6-digit password login security
Idle timeout protection
Individually turn on/off four outputs
Monitor four opto-isolated digital inputs
Measure temperature between -10°C to +60°C in one-degree steps
Measure two separate voltages from 0 to 20V DC in 100mV steps
Capture or count slow-occurring events (maximum count of 255)
9V DC input at low power
No special software required
Easy interactive menu operation; single key-stroke commands
Simple 3-wire RS232 control interface (4-wire for modem)
EEPROM stores password and system data
Operated remotely via a modem or by direct connection to a PC
16 Silicon Chip
to your modem which is plugged into
the telephone line. Later on, when
you are far away, you dial into your
RMC from a remote PC and modem.
The modem answers the call and the
RMC asks for a password. If the password is accepted, you are presented
with the main menu, from where you
select the various options. When you
are finished you select logoff and the
RMC commands the modem to terminate the call, ready for the next one.
As well as doing all this remotely,
m Controller
the RMC can be directly controlled
by your PC to measure and control
things locally.
Inputs/Outputs
The RMC’s inputs and outputs can
be used for an unlimited number of
The outputs are open-collector
transistors and incorporate a clamping diode which is used if relays are
being controlled. If a logic output is
required, then a pull-up resistor can
be connected between the respective
collector and the positive DC rail.
With these features it is simple to
interface with logic I/O, switches,
relays, sensors and transducers.
Fig.1 shows some input and
output circuits.
PIC microcontroller
applications. The inputs and event counter are isolated
by optocouplers and only require a
few milliamps to operate.
The analog voltage inputs, while
not being electrically isolated, are
protected against over-voltage and
reverse polarity. A resistive divider
has an input impedance of 10kΩ and
converts the maximum measurable
input voltage to a safe voltage for the
microcontroller’s A-to-D converter.
The temperature sensor input is designed to match a LM335 temperature
sensor, which has an output voltage
of 2.73V at 0°C.
The star of the show is undoubtedly
the PIC16C73A microcontroller. It
comes in an unusual 28-pin skinny
(0.3") DIP package but it has a lot
packed inside it. Some of the internal
features are:
* 4K OTP (One Time Programmable)
program memory
* 192 bytes of user RAM
* 22 I/O pins
* 3 timer/counters
* a full duplex UART
* a 5-input A-to-D converter
Circuit description
Fig.2 shows the complete circuit
diagram. IC1 is the PIC16C73A micro-
controller. Pins 9 and 10 provide the
crystal oscillator using X1, C10 and
C11. The frequency of 3.6864MHz
was chosen to allow the internal Baud
Rate Generator to provide accurate
baud rates.
Pin 20 is the positive supply input
while pins 8 & 19 are connected to 0V.
Pin 1 is the reset input, connected to
+5.12V via a 10kΩ resistor.
The PIC has an intelligent internal
power up reset circuit and as long
as Vcc rises quickly, no extra power
reset circuit is required. Pins 21 to 28
are assigned to general purpose port
B with pins 21 to 24 configured as
outputs and pins 25 to 28 as inputs.
Pins 11 to 18 are assigned to port C.
Pin 18 is the UART Receive data input,
pin 17 is the Transmit data output and
pin 15 is the DTR output. Pin 16 is
used to control the LED.
Pins 11 to 14 are used to interface to
the EEPROM (IC3). It is used to hold
the password, speed setting and other
system data in case of a power failure.
It can store 64 by 16 bit words. Data is
written to and read from the EEPROM
in serial form synchronously with the
rising edge of the clock input.
The Chip Select (CS) input, pin 1,
must be high for any read or write
commands to be accepted. A 10kΩ
resistor (R4) is used to pull the CS
line low when powering up or down
to avoid possible data corruption.
Data to the EEPROM is at pin 12,
data from the EEPROM is pin 11, the
clock signal is pin 13 and the Chip
Select signal is pin 14.
The last port, port A, is associated
with the Analog to Digital (A-to-D)
converter. Pins 2 and 3 are configured
as A-to-D inputs 0 and 1. Pin 4 is a
digital input that is sampled at power
up to determine if the Default pins are
shorted. More on this later.
Pin 5 is the temperature sensor
input and the voltage on this pin is directly proportional to the temperature.
Pin 6 is not connected to the A-to-D
converter but instead is connected to
the clock input of an internal counter
(Timer 0). Pin 7 is not used. The referAUGUST 1999 17
Fig. 1: some of the input and output circuits which could be used with the
Remote Modem Controller. There are many more which could be devised.
ence voltage for the A-to-D converter
is internally connected to the +5.12V
rail (Vcc).
IC2, an MAX232, is a standard
RS232 transceiver used to interface
the 5V logic signals in and out of the
PIC to the modem and serial ports.
It only requires a +5V power supply
and produces the required plus and
minus RS232 voltages by an internal
inverter which employs capacitors
C1 to C4.
IC2 has two receivers and two
transmitters but one receiver (pin 8)
is not used here. Pin 13 is the receive
data input, pin 7 is the transmit data
output and pin 14 is the Data Terminal
Ready (DTR) output.
P1 is a 9-pin male D connector and
J1 is a 25-pin female D connector. In
case some communications packages
running on the PC require active CTS,
DSR and DCD signals, they have been
looped to PC outputs so that they will
be on whenever the PC is connected.
LED1 has the following states: Off
when power is disconnected or off for
five seconds when clearing a call. It
flashes at a slow rate when powered
up and the unit is attempting to match
the interface speed with the modem
or PC.
When the unit has matched the
modem or PC and is waiting for a
connection, it flashes at a faster rate
of around 1Hz. When a call is in pro18 Silicon Chip
gress, LED1 is permanently on.
Connector J2 is the connection
point for the analog inputs. Each input
has an attenuator made up of three
resistors, 1.8kΩ, 6.2kΩ and 2kΩ.
This unusual combination is used
to allow easy software manipulation
of the A-to-D value. The A-to-D converter has a resolution of 8 bits or
a maximum value of 255. With this
attenuator, an input voltage of 20V
gives 4V at the A-to-D input pin and
a conversion value of 200 – making
the software task a lot simpler.
Zener diodes ZD1 & ZD2 protect
the PIC inputs from over-voltage and
reverse voltage, although reverse
voltage inputs should be avoided.
The maximum voltage that can be
measured is 20V, however the inputs
can withstand overvoltages up to say
50V for a short duration.
A .01µF capacitor is connected
across each PIC input to filter out
noise and minimise A-to-D conversion errors.
Op amp IC5b, one half of an LM358,
is the temperature sensor interface
and intended to be used with an
LM335 temperature sensor.
This gives an output voltage relative
to zero degrees Kelvin and which
increases by 10mV/°C.
At 0°C the calibrated voltage is
2.7315V. IC5b has a gain of -4 which
results in the output voltage at pin
6 changing at a rate of 40mV/°C, decreasing with increasing temperature
and vice versa. Trimpot VR1 acts as
the calibration control.
A 4N28 optocoupler, IC6, is used
to interface the Events input (J4) to
pin 6 of IC1. Resistor R18 limits the
current passing through the internal
LED in the optocoupler, while diode
D2 protects it against reverse voltages.
The value of R18 (560Ω) is chosen to
provide about 5mA of input current
when interfaced to a 5V logic output.
Higher voltage input signals will require an external resistor – see Fig.2.
R17 pulls up the open collector output
of IC6 and provides a high when the
input is off (no input current) and a
low when the input is on (current
flows into the optocoupler).
Capacitor C13 acts as an integrator,
filtering out any high frequency edges
which may occur if switches without
debouncing are used as inputs. The
Event input connects to an edge-sensitive counter within IC1 and any
transitions other then the one wanted
will result in false Event readings.
However if the inputs are very noisy,
an external debouncing circuit will
be needed.
IC7, IC8, IC9 and IC10 and associated resistors and diodes are the
optocoupled inputs. They operate
in the same way as the Events input.
IC4 is a ULN2003A which interfaces
four outputs of IC1 to connector J6. It
has open-collector transistors which
can each sink 350mA and have a maximum collector voltage of 50V. IC4 is
suitable for driving relays as well as
providing a logic output by connecting a resistor between the collector
of the transistor and the +5V supply.
Connector J5 has a +5V point which
can be used for this purpose.
Note that when using the digital
output option, the output is low (0V)
when it is on and high (+5V) when the
output is set to off. The +5V point on J5
is only intended for this purpose and
the internal power supply is not designed to power multiple relay coils.
The power supply consists of an
LM317T 3-terminal adjustable voltage
regulator (REG1). The DC input is
filtered by C14 and protected against
reverse voltages by diode D1.
The output voltage is adjusted to
5.12V by trimpot VR2. It is set to 5.12V
rather than 5V to provide the correct
reference voltage for the A-to-D converter within IC1.
Fig. 2: the circuit diagram for the complete controller. Calibration of the
temp-erature input (based around IC5b and using VR1) is not covered in the text
but is menu-driven and will be self-explanatory when this menu is displayed.
Voltage setting (using VR2) is important and is fully covered in the text.
AUGUST 1999 19
Parts List
1 PC board, code 07408991
1 Plastic instrument case 200mm x 160mm x 70mm
4 3 way PC board mount screw terminals
5 2 way PC board mount screw terminals
1 9 pin male right angle PC board mount D connector (P1)
1 25 pin female right angle PC board mount D connector (J1)
1 DC chassis socket (to match plug pack)
2 200 ohm horizontal trimpots (VR1, VR2)
1 3.6864MHz crystal (X1)
1 28 pin 0.3" IC socket (can be 2 14 pin sockets)
6 PC stakes
4 No 4 x 6mm self tapping screws
1 LED mounting clip
Hookup wire
Semiconductors
1 PIC16C73A-04/P pre-programmed microcontroller (IC1)
1 93LC46B 64 x 16 bit EEPROM (IC3)
1 MAX232 RS232 transceiver (IC2)
1 ULN2003A solenoid driver (IC4)
1 LM317T 3-terminal regulator (REG1)
1 LM358 dual op amp (IC5)
5 4N28/4N25 optocoupler (IC6 - IC10)
1 5mm green LED (LED1)
1 1N4004 1A diode (D1)
5 1N4148 signal diode (D2 - D6)
2 18V 1W zener diode (ZD1,ZD2)
Capacitors
1 470µF 25VW PC electrolytic
6 10µF 16VW PC electrolytic
1 1µF 16VW PC electrolytic
4 0.1µF monolithic (code 100n or 104)
2 .01µF ceramic (code 10n or 103)
2 22pF ceramic
(code 22p or 22)
Resistors (0.25W, 1%)
1 120kΩ 1 30kΩ
9 10kΩ
1 1.5kΩ
1 1.3kΩ
5 560Ω
2 6.2kΩ
1 620Ω
3 2kΩ
1 330Ω
2 1.8kΩ
1 240Ω
A pre-programmed PIC16C73A microcontroller and a 93LC46B EEPROM
are available for $30.00 including postage (cheque or money order) within
Australia from L. Williams, 14 Powell Street, Bungendore NSW 2621. email
lmwill<at>alphalink.com.au, http://www.alphalink.com.au/~lmwill
blocks, noting that there are 2-way
and 3-way types. Follow these with
the PC stakes and finally the two D
connectors.
With the PC board complete, place
it on the pillars in the bottom righthand half of the case. You will find
that some of the pillars are directly
under soldered connections and the
PC board does not sit flat. The solution is to remove the offending pillars
with a large pair of side cutters or drill
them out.
Now comes the tricky part: you
need to mark and cut out the rear
panel so that the two D connectors
protrude through it with enough room
around them to clear the mating cables. Slide the rear panel into its slot,
place the PC board up against the rear
panel and mark where the rectangular
cutout should be.
Take your time with the cutout.
Although the plastic is soft, forcing
the cuts can easily break the panel.
Before installation, drill a suitable
hole and mount the DC power supply
socket on the rear panel.
You will also need to drill a 10mm
hole in the rear panel and fit it with
a grommet so that you can easily run
wiring into the case at a later stage.
The lefthand side of the case has
ample room for interfacing circuits.
Once this is done, place the rear
panel into the slot in the bottom half
of the case and screw the PC board
down with four self-tapping screws.
Drill a hole in the front panel for the
LED, install it with a mounting clip
and then slide the panel into the
bottom case half. Wire the LED and
the DC input socket to the PC board
stakes with hookup wire, noting that
they are polarised.
DC supply adjustment
The power supply input voltage
is nominally 9V DC but a 12V DC
plugpack will be acceptable. The
circuit draws about 40mA at 9V and
REG1 should not normally require a
heatsink with this voltage.
Construction
Before you start assembly, check
the PC board for any faults, especially
where the tracks run between IC pads.
Check also that all the PC board holes
are correctly drilled.
Refer to the component overlay
diagram of Fig.3 and solder the resistors in first. If in doubt use your
20 Silicon Chip
multi-meter to check each value.
Install the IC sockets and the
trimpots, followed by the capacitors,
double checking that the electrolytics
are in the correct way.
The diodes can be installed next,
again checking their polarity. Install
the voltage regulator, the crystal and
all the ICs except for the PIC which is
plugged into its socket later on.
The ICs don’t all face the same way,
so study the component overlay closely. Any mistakes here could result
in PSD (premature semiconductor
death).
Install the PC-mount terminal
Leave the PIC chip out of the socket
at this stage. Adjust trimpot VR2 to
its mid position and plug the power
supply into the DC socket. Using a
digital multimeter, measure the power
rail (Vcc); it should be around 5V.
If not, switch off immediately and
check your work. Look for shorts or
components in the wrong way or
simply that the DC connector is wired
incorrectly.
Once everything is OK, adjust
VR2 until Vcc is exactly 5.12V. The
accuracy of the voltage measurements
depends on the setting of Vcc. The expected calibrated accuracy is ±100mV.
The resistors in the input atten-uators can also introduce some errors
but with 1% values the accuracy of
measurements should be acceptable
under most circumstances.
Turn off the power and insert the
PIC micro. Now comes the big moment – turn on the power again. The
LED should come on for a few seconds
and then flash slowly with a period
of about five seconds. The flashing
is good news; the microcontroller is
alive and well! Turn the power off
again.
Initial set-up
Now that you have your Remote
Modem Controller built, it can only
be accessed by entering a correct
password. The password is stored in
the EEPROM along with the speed
and other system data. When the unit
is powered up for the first time, the
EE-PROM contents and hence the
password, are unknown. We need
a way of bypassing the unknown
password and this is done with the
default operation.
When the unit is powered up it
senses the state of the default pins
and if they are shorted, the EEPROM
is programmed to set the speed to 9600
and the password to 123456. Note that
this default operation requires physical intervention at the actual unit and
cannot be done remotely.
Follow the steps below to set the
password and speed for the first time:
1. Power up the PC and run the terminal emulation software. This can
be Windows 3.1x or Windows 95
Hyperterminal, for example. Set
the communications parameters
to 9600bps, 8 data bits, no parity
and 1 stop bit.
2. Connect the PC to the RMC with a
9 to 25-pin cable. The 25-pin end
plugs into the RMC.
3. Short the default pins and apply
power. Note that a default mode
message is displayed on the PC
screen. You will also be asked to
remove the link and press any key
to continue.
4. Remove the link on the default
pins. If you do not remove the link,
the message will be displayed
again after a key is pressed. This
will continue until the link is removed and is protection against
the possibility of leaving the link
in place.
5. Press any key as prompted. The
Setup menu will be displayed.
If a key is not pressed within 30
seconds, the default operation is
aborted.
6. Enter P to access the Password
sub-menu and then C to change
the password.
7. Enter your new password. It must
be six characters long, can be any
combination of printable ASCII
characters and is case-sensitive.
Press S to store the password and
return to the Setup menu.
8. Press S to access the Speed submenu. Select the desired speed,
by pressing 1, 2 or 3 and then M
to return to the Setup menu.
9. Press M to go to the Main menu,
then L to logoff and finally press
Y when prompted.
10. Turn the unit off for 10 seconds
and then on again.
11. If you have changed the speed
from the default of 9600, change
the PC speed to suit. You will
now see the letters AT appear on
the screen. This will be the unit
training the connected device
to the correct speed. Press the
letters OK within two seconds of
AT appearing. If you are too slow,
AT will be displayed again in five
seconds.
12. Type in the word LOGIN (upper
or lower case) to log into the unit.
You will be asked to enter the
password.
13. Type in the new password exactly
as entered above.
14. If the password and speed are
correct, the RMC opening banner
will be displayed. Press any key
as prompted.
15. The Main menu will be displayed.
Note the message indicating that a
power reset has occurred. This is
only displayed if there has been a
power off/on cycle since the last
login time.
16. Enter L to logoff but enter N to
cancel when prompted. The Main
menu is displayed again and note
that the power reset message has
disappeared. The password and
speed settings can be changed
anytime in the future, once you
are logged on.
Modem and cables
The RMC should work with just
about any modem as long as it is
AT command set compatible. This
means that you ‘talk’ to the modem
by sending it commands preceded
by the AT attention sequence and the
modem responds to these commands.
Although modems that are AT-compatible are basically all the same,
there are differences between them
Table 1: Resistor Colour Codes
No.
1
1
9
2
1
2
1
1
1
5
1
1
Value
120kΩ
30kΩ
10kΩ
6.2kΩ
2kΩ
1.8kΩ
1.5kΩ
1.3kΩ
620Ω
560Ω
330Ω
240Ω
4-Band Code (1%)
brown red yellow brown
yellow black orange brown
brown black orange brown
blue red red brown
red black red brown
brown grey red brown
brown green red brown
brown orange red brown
blue red brown brown
green blue brown brown
orange orange brown brown
red yellow brown brown
5-Band Code (1%)
brown red black orange brown
orange black black red brown
brown black black red brown
blue red black brown brown
red black black brown brown
brown grey black brown brown
brown green black brown brown
brown orange black brown brown
blue red black black brown
green blue black black brown
orange orange black black brown
red yellow black black brown
AUGUST 1999 21
Fig. 3: all components, with the exception of the “data” LED and the DC power
socket, mount on the PC board. Terminations are made directly to the screw
terminals while the modem and PC connections are via rear-panel sockets.
and so you will need to check your
modem user manual and ensure that
it is configured correctly.
The RMC needs to detect the string
RING to indicate an incoming call
from the modem and the string CONNECT to indicate that the modem has
made a connection to the remote PC.
As a result, the modem must be configured to enable the call progress results
in verbal form (typically ATV1). The
RMC forces the modem off-line at the
end of a call by turning the DTR line
off. The modem must be con-figured
to return to command mode when
the DTR line is taken low (typically
AT&D2).
The speed at which a modem talks
to the connected PC can be configured
in a number of ways. The RMC has the
ability to remotely change its speed
in the Setup sub-menu. If the modem
was set to a permanent speed and the
RMC speed was changed, the two
22 Silicon Chip
could never communicate. To avoid
this situation, the RMC sends the
command AT to the modem to train
the modem to the new speed.
This is done after power up every
five seconds until answered with OK
and in call-waiting mode every 30
seconds but does not require the OK
response. The modem therefore must
be programmed so that it monitors the
PC data and sets its interface speed to
that of the PC (typically AT&I1).
Note that this does not refer to the
actual data rate between the modems
but the speed at which the modem
talks to the RMC. This is often referred
to as ‘auto-bauding’.
The other important modem settings are asynchronous operation
(typically AT&M0) and no-flow control (typically AT&K0). The RMC does
not provide a modem RTS signal and
if the modem is set for RTS/CTS flow
control, the modem will not send and
receive properly.
Also you need to ensure that there
are at least two rings, before answering so that the string RING can be
detected. This is normally set in S register 0. All these settings will probably
be invoked by forcing the modem into
its default configuration (typically
AT&F), but as indicated, not all modems are the same. Remember to store
the modem settings in non-volatile
memory with the AT&W command
after you have made your changes.
The RMC has two ports. The first
is the 9-pin male D connector for the
modem. Only four signals are used:
Receive Data from the modem (pin
2), Transmit Data to the modem (pin
3), Data Terminal Ready (pin 4) and
Signal Ground (pin 5). The second
port is a 25-pin female D connector
which is used to connect directly
to a PC. Only three signals are used:
Transmit Data from the PC (pin 2),
Receive Data to the PC (pin 3) and
Signal Ground (pin 7).
RTS and CTS are looped and DSR,
DTR and CD are also connected together internally. You can easily make
up your own cable but the interfaces
have been designed to support a
standard 9-pin to-25 pin PC to modem cable.
The input Data (Pin 2) of each D
connector is connected in parallel, so
ensure that only one cable is plugged
in at a time to avoid loading the RS232
drivers in the modem and PC.
Operation and menus
Using the RMC is very easy. From
the menu system all functions are
accessed with a single keystroke,
without the need to use the Enter key.
As discussed before, when the unit is
powered up it sends out the letters AT,
waiting for an OK response.
This OK will come automatically
from a modem if it is powered on
and connected, but if you have the PC
connected you will need to enter this
manually. After a call is finished, the
unit polls the connected device every
30 seconds, again with the letters AT.
This is done to avoid a problem
that could arise if the unit is powered
up but the modem is powered off
and then on. In this case it could be
poss-ible for the unit and the modem
to be ‘talking’ at different speeds. The
30-second spaced AT makes sure that
the modem is at the correct speed
when a call comes in. Incidentally,
Looking from the rear to the front panels across the PC board. As you can see, there's plenty of room inside the case if you
wish to add in other sensor/controller devices. Power is from an external 9V DC plugpack, closely regulated on board.
the temperature is read at this point,
updating the minimum and maximum
temperature settings.
If you are directly connected, you
need to type the letters LOGIN in upper or lower case to access the unit. If
it is connected to a modem and a call
is detected, it sends ATA and raises
the DTR signal. One or both of these
steps may not be necessary, especially
if the modem is set to auto-answer,
however it is good insurance. In any
case, the DTR signal should be used
to drop the modem off line at the end
of a call.
When the unit has answered the
call, it waits 30 seconds for the CONNECT message from the modem. If
this fails to be recognised within the
30-second period, the call is aborted.
When either the login command has
been entered from a PC or the connect message has been received from
the modem, the password prompt is
displayed.
Here you are given two chances
to enter the password correctly. The
password must be entered within 30
seconds and is case-sensitive. If the
password is twice entered incorrectly,
the call is aborted. Once the password
is entered correctly the opening
banner is displayed. You are asked
to press any key to proceed. Once a
key is pressed, the Main Menu is displayed. If a key is not pressed within
30 seconds the call is aborted.
If there has been a power failure
since the last call or log in, a message
will be displayed indicating that there
has been a failure, that the outputs
are turned off and the Event counter
has been reset.
This is done to avoid possible dangers that could be caused by turning
the outputs on again when the power
is restored, if it has been off for a long
period. Also the Event counter could
provide a meaningless result if lots
of events were missed during this
period. This message is not displayed
again during this call.
Each of the sub-menus are accessed
from the Main menu by pressing the
first letter (in brackets) of the submenu required. There is a programmable idle timeout on the menus
–selected in the Setup menu.
If you are in a sub-menu and a
character is not entered within the
timeout period, you will be asked to
press any key to continue.
If a key is pressed you will be returned to the Main menu, however if
a key is not pressed within 30 seconds
the call will be aborted. If you are in
the Main menu and no characters are
entered within the timeout period you
will be advised that the idle timer has
expired and you are asked if you want
to continue.
Again pressing any key will restart
the timer and if there is no response
to this question within 30 seconds the
call is aborted.
AUGUST 1999 23
The rear panel is positively spartan with a DB25 socket (computer connection),
DB9 socket (modem connection) and a 2.1mm DC power socket. The grommeted
hole (right side) is for cabling which connects to the internal terminal strips.
Fig. 4: this full-size front panel artwork
can be copied and glued to the front
panel and/or used as a drilling template.
In the Volts measurement screen, the
voltages on the two analog inputs are
measured and the results displayed.
Pressing the letter U forces a new measurement and updates the screen while
pressing M returns you to the Main
menu. If the input voltage is measured
24 Silicon Chip
as being over 20V then an OVER V
warning message is displayed.
The Input screen shows you the
state of the four inputs as being ON
or OFF. Again pressing the letter U
updates the screen and ‘M’ returns
you to the Main menu.
The outputs sub-menu allows you
to individually turn each output on
or off by pressing 1, 2, 3 or 4. Each
time the number is entered the corresponding output changes state and
the screen is updated. As long as the
power to the unit is not removed between calls, the outputs will remain
unaltered. Pressing M once again
returns you to the Main menu.
The Event counter is displayed in
the Events sub-menu. If the counter
has passed 255, the word OVERFLOW! will be displayed. The result
can be reset to zero by entering the
letter R.
Pressing U will update the display
and pressing M returns you to the
Main menu.
Entering T moves you to the temperature sub-menu. Here the current
temperature is displayed as well as
the maximum and minimum temperature since they were last reset.
Pressing R resets the maximum
and minimum temperatures to be
the same as the current temperature.
Pressing U updates the display and
M returns you to the Main menu.
Entering the letter L tells the unit
that you wish to end the call, however it asks if you are sure. If you wish
to continue, press the Y key or the N
key to end the call.
To access the Setup menu, enter
the letter S. The same technique is
used here as in the Main menu; ie, the
first letter of the required function is
entered to access that function.
Pressing P takes you to the password screen where you are shown
the current password. Pressing M
returns you to the Setup menu, while
pressing C opens the change password screen. The password must be
six characters long and can be any
printable characters. For example
&%Re1Z would be acceptable...if you
could only remember it!
If you make an error press R to clear
your entry and try again. When you
are finished press S to store it and
return to the Setup menu. Only if S is
entered at this point, will the currently stored password be overwritten.
The speed screen allows you to
select 300bps, 2400bps or 9600bps by
entering 1, 2 or 3. While this is primarily included to match to the speed
of the interface, ideally it should also
match the modem line speed.
For example, if your modem is
an older type with say a maximum
speed of 2400bps then select 2400 as
your speed. Press M to return to the
main menu.
Note that the new speed selected
does not take effect until the present
call is finished.
The Event trigger screen allows the
selection of the edge that the internal
PIC counter is incremented. An on to
off signal into the Events optocoupler
results in a rising edge input, while
an off to on signal results in a falling
edge input to the counter.
Enter a C to change the trigger and
update the screen or M to return to
the Setup menu. This feature is handy
if you are trying to capture a state
change (high to low or low to high)
rather then counting a series of pulses.
To do this you would select the edge
required and then go to the Events
menu and enter R to reset the count
to zero. A count of 1 would indicate
that the edge has occurred.
Pressing I takes you to the Idle
timer screen. You can choose 1, 15 or
60 minutes by pressing 1, 2 or 3. The
Idle timer will disconnect the call if
a key has not been pressed within the
timeout period.
Without the Idle timer, it could
be possible for the RMC to hold the
tele-phone line in a busy state or not
allow you to log in again if you did
not log off properly. The default value
is one minute.
Input/Output testing
Access the Input menu and verify
that all inputs are off. Connect a power
supply of 5V to Input 1. Update the
screen and check that Input 1 is on.
Remove the power supply, update the
screen and check that input 1 is off.
Repeat this procedure for the other
inputs.
Go to the Outputs menu and turn
all the outputs off if not already done.
Connect a LED in series with a 220Ω
resistor between +5V and output 1,
with the anode of the LED connected to the +5V terminal. Check that
the LED is off. Turn output 1 on and
check that the LED comes on. Repeat
this procedure for the other outputs.
In the Setup menu, select the Event
trigger sub-menu. Change the trigger
to OFF to ON if not already done.
Return to the Events menu and reset
the counter. Connect 5V to the Events
connector. Update the display and
check that the counter has increm-ented to 1.
Remove the power supply, update
the display and check that the counter
has not changed. This verifies that the
counter has incremented on the OFF
to ON edge.
If any of these tests fail, you will
need to check the circuit around the
faulty input or output.
Installation
The RMC is intended to sit alongside the modem or PC and connect us-
Fig. 5: even if you purchase a commercial PC board, this same-size pattern can
be used to check the tracks before assembly. Many readers still make their own
boards from these patterns, too.
ing a standard PC to modem interface
cable. If you connect to a modem and
have it powered on and connected in
parallel with the telephone line, it
will answer incoming calls and override your telephone.
To avoid this problem, leave the
modem disconnected while you are
at home.
If you are away and you have the
RMC and modem enabled and someone else unknowingly calls your telephone, the call will be automatically
answered.
The caller will hear the modem
tones but the RMC will time-out
after 30 seconds and release the call,
because the password won’t have
been entered.
Security & safety
The RMC is equipped with a 6-digit
password. No commands will be
accepted until the correct password
is decoded.
If the password is entered incorrectly, the caller is offered a second
attempt. If this second attempt fails,
the call is aborted automatically. The
caller has to connect again and retry
the password.
While this provides a high degree
of security, it is not impossible for
a ‘hacker’ to eventually crack the
password and gain access to the RMC.
It is therefore recommended that
the RMC not be used in situations
where damage to property or personal
injury could occur because of unapproved access to the system.
The RMC input and output circuits and PC board are not intended
to control mains voltages (240VAC)
directly. While optocouplers are used
for some inputs, they are included for
DC isolation and limited overvoltage
protection of the PIC inputs only.
If control of 240VAC devices is
required, then suitably rated external
relay circuits will be needed.
SC
AUGUST 1999 25
|