Morse code identification unit
Here’s a low-cost programmable Morse code identifier unit for
use in amateur repeater stations/beacons. It utilises a PIC microcontroller, a
discrete filter and a common op amp to generate an audio output for the CW
tones. Up to 64 bytes (meaning 64 dits, dahs or spaces) can be stored in the
PIC’s non-volatile memory.
Most of the work is performed by IC1 (PIC16F84A) which runs at
4MHz. Port A is configured as an input, whereas Port B is configured as an
output with all pins initially set low. The program continually monitors the RA0
(pin 17) input, which is normally held high by a 22kΩ resistor tied to +5V. A
10nF capacitor and 1kΩ resistor connected to this pin suppress RF interference
from the outside world and provide some protection for the PIC’s input port.
When RA0 is pulled low (via pin 3 of CON1), the program sets
RB0 to a high state, which switches on transistor Q1 and relay RLY1. Diode D1
suppresses back-EMF generated voltage spikes.
The PIC program then reads the data stored in EEPROM and
translates it into a dit, a dah, or a space. Each byte of data is encoded as
follows: 00 is a dit, 01 is a dah, and 02 is a space. A data value greater than
02 signals the end of the data block, causing the micro to write a low to RB0 to
switch off the relay. The program then loops back to the beginning to wait for
the next low on the TRIGGER input.
The CW tones are output on RB1 as a square wave. To remove
undesirable harmonics, a low-pass filter comprised of three 1kΩ resistors and
100nF capacitors converts the square wave into a reasonable quality sinewave.
The resultant signal is buffered and amplified by an LM741 op amp (IC2).
IC2 is configured as an inverting amplifier, so its voltage
gain is set by the 10kΩ input and 22kΩ feedback resistors. This gives a gain of
2.2 and about a 1V p-p signal at the output with the wiper of VR1 set to
maximum. It is possible to increase this level by replacing the 22kΩ resistor
with a larger value, to a maximum of about 82kΩ. Exceeding this value will
result in the output signal being clipped and therefore distorted.
Power can be provided by a 12V DC unregulated source, which
directly supplies the op amp and relay circuit. A 7805 3-terminal regulator
brings this down to +5V to power the PIC microcontroller.
;***************************************************************************************
;* Morseident.bas Version 2.0 01/06/2005
;***************************************************************************************
TRISA = %11111 'set PORT A as inputs
TRISB = %00000000 'set PORT B as outputs
A VAR byte
D VAR BYTE
LET PORTB = 0
eeprom 0,[02,02,00,00,00,01,02,01,00,01,02,00,00,01,01,01,02,01,02,00,00,02,01,01,02,02]
:standby
IF PORTA.0 = 1 then standby 'wait for button press on PIN 0, port A
:transmit
HIGH PORTB.0 'close TX relay
gosub vk2tim
LOW PORTB.0 'open TX relay
GOTO standby
:dit
SOUND PORTB.1,[120,05] 'DIT
PAUSE 100
return
:dah
SOUND PORTB.1,[120,20] 'DAH
PAUSE 100
return
:space
PAUSE 200 'SPACE
return
:vk2tim 'read CW information from EEPROM
for a = 0 to 63 step 1
read a,d
IF d = 00 then gosub dit
IF D = 01 then gosub dah
IF d = 02 then gosub space
NEXT a
Return
Source code
The complete program for the PIC micro appears in the
accompanying listing and is self-explanatory. It is written in PICBASIC and
therefore must be compiled into "HEX" file format before being programmed into
the micro’s FLASH and EEPROM.
The author compiled the code using Microcode Studio, although
any PICBASIC compatible compiler would be suitable. Check out the commercial
compilers at www.dontronics.com or
search the ’net for various free or limited editions.
The "eeprom" line in the listing contains the actual message
data and this should be changed to suit your installation. Up to 64 dits, dahs
or spaces can be crammed into a PIC16F84A, while a PIC16F628A will hold a
further 64. If you use the code as the basis of your own design, please include
a credit to the author.
James Cutler, VK2TIM,
Werrington, NSW.
Automatic soldering iron controller
After leaving my soldering iron running all night a couple of
times, I developed this simple circuit to automatically switch it off when
nobody is around. A PICAXE micro (IC1) monitors the output of a PIR sensor that
is "watching" the workshop and as long as movement is detected, the soldering
iron remains powered up.
However, if no movement is detected for 15 minutes, the iron is
switched off via RLY1, which controls the 240VAC mains active line to the iron
via its normally-open contacts. In case the operator is still in the area, the
piezo transducer sounds an alarm 30 seconds before the time-out period.
To operate initially, simply press the "ON/OFF" switch (S1),
which is monitored on input 3 (pin 4) of the micro. The micro then generates a
"beep" and starts a 15-minute timer (see program listing). Whenever input 1 (pin
6) of the micro goes low within the timing period, the timer is restarted.
A variety of sensors could be used to trigger input 1 and
restart the timer. Active-low devices are wired via diode D2, which prevents
anything higher than +5V being applied to the PICAXE input. Active-high devices
are handled by transistor Q1, which acts to invert the signal before applying it
to the same input.
The power supply is the standard bridge rectifier (BR1), filter
capacitor and 3-terminal regulator (REG1) combination, providing +5V to power
the circuit. Make sure that the relay contacts are rated for 250VAC operation
and exercise the usual care with all mains wiring. Jeff Monegal,
North Maclean, Qld. ($50)
;*********************************************************************************
; Automatic Soldering Iron Controller PICAXE-08 Vers 1.00 12 June 2005
;*********************************************************************************
symbol iron = 2 'soldering iron control relay on this pin
symbol pir = pin1 'PIR (or other) people detector on this pin
symbol timer1 = w0
symbol timer2 = b9
low iron
start:
if pin3 = 0 then pressed
pause 50
goto start
pressed:
pause 50 'debounce the button
if pin3 = 0 then yes_pressed
goto start
yes_pressed: 'system has now been turned on by operator
high iron 'so turn the soldering iron on
sound 4,(100,15,85,20)
timer1 = 0
time_loop:
if pir = 0 then clr_timer
pause 500
timer1 = timer1 + 1
if timer1 > 1800 then time_out '1800 equals about 15 minutes
if pin3 = 0 then but_press
goto time_loop
clr_timer:
timer1 = 0 'reset timer 1
timer2 = 0 'reset timer 2
goto time_loop
time_out:
timer2 = 0
cont_lp:
if pin3 = 0 then oper_can ‘button press cancels time out
if pir = 0 then clr_timer 'the people detector has activated
to_lp:
if timer2 > 23 then times_up 'this number equals a time of about 30s
sound 4,(50,10,40,30)
pause 1000
timer2 = timer2 + 1
goto cont_lp
times_up:
low iron 'time has run out so switch off the iron
pause 100
goto start
oper_can:
pause 50 'debounce the button
if pin3 = 0 then tmr_reset
goto to_lp
tmr_reset:
sound 4,(90,15,65,20)
goto clr_timer
but_press:
pause 50
if pin3 = 1 then time_loop
low iron 'switch off the soldering iron
switch_off:
pause 50 'wait until the button is released...
if pin3 = 1 then start '...before restarting the program
goto switch_off
|
Improved speed alarm sensor
The electromagnetic induction sensor described with the Speed
Alarm (SILICON CHIP, Nov. & Dec. 1999) works
well on rear-wheel drive vehicles but can be problematic on some front-wheel
drive models.
In rear-wheel driven vehicles, the tail shaft typically rotates
about 2.5 times faster than the wheels and does not move up and down much
relative to the chassis at the gearbox end. This makes it easy to mount a
pick-up coil in a position that will maintain a reasonably constant distance
from the rotating magnets.
Unfortunately, the small drive shaft diameter and its slower
rotational speed in front-wheel driven vehicles make it difficult to get an
adequate signal from the sensor. In addition, readily accessible points on the
drive shaft usually have large movements relative to any practical attachment
point for the pick-up coil.
For use as a 50km/h warning around local suburban streets, I
found that the sensor could be dispensed with and an input from the ignition
points (suitably attenuated) used instead. To make this arrangement work, a
microswitch was fitted to the gear lever so that the unit operated only when in
fourth gear.
This worked well but when I switched to a vehicle with
auto-mat-ic transmission, the marked difference between engine and road speeds
meant reverting to a driveshaft sensor. My design for an improved version
was made as follows:
First, extract eight small cylindrical magnets (6mm dia. x 4mm
long) from a "Magnetix"TM
toy, available from K-Mart. These magnets are very
strong for their size and are set flush (all with the same polarity) in holes
round the flat face of a 60mm dia. x 20mm thick wooden disc, which also has a
central hole to match the driveshaft’s diameter. Two holes are drilled through
parallel to the faces to accept 4-5mm screws and the disc is then sawn through
at right angles to these holes, so that the disc can be clamped around the drive
shaft.
A proportional Hall-effect sensor (UGN3503U) is potted with
epoxy inside a piece of brass tube with a flat brass shim soldered to one end.
Before potting, its three leads are shortened and soldered to flying leads, so
that the solder joints will be buried in the epoxy. The flat (active) surface of
the sensor must be positioned against the shim.
The completed sensor assembly is held on a wooden arm, which is
a running fit on the shaft. This is again split, so that it can be mounted next
to the magnet disc. The arm is long enough to rest against part of the front
suspension so that it cannot rotate forwards and a light spring stops it from
going too far back when in reverse.
This method ensures that the sensor is always at the correct
distance (about 3mm) from the magnet disc. A plastic collar is wired to the
shaft to keep the disc and arm close together.
The idea of a wooden bearing on a steel shaft may seem a touch
medieval but well-oiled wood is an excellent bearing surface and the load here
is very small. The photos show the disc and sensor arm separately and mounted
side by side on a short dummy axle.
All three leads from the UGN3503U must be cabled back to the
speed alarm box, with the supply and ground pins of the sensor connected to the
+5V and ground rails at any convenient point on the alarm’s PC boards. The
output of the sensor goes to the inverting input of comparator IC2a via the
existing 1kΩ resistor. With no magnet nearby, its output sits at 2.5V and goes
up or down (depending on polarity) by about 0.5V as the magnets pass by.
As the bias voltage on the non-inverting input of IC2a also
sits at 2.5V, it will need to be altered to get a reliable signal at the
comparator’s output. This can be achieved by replacing one of the 2.2kΩ
resistors (connected to the anode of D3) with a 1.8kΩ resistor; the polarity of
the magnets determines which of the two 2.2kΩ resistors needs to be
replaced.
One major advantage of using a Hall-effect sensor over the
original induction sensor is that its output pulse amplitude does not depend on
how fast the magnets pass the sensor.
Robin Stokes,
Armidale, NSW. ($40)
|
The following downloads are available for this article:
|