This is only a preview of the July 1995 issue of Silicon Chip. You can view 31 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 "A Low-Power Electric Fence Controller":
Items relevant to "Run Two Trains On A Single Track":
Items relevant to "Satellite TV Receiver; Pt.3: Setting Up A Ground Station":
Articles in this series:
Items relevant to "Build A Reliable Door Minder":
Articles in this series:
Articles in this series:
|
The main board at far left allows two trains to
run automatically around a loop of track, each
train alternately stopping as it comes to a
short isolated section. It also provides LEDs for
signalling & for flashing level crossing lights.
The smaller board provides various sound
effects, including level crossing bells.
Run two trains on a
small layout
Do you have a small model train layout with
just a loop of track? Would you like to run
two trains on it at the same time? It can be
done cheaply and easily with the circuits
presented here. As a bonus, you can have
level crossing lights and sound effects.
By LEO SIMPSON
Running a train around a small
loop of track is alright for beginners
but before too long it becomes boring.
However, adding variety is hard unless
you extend the layout with points,
more track and so on. If that seems like
too much of a challenge then consider
the circuits presented here. They will
enable two trains to safely follow
each other around a loop of track. As
32 Silicon Chip
a bonus, you can have flashing level
crossing lights and the accompanying
bell sound effects.
Most people with a single loop of
track will have probably tried running
two trains or two locos on it simultaneously but it doesn’t work well. One
loco will eventually catch up with the
other and then they will play “push
me, pull you” all around the track. A
better way of doing it is to divide the
loop of track into two sections. Then
you place a train or a loco in each
section and only have one section
energised at a time.
That way, one train will proceed
around its section until it comes to
the end. It will then stop and the other
train will proceed around its section
until it too comes to the end. Each
train will alternate in running and
stopping but they will both proceed
safely around the track without ever
catching up to each other. This applies
even if one train or loco is substantially
faster than the other.
This idea sounds alright in theory
but how does the controlling circuit
know when to switch the power to
each alternate section of the track?
Well, actually, this simple idea doesn’t
work in practice and the loop of track
TRAIN DIRECTION
TRAIN
SIGNALS
DETECTOR
A
TRAIN
1
DETECTOR
RELAY
TRAIN
CONTROLLER
DETECTOR
B
TRAIN
SIGNALS
Circuit details
TRAIN 2
ISOLATED
SECTION
Fig.1: this diagram shows the principle of operation. There are two
infrared detector beams which are broken by the two trains as they pass
around the track loop. A relay switches the power on & off to an isolated
track section & so one locomotive stops while the other loco proceeds.
needs to be sectioned along the lines
shown in Fig.1. This depicts a loop
of track which has one small isolated
section in it. This isolated section need
only be long enough to accommodate
your longest locomotive. As well as
that, two infrared light detector beams
are positioned across the track. As a
loco breaks one of these light detector
beams, it is detected and some logic
circuitry operates a relay to energise or
de-energise the isolated track section
which we’ll call section A.
detector beam A. The circuit also
provides a simple lighting system to
increase the realism. You can have
train signals and level crossing lights,
as we shall see.
Not included in this article is a train
speed control circuit. We are assuming
that anyone who has a small layout
will already have a train control and
so this can be employed in the setup
described here.
tion. Train 1 sets off in pursuit and
breaks infrared detector beam B which
kills section A again so that when train
1 arrives there, it stops.
This sequence continues, with train
1 and train 2 alternately stopping at
section A while the other one proceeds
around the track. On a layout, section
A could be a station platform while a
level crossing can be positioned near
Fig.2 shows the circuit which enables the two trains to run around the
loop of track. There are two infrared
detector beams, beam A provided by
LED1 & Q1, and beam B, provided by
LED2 and Q2. When beam A is broken,
Q1 will turn off which will turn on
transistor Q3. This will pull pin 1 of
IC1a low. ICI is a 4011 quad 2-input
NAND gate package. Two of the NAND
gates, IC1a & IC1b, are connected as
an RS flipflop. When Q3 pulls pin 1
low, pin 3 of the flipflop goes high.
This will turn on transistor Q5 and
energise the relay.
Because an RS flipflop is employed,
nothing can happen until beam B is
broken. This will switch off Q2 and
switch on Q4 which causes the RS
flipflop to change state. This turns off
Q5 and disables the relay.
So the RS flipflop is set and reset as
beam A and beam B are interrupted
and section A is alternately powered
or not, to stop the trains.
How it works
Fig.1 shows train 1 proceeding
clockwise around the lefthand section
of the loop while train 2 is stopped
in section A which has no power
applied to it. The rest of the track is
permanently powered from the train
controller.
As train 1 moves around the loop
it breaks infrared detec
tor beam A
which causes the relay to apply power
to section A. Train 2, which had been
stopped in section A, can now proceed
and it passes through infrared detector
beam B, so the relay removes power
from section A. Both trains are now
moving and train 1 eventually arrives
at the dead section A and stops.
Train 2 now continues around and
breaks infrared detector beam A. The
relay now energises the isolated sec-
This close-up shows the locomotive about to break one of the infrared detector
beams. Note the optotransistor which has been bent over backwards so that its
lens faces the infrared light emitting diode.
July 1995 33
VCC
A
LED3
R1
560
Q1
A
K
A
LED4
Q3
BC548 C
B
R5
220k
C
LED1
C1
.015
R6
68k
R2
560
A
LED2
Q2
R10
22k
Q4
BC548 C
B
R8
220k
C
C2
.015
R9
68k
14
1
3
2
RELAY 1
K D1
1N4004
SECTION A
SPEED
CONTROLLER
R14
1k
E
5
Q6
BC548 C
B
R12
10k
4
IC1b
6
7
E
B
VCC
E
A
E
K
LED6
Q5
R11 BC548 C
10k B
A
VCC
R4
120k
K
A
K
IC1a
4011
DETECTOR A
LED5
R13
1k
E
E
K
R7
22k
R3
120k
A
C9
0.47
R17
4.7M
13
R21
2.2k
R18
2.2M
IC1d 11
12
R16
120k
LED7
DETECTOR B
8
IC1c
10
R28
10k
9
A
Q7
BC548
R22
10k
D6
1N4004
+12V
R19
205
ZD1
10V
VCC
C10
100
8
R15
47k
IC2
555
6
0V
2
C3
.001
D2
4
3
5
1
4x1N4148
D3
C5
4.7
D4
E
C
B
Q9
BC548
E
C8
4.7
C7
A
4.7
K
C
VIEWED FROM
BELOW
E
IC1d and IC1c operate as a square
wave oscillator with its frequency of
operation determined by resistors R17
& R18 together with capacitor C9. The
oscillator is enabled whenever pin 12
of IC1d is pulled high. Depending on
where you want to put the level crossing lights, pin 12 can be connected to
point A or point B (pin 3 or pin 4 of
IC1) on the circuit.
The complementary outputs of IC1c
& IC1d drive transistors Q7 and Q8
and these cause LEDs 7 & 8 to flash
B
E
C4
.01
Fig.2: the train detector board is based on an RS flipflop (IC1a & IC1b) which
controls the relay. The RS flipflop is set and reset by the locomotives breaking
detector beama A and B. IC2 and the associated voltage multiplier provide a
30V supply for the high voltage relay.
34 Silicon Chip
Q8
BC548
D5
TRAIN DETECTOR
As well as driving the relay, transistor Q5 drives LED3 and LED4 which
are in series. Q6, driven from the alternate output of the RS flipflop, drives
LEDs 5 & 6 in series. LEDs 3 & 5 are red
while LEDs 4 & 6 are green. These are
placed on signals situated just before
each infrared detector beam, so that
when a train goes through the beam,
the lights change state (eg, from GO to
STOP and vice versa.
IC1c and IC1d are arranged to provide a complementary LED flasher.
C
B
E
R24
10k
C6
4.7
K
R23
2.2k
C
B
LED8
K
Q1
C
alternately. These can then be used
to simulate the flashing lights at level
crossings.
Interestingly, when pin 12 is pulled
low, LEDs 7 and 8 will stop flashing but
one LED will stay alight, due the high
state of pin 10 or 11. To stop both LEDs
from lighting when pin 12 is low, transistor Q9 is connected in series with
the paralleled emitters of Q7 and Q8.
The base of Q9 is connected to pin 12
of IC1 via a 10kΩ resistor. Now, when
pin 12 is high, Q9 is on and the LEDs
can flash merrily away. But when pin
12 is low, Q9 will be off and so both
LEDs 7 & 8 will be dead.
The rest of the circuit based around
IC2 is there solely to provide a high
Q1
BC548
C
E
+8-15V
C1
100
0V
R1
2.7k
C4
1
B
R4
150k
32W
2
C2
0.47
ZD1
5.6V
R2
10k
TRIGGER
1
4
C5
0.1
7
C
8
Q2
BC548
C3
.015
R5
330 B
9
5
B
R3
4.7k
COB
MODULE
E
E
10
NO
1
47k
LED3,4
LED5,6
205
D6
1k
4.7uF
D5
4.7uF
Q6
2.7k
+12V
TRIGGER
0V
10k
Q5
.01
+12V
D1
10k
GND
ZD1
RELAY1
1k
120k
10k
10k
IC1
4011
22k
B
4.7uF
D4
IC2
555
NC
COM
OSC
O/P
4.7uF
D3
.001
1
A
Q4
220k
68k
560
120k
GND
22k
68k
.015
LED2
0.47
Q3
D2
Q2
220k
560
120k
LED1
Fig.4 (left): the LEDs shown here will normally all be
mounted on the model train layout. LEDs 7 & 8 are
the level crossing lights while the others provide the
signalling.
Q9
10k
100uF
.015
Q8
Q2
SPEAKER
Q1
100uF
Q3
150k
2.2k
Q1
Q7
2.2k
There are four PC boards to be assembled for this project: one for the
train detector circuit, one for the COB
module and two for the infrared light
detector beams. We’ll deal with the IR
beam boards first.
Each board has two components:
LED1 (or LED2) and the optotransistor
Q1 (Q2). As can be seen from the photos, the LEDs for these boards have
clear lenses and are installed with the
longer lead connected to the “A” mark
on the board.
The optotransistors come in a much
smaller rectangular package which has
only two leads. Looking at the package
with the small lens facing you, the
emitter lead is on the left while the
1uF
ZD1
LED8
4.7M
2.2M
LED7
Construction
.015
4.7k
The COB circuit is little more than
a power supply and a transistor which
drives a loudspeaker. The COB module requires a voltage of 5V and this
track, or the level crossing bells. It
just depends on which of four pins
is connected to pin 1. To obtain the
level crossing sound, connect pin 1
to pin 7.
10k
COB circuit
C
VIEWED FROM
BELOW
COB
is provided by the simple regulator
comprising a 5.6V zener diode ZD1
and emitter follower transistor Q1.
Transistor Q2 provides the trigger
facility. If the trigger input is pulled
high, transistor Q2 turns on and shorts
the zener diode at the base of Q1. This
kills the supply from Q1 and so the
COB module is silenced.
On the other hand, if the trigger
input is held low, Q2 is off and the
COB module is fed its 5V supply by
Q1. Transistor Q3 acts as a buffer stage
for the COB module and drives the 32Ω
loudspeaker.
Depending on when you want the
level crossing sound to be produced,
the trigger input of the COB circuit can
be connected to point A or B on the
train detector circuit of Fig.2.
While we have yet to mention it, the
COB module is capable of a variety of
train sounds. You can have a steam
train whistle, a locomotive chuffing,
a carriage passing over a join in the
Q3
C8050
B
E
voltage source for the relay which is a
48V type. IC2 is a 555 timer connected
as a square wave oscillator. Its output
drives a voltage multiplier consisting
of diodes D2-D5 and capacitors C5-C8.
This produces a DC supply of around
30V which is adequate to drive the
relay reliably.
But there’s more. As well as the
signalling and level crossing lights,
this project offers a small module
which produces the sound of a level
crossing. This takes the form of a
chip-on-board (COB) module which
is effectively a bare integrated circuit
die (the chip) on a small PC board and
encapsulated in a blob of epoxy. The
circuit to enable the COB module is
shown in Fig.3.
C
0.47
COB MODULE
Fig.3: the COB module
board is little more than
a power supply (Q1, ZD1)
which is turned on or off by
Q2. Q2 is switched by the
trigger lead which should
be low for sounds to be
produced.
0.1
330
Fig.5: the various sounds of the COB
module are enabled by connecting a
link between the stakes for pin 1 and
pins 4, 5, 7 & 8. The connection shown
here is for the level crossing bells.
July 1995 35
PARTS LIST
Train detector
1 PC board (Oatley Electronics)
2 detector beam boards (Oatley
Electronics)
1 48V DPST relay
Semiconductors
1 4011 quad 2-input NAND gate
(IC1)
1 555 timer (IC2)
2 infrared LEDs (LED1,LED2)
2 optotransistors (Q1, Q2)
7 BC548 NPN transistors
(Q3-Q9)
2 1N4004 silicon rectifier diodes
(D1,D6)
4 1N4148 silicon signal diodes
(D2,D3,D4,D5)
1 10V zener diode (ZD1)
4 red LEDs (LED3,5,7,8)
2 green LEDs (LED4,6)
Capacitors
1 100µF 16VW electrolytic
4 4.7µF 63VW electrolytic
1 0.47µF monolithic
2 0.15µF ceramic
1 .01µF ceramic
1 .001µF ceramic
Resistors (0.25W, 5%)
1 4.7MΩ
2 22kΩ
1 2.2MΩ
5 10kΩ
2 220kΩ
2 1kΩ
3 120kΩ
2 560Ω
2 68kΩ
1 205Ω 2W
1 47kΩ
COB sound board
1 PC board (Oatley Electronics)
1 COB module
1 32Ω miniature loudspeaker
5 PC stakes
Semiconductors
2 BC548 NPN transistors
(Q1, Q2)
1 C8050 NPN transistor (Q3)
1 5.6V zener diode (ZD1)
Capacitors
1 100µF 25VW electrolytic
1 1µF 50VW electrolytic
1 0.47µF monolithic
1 0.1µF monolithic
1 .015µF metallised polyester or
ceramic
Resistors (0.25W, 5%)
1 150kΩ
1 2.7kΩ
1 10kΩ
1 330Ω
1 4.7kΩ
36 Silicon Chip
This is the COB module board which is supplied with a miniature 32Ω speaker
which produces an adequate sound level. The COB module is butted to the end
of the board and the pins soldered.
collector lead is on the right; there is
no base lead.
Insert the optotransistor into the
board and solder the leads. If you have
soldered the leads correctly, the transistor’s lens will now be facing away
from the infrared LED. That means
that the transistor body needs to bent
over backwards so that the lens faces
the LED.
Next, we’ll talk about the train
detector board. This has two ICs and
eight transistors. Its component layout
is shown in Fig.4. Install the resistors
and wire links first, followed by the
small capacitors and diodes. The
electrolytic capacitors can then be
inserted, followed by the transistors
and the ICs. Make sure that all the
semiconductors and the electrolytic
capacitors are installed the correct way
around. If not, they could be destroyed
when you first apply power.
Finally, the relay can be installed.
The LEDs can be wired temporarily
into the board but eventually they will
be installed on the layout. Note that the
LED labelling on the diagram of Fig.4
is different from that shown on the PC
board itself. Current production versions of the board show positions for
LED3 & LED4 at diagonal corners. Our
diagram shows the correct situation,
with LED7 & LED8 mounted in the top
lefthand corner of the board, while
LEDs 3, 4, 5 & 6 are connected at the
bottom righthand corner. LEDs 3 & 4
are connected in series, as are LEDs 5 &
6 and the commoned positive
connection goes to the junction of the 10V zener diode
ZD1 and the 205Ω resistor.
Note that a link is shown
on the underside of the board
connecting pin 3 of IC1 to
pin 12. This enables the level
crossing lights, as discussed
previously. The alternative
is to connect pin 12 to pin 4
(point B).
COB module assembly
Another view of the COB module board,
showing the five PC stakes which enable
a choice of sound effects. The light board
mounted at right angles is the COB (chip on
board) module.
The relevant component
layout is shown in Fig.5. The
main aspect of this assembly
is connecting the COB module to the PC board. The two
boards are butted at right angles and the 14 connections
SATELLITE
SUPPLIES
Aussat systems
from under $850
SATELLITE RECEIVERS FROM .$280
LNB’s Ku FROM ..............................$229
LNB’s C FROM .................................$330
FEEDHORNS Ku BAND FROM ......$45
FEEDHORNS C.BAND FROM .........$95
DISHES 60m to 3.7m FROM ...........$130
This is the train detector board which provides relay switching to the isolated
track section and various LEDs for track signalling and level crossing lights.
are soldered between them. After that,
the remaining work is to install the
board components which comprise
five resistors, four capacitors, two
transistors, the zener diode ZD1 and
the PC stakes. Make sure that the semiconductors and the two electrolytic
capacitors are correctly oriented.
To obtain the level crossing bell
sound, connect a lead between two of
the PC stakes as shown in Fig.5.
Testing
Let’s test the train detector board
first. You will need to connect the
two optocoupler boards first so that
the operation of the RS flipflop can
be checked.
Apply power and check the state of
the LEDs. With both detector beams
unobstructed, either LEDs 3 & 4 or
LEDs 5 & 6 should be on. If LEDs 5 &
Where To Buy Kits
Both these designs are from
Oatley Electronics who own the
design copyright.The train detect
or board kit is available for $20
while the COB sound kit costs
just $12. Packaging and postage
is $4.00. Send a cheque, money
order or credit card authorisation
to Oatley Electronics, PO Box 89,
Oatley, NSW 2223. Phone (02)
579 4985 or fax (02) 570 7910.
6 are on, LEDs 7 & 8 should be flashing
alternately.
If LEDs 5 & 6 are on, try interrupting detector beam A by placing your
finger between the LED and the opto
transistor. LEDs 5 & 6 should go out
and LEDs 3 & 4 should light and LEDs
7 & 8 should stop flashing. The relay
should also be energised at this time.
Now interrupt detector beam B
in the same way. The circuit should
change state again so that LEDs 3 &
4 go out and LEDs 5 & 6 come on, as
before. If all of the above occurs, you
have a working circuit.
Testing the COB board
Testing this board is easy. Just apply
power and the speaker should immediately emit the characteristic bells
sounds of a level crossing. If it does
not, check the 5V rail at the emitter
of Q1 and all the connections to the
COB module.
To turn the sound off, connect a lead
from the trigger input to the 8-15V rail.
If it doesn’t turn off, check the compon
ents around transistor Q2.
Well, there you have it: a couple of
low cost PC boards which will add
life and realism to a simple model
railway loop layout. Not only that,
you could incorporate a similar small
loop into a much larger layout and
thereby add an automatic section
which will run itself and give greater
SC
visual interest.
LOTS OF OTHER ITEMS
FROM COAXIAL CABLE,
DECODERS, ANGLE
METERS, IN-LINE COAX
AMPS, PAY-TV DECODER
FOR JAPANESE, NTSC TO
PAL TRANSCODERS, E-PAL
DECODERS, PLUS MANY
MORE
For a free catalogue, fill in & mail
or fax this coupon.
✍
Please send me a free catalog
on your satellite systems.
Name:____________________________
Street:____________________________
Suburb:_________________________
P/code________Phone_____________
L&M Satellite Supplies
33-35 Wickham Rd, Moorabin 3189
Ph (03) 9553 1763; Fax (03) 9532 2957
July 1995 37
|