This is only a preview of the April 2022 issue of Silicon Chip. You can view 47 of the 120 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 "500W Power Amplifier, Part 1":
Articles in this series:
Items relevant to "Railway Semaphore Signal":
Items relevant to "Update: SMD Test Tweezers":
Items relevant to "Capacitor Discharge Welder, Pt2":
Purchase a printed copy of this issue for $11.50. |
Semaphore
Signal
For OO Gauge Model Railways
This realistic-looking OO Gauge Semaphore has been modelled on a real
British semaphore. It has a red/white ‘flag’ that tilts down by 45° and lights a
green LED to signal an oncoming train to continue, or is horizontal with a red
light, indicating it should stop. It’s made from parts that are relatively easy to
obtain, although it requires some machine tools and experience to build.
S
emaphore signalling was one of
the first signalling systems used
by railways. Semaphore signals
were first patented in England in the
early 1840s. They were so successful
that they were adopted throughout
the railway world. With the advent
of coloured lights, they were slowly
replaced, but a few remain in use. Adding them to a model railway makes it
look very realistic.
British signals come in two forms:
lower and upper quadrant. Lower
quadrant signals pivot the arm downwards for the off indication (trains
can pass), while upper quadrant signals pivot the arm upwards for off. I
decided to make a lower quadrant signal as most of the old signal photos I
found showed this form.
Current British practice mandates
that semaphore signals, both upper
and lower quadrant types, are inclined
at 45° from horizontal to indicate ‘off’.
50
Silicon Chip
The British semaphore signal arm
consists of two parts: a timber or metal
arm (or ‘blade’) that pivots at different angles and a ‘spectacle’ holding
coloured lenses that move in front of
a lamp so the signal is visible at night.
To save having to make coloured
lenses, the lamp is replaced with a
3mm red/green bicolour LED in the
model. When the arm is horizontal, the
red colour is switched on, and when it
is down, the green colour is on.
A miniature servo motor moves the
signal arm up and down (see Fig.1).
The servo collar is connected to the
connecting rod (#10), which in turn
is connected to the lever (#3). When
the servo moves through 45°, the connecting lever does the same. As the
connecting lever is joined to the signal blade by the pin (#4), the signal
BY LES KERR
Australia's electronics magazine
blade follows the movement of the
servo collar.
In real life, the height of the signal
blade above ground was determined by
how far away it could be seen from an
approaching train. If you only have a
small layout, you can easily lower its
height to make it look to scale. This
is done simply by reducing the length
of the connecting rod (#10) and the
mounting pole (#11).
We will present details of both the
mechanical and electronic assembly. Just about any hobbyist should
be able to assemble the control board
as it is a simple single-sided design
using all through-hole parts. However, note that making the parts for
the mechanical assembly will require
some machining experience and some
advanced tools.
Specifically, you will need a lathe;
just about any small one will do,
as long as it’s built to reasonable
siliconchip.com.au
Fig.1: this shows in detail what the Semaphore Signal looks like when it’s assembled and where all the pieces go. It’s
essential to refer to this diagram during each construction step to make sure the parts go together correctly.
tolerances. Most of the machining
involves either brass or aluminium,
both of which are relatively soft. You
will also need a precise drill press and
a good selection of drill bits.
While you can probably get away
without it, to produce an exact copy
of the Semaphore presented here, you
will also need a basic mill with an end
mill tool, and the knowledge and ability to use it.
A video showing the Semaphore in
operation: siliconchip.com.au/Videos/
Model+Railway+Semaphore+Signal
Circuit description
The straightforward controlling circuit is shown in Fig.2. The speed at
which a servo motor rotates is a function of the servo itself. In the case of
the semaphore signal, we need it to
rotate much slower than its maximum
speed to make it look realistic. This is
achieved by feeding a series of pulses
to the servo’s control terminal, with a
time delay between each pulse.
When the up/down switch (S1) is
siliconchip.com.au
moved to the up position, digital input
RB0 of microcontroller IC1 (pin 6) goes
high, causing the microcontroller to
produce a series of such pulses at its
digital output RB1 (pin 7). The result
is that the servo motor moves slowly
clockwise by 45°. At the same time,
digital output RB2 (pin 8) is brought
high and output RB5 (pin 11) low,
causing the red LED to light.
The 100nF capacitor from pin 6 of
IC1 to +5V stops any contact bounce
produced by the switch. If the switch
is returned to the down position, RB0
is pulled low by the 10kW resistor,
resulting in another series of pulses
from output RB1 that return the servo
motor to its original position. At the
same time, output RB2 goes low and
output RB5 high, resulting in the LED
changing colour back to green.
Servo motors are not as accurate as
stepper motors when moving through
a specific angle, being out by as much
as 10%. Similarly, any variation in the
position of the signal blade hole, the
LED plate or the connecting lever and
Australia's electronics magazine
The finished Semaphore will look like
this, with wires connected to the PCB.
April 2022 51
Fig.2: the control circuit, which runs from a 5V supply, is quite simple. Microcontroller IC1 monitors switch S1 and,
depending on its position, sends pulses to the servo to control its angle while lighting either the red or green elements of
LED1. Trimpots VR1 & VR2 fine-tune the angles of the flag in the horizontal and down positions, respectively.
the servo collar can produce errors.
To solve this, two 1kW trimpots are
provided. The first varies the position
of the signal blade in the horizontal
position, and the second in the 45°
down position. The trim potentiometers vary the voltage on analog inputs
RA0 and RB7 of IC1 (pins 17 & 13,
respectively). These feed into IC1’s
internal analog-to-digital converter
(ADC) which converts the voltages
into numbers.
The microprocessor uses these values to determine the pulse widths to
produce in the two static positions.
Mechanical assembly
Many of the mechanical Semaphore
parts need to be made, and the details
of these are shown in Fig.3 (#1-9) and
Fig.4 (#10-14). They are made as follows.
#1 Cap and cap pin
I turned the cap from a piece of 6mm
aluminium rod by mounting the rod
in the three-jaw chuck of a lathe, facing the end (ie, squaring it off) and
turning down the diameter to 5.2mm
for 5mm. I then cut the 127.6° taper.
I reversed the job in the chuck and
parted it off to 3mm, then used a centre drill followed by a 2mm drill to a
depth of 2mm, taking care not to break
through to the taper.
I made the cap pin from an 8mm
length of 2mm rod, glued in the
hole I drilled in the cap using Loctite GO2 (available from Bunnings).
The shape of this item isn’t critical,
as it varied between different signal
52
Silicon Chip
manufacturers. Paint the cap assembly red.
#2 LED plate
I made this from a piece of 1/32-inch
(0.8mm) thick brass sheet. The distance
between the holes is the critical dimension. Drill the holes, then cut the plate
to size. Finally, clean up the edges.
#3 Connecting lever
This was made from a piece of
1/16-inch (1.6mm) thick, 1/4-inch
(6.35mm) wide brass. Again, the distance between the holes is critical.
Drill the holes first, then cut and file
the lever to size. Paint the connecting
lever blue-black.
#4 Pin
Cut a piece of 1/16-inch (1.6mm)
diameter steel rod to a length of 11mm.
Clean up any burrs on the ends.
#5 Pillar (4 required)
Similarly, I made these from 0.8mm
diameter (1/32-inch) brass rod cut to
12mm in length. Again, clean up any
burrs on the ends.
#6 Railing
This was also made from 0.8mm
(1/32-inch) diameter brass rod. I
turned a short length of scrap round
to 11.2mm diameter and used that as
a mandrel to form the curve. A small
amount of heat applied by a gas torch
makes bending easier.
#7 Platform base
This is made from a piece of 1/32inch (0.8mm) brass sheet. Drill all the
holes, then cut the plate to size. Next,
using a fine saw and file, cut out the
square section so that it is a tight fit
around the 1/8 inch square mounting
Australia's electronics magazine
pole (see #11 below). Finally, clean
up the edges.
#8 Ladder support
This is made from a length of 0.8mm
(1/32-inch) diameter brass rod. Use a
piece of 1/8-inch (3.2mm) square brass
as a mandrel to form the shape. Again,
a small amount of heat applied by a
gas torch makes bending much easier.
#9 Support
Place a piece of 12mm diameter aluminium rod in the three-jaw chuck of a
lathe and face the end. Turn it down to
20mm to make it a slide fit in a 3/8-inch
(9.5mm) diameter hole. Use a centre
drill followed by a 4.3mm (11/64-inch)
drill to bore it out to a depth of 20mm.
Next, reduce the end to 5.25mm diameter for 8mm and part it off to length.
Finally, drill and tap the hole in the
side for the 2.5mm grub screw. Paint
the support blue-black and when dry,
then fit the 2.5mm grub screw.
#10 Connecting rod
I made this from 0.8mm (1/32-inch)
diameter brass rod. Bend one end of
the rod through 90° but only bend
the other through about 20°. This is
because the rod has to pass through
the 2.6mm hole in the 5.5mm-thick
base. We will bend it to 90° later in
the assembly process. Paint the connecting rod blue-black.
#11 Mounting pole
The mounting pole is made from
a length of 1/8-inch (3.2mm) square
hollow brass tube. Drill the 1/16-inch
(1.6mm) diameter hole at 92mm from
the pole end. You can make the slot
by drilling two 1mm holes 1mm apart
siliconchip.com.au
Fig.3: this shows the smaller parts (#1-#9) that need to be made. Some can be made on a lathe, while others require a
saw, files and drilling. #6 and #8 are made by bending thin cylindrical bar stock on rectangular formers. Note that all
dimensions are in millimetres.
Fig.4: the remaining parts to make, including the larger items (#10-#12) plus a detailed view of the partially assembled
Semaphore at right.
siliconchip.com.au
Australia's electronics magazine
April 2022 53
and using a file to remove the remaining metal.
Make sure that the insides of the slot
and the insides of each end are free
of swarf and are smooth, as when we
insert the LED wires, we don’t want
to cut their insulation.
#12 Base
My layout is made on a 2-inch
(51mm) thick sheet of polyurethane
foam. I buried the signal in the foam
so that it was flush with the top of the
base. This left a 0.5mm step down all
around the Semaphore that I later filled
with ornamental grass, so that the base
was more in keeping with the scale.
Depending on your layout, you might
decide to leave out this step down.
The base is made from 6mm aluminium plate. Cut it to size, then drill and
tap the required holes. I made the step
using an end mill in a milling machine.
Paint the base blue-black and when
dry, fit the 2.5mm grub screw.
#13 Servo bracket
This is made from 1/16-inch
(1.6mm) thick aluminium sheet. Drill
the two 3mm holes 29mm apart, then
cut it to size. Clean up the edges with
a file.
#14 Servo collar
Place a length of 12mm diameter
aluminium bar in the lathe three-jaw
chuck, face the end and turn it down to
a diameter of 9.8 mm for 10mm. Bore
it out to a depth of at least 5mm using
a centre drill followed by a 4.8mm
diameter drill. Part off a 3mm section,
transfer this to the drilling machine
and drill the 2mm hole for the grub
screw. Thread the hole with a 2.5mm
tap and fit the grub screw.
Finally, drill the 0.8mm diameter
hole exactly 4mm from the centre.
Parts List – Semaphore Signal
1 single-sided PCB coded 09103221, 51 x 37mm (controller)
1 double-sided red PCB coded 09103222, 31 x 20.5mm (blade)
1 PIC16F88-I/P microcontroller programmed with 0910322A.hex (IC1)
1 5V DC power supply
1 DF9GMS 9g micro servo [Core electronics SER0006]
1 18-pin DIL socket (optional; for IC1)
2 1kW mini top-adjust trimpots (VR1, VR2)
1 3mm red/green LED, three-lead type (LED1) [element14 Cat 2148798]
1 miniature SPDT toggle switch (S1) [Jaycar ST0300]
2 M3 x 16mm panhead machine screws (for mounting servo)
10 1mm PCB pins
1 10mm length of 1mm diameter heatshrink tubing
various lengths & colours of light-duty hookup wire
1 tube of Loctite GO2 adhesive
1 tube of Tarzan’s Grip or similar adhesive
Capacitors
1 100μF 16V electrolytic
2 10μF 16V electrolytic
2 100nF 50V multi-layer ceramic
Resistors (all 0.25W 1% metal film)
1 10kW
1 5.6kW
1 4.7kW
1 2.2kW
1 820W
2 680W
Mechanical parts
1 300mm+ lengths of 0.8mm (1/32-inch) diameter brass rod
1 20mm+ length of 1.6mm (1/16-inch) diameter steel rod
1 20mm+ length of 2mm diameter aluminium rod
1 20mm+ length of 6mm diameter aluminium rod
1 40mm+ length of 12mm diameter aluminium rod
1 103mm length of 3.2mm (1/8-inch) square hollow brass tube [KS Metal]
1 20mm+ length of 1.6mm (1/16-inch) thick, 6.53mm (1/4-inch) wide brass
bar
1 20 x 20mm rectangle of 0.8mm (1/32-inch) thick brass sheet
1 46 x 55mm rectangle of 6mm-thick aluminium sheet
1 35 x 7.5mm rectangle of 1/16-inch (1.6mm) thick aluminium sheet
1 OO-scale ladder [D.J.’s Models]
3 2.5mm grub screws
54
Silicon Chip
Australia's electronics magazine
Mechanical assembly
With the parts now made, refer back
to Fig.1 to see how they all go together.
The LED plate (#2), platform (#7)
and ladder support (#8) are all soldered to the mounting post. Clean, tin
and flux the mating surfaces between
the LED plate and the mounting post.
Insert a temporary pin in the 1/16-inch
(1.6mm) hole and use it to align the
two pieces. Using a small blowtorch,
heat the assembly until you see solder
coming out of the joint. File off any
excess solder.
Now clean, tin and flux the mating
surfaces between the platform and
the mounting post. To align the plate
squarely, use a small timber cube as a
support and clamp it to the mounting
post. Using a small blowtorch, heat the
assembly until you see solder coming
out of the joint.
The next step is to solder the four
12mm pillars into the platform. Do this
one at a time using a soldering iron. To
keep them vertical in this operation,
drill a 0.8mm hole vertically into a
piece of scrap timber into which you
insert the pin. The railing can then be
soldered into place, making sure it is
parallel to the platform. File off any
excess solder.
Next, clean, tin and flux the mating surfaces between the ladder support and the mounting post. To keep it
level, make a small timber cube for it to
rest on and clamp that to the mounting
post. Using a small blowtorch, heat the
assembly until you see solder coming
out of the joint. File off any excess solder. The whole assembly can then be
painted white.
Signal blade
The signal blade can be purchased
as a PCB, coded 09103222 and measuring 31 x 20.5mm – see Fig.5. Using
a small pair of side cutters, carefully
remove the blade from the PCB. You
can also snap it at the weak points
deliberately created by holes drilled
into the supports. Clean up the blade
edges with a file.
The PCB should already be coloured
red/white, and you can easily paint the
spectacle area (see Fig.6) by masking
it and applying spray paint, painting
it with a brush, or even using a black
permanent marker.
However, if you aren’t happy with
the PCB colour, or you made the flag
some other way, you can download
the artwork (Fig.6) from the Silicon
siliconchip.com.au
Chip website, print it on a colour
printer and cut out the front and back
shapes.
Use two-part five-minute epoxy to
glue the front shape onto the face of
the blade. Once dry, carefully clear
the paper from the holes. Glue the rear
label on and again remove the paper
from the holes.
should rotate 45° anti-clockwise while
the LED should change to green.
Add the short again and switch off
the power. Leave the servo in this position as it will make the final assembly
process easier. Now is a good time to
give the bottom of the PCB a coat of
clear varnish to protect it from corrosion.
Control module
Final assembly
The heart of the semaphore signal is built on a single-sided PCB
coded 09103221, which measures 51
x 37mm. Fig.7 is the PCB component
overlay diagram. Start its assembly by
fitting the PCB pins, then the IC socket.
The reason for the IC socket is that
there is no provision for in-circuit
programming, although if you have
purchased a pre-programmed micro,
you could just solder it to the board.
Alternatively, if you have a blank
micro, download the firmware from
the Silicon Chip website and program
it using an external programmer now,
before fitting it.
Take care to orientate the socket/
IC correctly. Next, add the vertically-
mounted resistors; you can replace
the 0W resistor with a wire link. Follow with the capacitors; check that the
electrolytic types are the correct way
around, with the longer leads to the +
symbols. Next, add the 1kW trimmer
potentiometers and temporarily connect the servo motor and LED1 (as
per Fig.8).
Finally, connect the positive of the
5V power pack to +5V and the negative to 0V. Check that all the connections are correct and that there are no
dry joints or solder bridges.
At this stage, don’t plug in IC1 yet
if you have used a socket.
Refer back to Fig.1 during final
assembly to see how the Semaphore
goes together.
1. Push the red/green LED into the
LED plate. Before trimming the leads
as short as possible, note which is the
shortest as this connects to the red
LED. The centre lead is the common,
and the other goes to the green LED.
2. The connecting wires must be
very fine to fit through the mounting
pole. I found suitable wires in an old
computer mouse connecting cable. I
selected red, yellow and black and
made them about 300mm long. Using
a fine-tipped soldering iron, connect
the red wire to the red LED terminal,
the yellow wire to the green LED terminal and the black wire to the common (middle) terminal.
3. Cut a 5mm length of 1mm diameter heatshrink tubing and slide it over
the wires. Insert the wires one at a
time into the post until they protrude
from the end. Be very careful not to
strip the insulation off in this process.
Straighten up the wires and shrink the
tubing down over the exposed portion
of the wires using a heat gun.
4. Insert #4 (the 1/16in [1.6mm]
diameter steel pin) into the signal
blade and lock it into place using Loctite GO2. When dry, slide the assembly
into the mounting pole (#11).
5. Push the support (#9) into the
base (#12) with the grub screw in the
support on the right-hand side when
looking at the front of the signal.
Tighten the grub screw in the base.
6. Push the three wires at the bottom of the post through the hole in the
support, then push the post into the
support and lock it temporarily in place
using the grub screw in the support.
7. Take the connecting rod (#10)
and push the end with the 20° bend
up through the base and platform to
the signal blade height. Use pliers to
increase the 20° bend to 90°.
8. Insert the end of the connecting rod into the 0.8mm (1/32in) hole
in the connecting lever (#3) and push
Testing
Switch on the power supply and
connect the negative lead of a voltmeter to pin 5 of the IC socket and the positive lead to pin 14. The meter should
read +5V. If it reads -5V then the IC
socket or IC is the wrong way around.
Switch off the power and insert the
IC (if you used a socket), checking
that it is correctly orientated. Switch
the power on, and the LED should
glow green.
Short S1’s two terminals together
and the LED should now glow red,
while the servo motor should rotate
45° clockwise (looking at the shaft).
Remove the short, and the servo
siliconchip.com.au
Australia's electronics magazine
Fig.5: the semaphore flag is too small
for most PCB manufacturers to make
by itself, but they will make this
larger PCB which can be snapped or
cut apart (at the holes represented
by black filled circles) to give you
something very close to the correct
flag shape. After cutting or snapping
it out, all you have to do is file the top
and bottom edges flat.
Fig.6: this artwork
can be printed,
cut out and glued
to the flag if it isn’t
already coloured or
you aren’t happy
with the colour or
surface finish.
Fig.7: it shouldn’t take long to
assemble the PCB as it only has a
handful of parts on it. Make sure the
chip is programmed first if you’re
going to solder it directly to the board
and watch the orientations of the
electrolytic capacitors (the longer
leads are positive).
April 2022 55
the pin attached to the signal blade into
the 1.6mm (1/16-inch) hole in its other
end. With the signal blade horizontal,
adjust the position of the connecting
lever so that it is parallel to the axis
of the signal blade. Lock the connecting lever temporarily in place with a
blob of Tarzan’s Grip or similar glue.
9. Attach the servo bracket (#13)
to the base using the two 16mm M3
screws. Align the servo motor as
shown in Fig.1, and attach the servo
collar to the shaft with the grub screw
hole at the bottom.
10. Loosen the grub screw holding the mounting post in place. Slide
the servo motor assembly under the
retaining bracket. By adjusting the
height of the post, you should be able
to align the connecting rod with the
0.8mm (1/32in) hole in the servo collar. Push the end of the connecting rod
into the collar.
11. Move the servo until the connecting rod is vertical, then lock it in
place by tightening the screws. Adjust
the height of the column until the connecting lever at the top of the signal
is horizontal. Tighten the grub screw
holding the mounting post in place
and the grub screw in the servo collar.
12. Check that the signal blade is
parallel to the front of the mounting
base. If it is not, loosen the grub screw
in the base and rotate the post until it
is. Tighten the grub screw.
Wiring
Wire up the signal as shown in
the wiring diagram, Fig.8. Check this
before applying power, as reversing
the supply polarity will destroy IC1.
Then, with the switch closed, apply
power. The LED should glow red, and
the signal blade should be horizontal. Open the switch; the LED should
light green and the signal blade should
move down about 45°. Operate the
signal several times to make sure it
changes over smoothly and that nothing is binding. Check the tightness of
the three grub screws and the servo
screws.
The two potentiometers on the
PCB allow you to fine-tune the position of the two holes over the LED in
the signal blade. The potentiometer
closer to the LED connections on the
PCB (VR1) adjusts the position of the
signal blade in the horizontal position and the other (VR2) in the down
(45°) position. Once you are happy
with the blade position, use a drop
56
Silicon Chip
Fig.8: once you’ve assembled the Semaphore and the control PCB, here is how
to wire them up. Be very careful to get this right, especially the 5V power and
servo wiring, or you could damage IC1 or the servo when you apply power.
of Loctite GO2 to glue the connecting
lever in place.
Fitting the cap and ladder
Attach the red cap and pin assembly into the top of the mounting pole
using Loctite GO2.
Take one of the supplied ladder
lengths and paint it blue-black. When
dry, lay the ladder up against the platform support and check that the top
rung is level with the platform. Cut it
to size and use Loctite GO2 to glue the
ladder to the platform and support. I
deliberately didn’t glue the ladder to
the base, as that would stop the post
assembly from being adjusted later.
Using it
The Semaphore could be combined
with a level crossing, such as my
design (July 2021; siliconchip.com.
au/Article/14921), or you could use
it on its own, such as before a switch
or a station.
The simplest method is manual control. Position a toggle switch at a convenient location in the layout. With
the Semaphore in the stop (horizontal) position, manually stop the train
in front of it. Then, switch the Semaphore off at an appropriate time, and
the train can move away.
There are also methods to automate
it. For example, if used near a level
crossing, you could arrange for the
Semaphore to usually be in the stop
Australia's electronics magazine
(horizontal) position and then automatically switch to the down position
when the level crossing boom gates are
fully down. It could change back to
the stop position as soon as the boom
gates start to lift.
All you need to organise this is to
have a microswitch or reed switch
arranged so that it is open when the
boom gates are fully down and closed
the rest of the time.
If you can’t easily do that, the other
option is to use a delay circuit that’s
triggered by the same signal that activates the level crossing. Set the delay
so that it closes a set of relay contacts
or activates an open-collector/drain
transistor after the boom gates have
had a chance to fully lower.
Use those contacts or that transistor to trigger the Semaphore into its
off position, and arrange it so that the
contacts open or transistor switches
off as soon as the Level Crossing trigger switches off.
You could also consider positioning a reed switch under the tracks and
placing a magnet in the train. This
way, when the train pulls to a stop in
front of the Semaphore, it triggers a
delay circuit that disables the Semaphore signal after a couple of seconds.
It would need to hold it off until the
train has passed, possibly sensed by
a second reed switch. I’ll leave the
details of that arrangement as an exercise for the reader.
SC
siliconchip.com.au
|