This is only a preview of the May 1997 issue of Silicon Chip. You can view 33 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. Articles in this series:
Items relevant to "NTSC-PAL Converter":
Items relevant to "Neon Tube Modulator For Cars & Light Systems":
Items relevant to "Traffic Lights For A Model Intersection":
Articles in this series:
Items relevant to "The Spacewriter: It Writes Messages In Thin Air":
Articles in this series:
Articles in this series:
Articles in this series:
Purchase a printed copy of this issue for $10.00. |
A quickie project for your
model railway
By RICK WALTERS
Traffic lights for a
model layout
Most model railway layouts have a few roads
wending their way around and often a small
town with an intersection is included. A good
way to add life to such a scene is to have
working traffic lights at the intersection.
Any working light system on a
model railway will add realism and
having working traffic lights – cycling
through the green, amber, red sequence
– is a nice touch that can be easily and
cheaply achieved.
While you will probably have at
40 Silicon Chip
least two sets of traffic lights visible
and perhaps up to four sets for one
intersection, you only need one PC
board to drive the lot.
These lights will change in the normal green, amber, red sequence which
most of us, as motorists, are used to.
We have chosen a timing cycle which
seems realistic but it can be changed,
as described later.
Circuit description
Fig.1 shows the circuit details. IC1
is a 555 timer which is wired as a
free-running oscillator with a frequency of about 5.3 seconds, as determined
by the 220kΩ resistor and 10µF capacitor connected to pins 6 & 2. IC1’s
output at pin 3 is used to clock pin 14
of IC2, a 4017 counter with 10 outputs,
each of which goes high in turn.
Each time pin 14 of IC2 is clocked,
the next output goes from 0V to +12V
(low to high). Thus, each of the 10
outputs is high for about 5.3 seconds
and low for about 48 seconds.
We use a diode gating system from
these 10 outputs to turn on the respective green, amber (orange) and red
lights for different times. Hence, the
amber lights are only on for one clock
cycle (ie, 5.3 seconds), while the red
and green lights are each on for just
over 26 seconds.
By the way, if this overall cycle
of 53 seconds seems too long or too
short, it is a simple matter to change
it by changing the value of the 220kΩ
resistor at pins 6 & 2 of IC1; higher values give longer times and vice versa.
The outputs are shown sequentially
on IC2, going from output zero on pin
3 through to output 9 on pin 11. Only
one output at a time can be high, as
already noted.
Let’s look at the outcome when pin
3 is high. Transistor Q1 will be turned
on via the 10kΩ resistor connected
to its base. This will turn on the two
orange LEDs wired to its collector. In
addition, transistor Q4 will be turned
on via D1 and its 10kΩ base resistor,
causing the red LEDs in its collector
circuit to light up.
By the way, we will use amber
and orange interchangeably as we go
through this article. Most people refer
to the middle light as “amber” instead
of orange but LEDs are available in
orange, not amber.
Typical intersection
Before we go any further, we need
to explain how all the light emitting
diodes (LEDs) are wired up to control
a typical intersection. Have a look at
Fig.2 which shows a typical inter
section with four sets of traffic lights
to control the four directions of traffic.
We have named the horizontal road
“Cross Street” while the vertical road
is named “Down Street”. (We hope
readers appreciate how much of a
mental strain it was for us to come up
with these imaginative names.)
As can be seen from the labelling
of the four traffic lights, LEDs 1-6
Fig.1 (right): the circuit is based on
a 4017 decade counter (IC2) which
drives transistors and LEDs in a fixed
sequence lasting around 53 seconds.
IC1, a 555 timer, provides the clock
signals for the counter.
May 1997 41
Fig.2: this diagram will
help in visualising the
circuit operation and
also when the time comes
to wire the lights (LEDs)
at the intersection.
control the traffic along Cross Street
while LEDs 7-12 control the traffic
along Down Street. Furthermore, the
LEDs are paired up so that, LEDs 3 & 4
are the orange (amber) lights for Cross
Street and so on.
Traffic light cycle
Fig.3: these waveforms are taken at three points in the circuit, with operation
speeded up by 2.7 times. The upper trace shows the output at pin 3 of IC1, the
clock cycle. The middle trace shows the signal at pin 3 of IC2. When this is high,
Q1 and the orange LEDs 3 & 4 are on. The bottom trace is the signal at the
junction of diodes D2-D6 and represents the signal driving Q2. When this is
high, Q2 and the red LEDs 1 & 2 are on and so are the green LEDs 11 & 12.
42 Silicon Chip
Thinking about how traffic lights
work in practice, when the lights are
green for traffic in Cross Street, they
will be red for traffic in Down Street.
When the lights change to amber (orange) in Cross Street, they remain red
in Down Street. Finally, after the lights
change from amber to red in Cross
Street, there is a short delay before
the lights in Down Street change to
green. This short delay gives a slight
margin of safety for those fools who
run through red lights.
In our modelling version of traffic
lights, we have the same sequence
except that when the lights change
from amber to red in Cross Street,
they simultaneously change from red
to green in Down Street. This slight
variation from reality can be tolerated
in a model railway scene, because
the road vehicles in a typical model
railway layout don’t actually move!
And even if you were using
wire-guided moving road models, you
wouldn’t have to worry about the dangers of any vehicle running red lights.
So now let’s resume our description
of the circuit operation. As we said,
pin 3 of IC1 is high, Q1 is on so that
LEDs 3 & 4 are lit, and Q4 is still on
as well, so that red LEDs 7 & 8 are on.
Traffic in Cross Street is coming to a
stop while traffic in Down Street is
stopped and ready to go.
When IC2 is next clocked, pin 3 will
go low and pin 2 will go high. So Q1
will turn off, Q2 will turn on showing
red lights in Cross Street, and Q4 will
turn off, allowing green LEDs 11 & 12,
to light. So traffic in Down Street gets
the green light.
Note that both sets of green LEDs, 5
& 6 and 11 & 12, are not turned on by
transistors. This is possible because
both sets of six LEDs (red, orange,
green) are each fed via a common
470Ω resistor. When transistors Q3
and Q4 are off, green LEDs 11 & 12
will be fed via diode D11 and the
470Ω resistor. Whenever Q3 or Q4
is turned on, the green LEDs will
be extinguished as the voltage drop
across the red or orange LEDs and
their transistor will be less than that
You can increase the realism at a road intersection on a model railway layout
by having the lights working. This board is shown assembled with 12 LEDs to
check its operation. In normal use, the LEDs will be installed in the traffic lights
at the intersection.
Fig.4: the component layout for the PC board. Note that the LEDs are only
installed on the board for checking its operation.
across the green LEDs and diode D11.
A similar situation exists with Q1,
Q2 and the green LEDs 5 & 6.
Thus we have red lights in Cross
Street and green lights in Down
Street. This condition is maintained
for the next four clock cycles or 21.2
seconds (5.3 x 4) at which point pin
1 of IC2 goes high to turn on Q3 and
orange LEDs 9 & 10 (for Down Street).
This extinguishes the green lights
and diode D6 keeps Q2 turned on to
maintain the red lights (LEDs 1 & 2)
for Cross Street.
In the next clock cycle, pin 5 (output
6) goes high and pin 1 goes low. So Q4
turns on to light LEDs 7 & 8 and Q3
turns off. Q1 also turns off and so green
May 1997 43
PARTS LIST
1 PC board, code 09205971, 95
x 80mm
1 555 timer (IC1)
1 4017 counter (IC2)
1 7812 12V regulator (REG1)
5 BC548 or BC338 NPN
transistors (Q1-Q5)
4 green LEDs (see text)
4 orange LEDs (see text)
4 red LEDs (see text)
12 1N914 silicon diodes (D1D12)
1 1N4004 silicon diode (D13)
Capacitors
1 100µF 25VW electrolytic
2 10µF 25VW electrolytic
1 1µF 25VW electrolytic
1 0.1µF monolithic ceramic
1 .01µF MKT
Resistors (0.25W, 1%)
1 220kΩ
2 470Ω 0.5W
1 100kΩ
1 100Ω
8 10kΩ
Where to buy parts
Note: Oatley Electronics can
supply a pack of 2mm LEDs for
installation in HO scale signals.
Each pack contains 10 red, 10
orange and 10 green LEDs, plus
30 1kΩ resistors. The cost is $10
plus $3 for postage and packing.
Oatley Electronics is located at
66 Lorraine Street, Peakhurst,
NSW 2210. Phone (02) 9584
3563; fax (02) 9584 3561.
LEDs 5 & 6 are lit, via D12.
If you keep stepping through the
outputs of IC2 you will see that the
traffic lights cycle in the correct sequence.
Scope waveforms
The oscilloscope waveforms of
Fig.3 show the sequence speeded up
by about 2.7 times. The upper trace
shows the output at pin 3 of IC1, the
clock cycle. In this case, the clock
cycle is 1.35 seconds. The middle
trace shows the signal at pin 3 of IC2.
When this is high, Q1 and the orange
LEDs 3 & 4 are on.
The bottom trace is the signal at the
junction of diodes D2-D6 and represents the signal driving Q2. When this
is high, Q2 and the red LEDs 1 & 2 are
44 Silicon Chip
Fig.5: the actual size artwork for the PC board. Check your board
carefully against this pattern before installing any of the parts.
on and so are the green LEDs 11 & 12.
Traffic lights override
One additional feature we have
included is the ability to set IC2 (and
thus the traffic lights) to a known
state. This is done by grounding the
100Ω resistor in the base circuit of
tran
sistor Q5. This will reset IC2,
so that pin 3 (output 0) is high. This
is the initial condition which we
described, whereby Q1 is on and the
orange LEDs 3 & 4 are lit.
If the lights for Cross Street were
also used to control the traffic over a
railway level crossing, an approaching train could ground the 100Ω resistor. This would immediately show
an orange light to the traffic, followed
by red on the next clock pulse. This
gives the train an ‘all clear’ though
the intersection.
The only remaining aspect of the
circuit to talk about is the power
supply arrangement. A 3-terminal
regulator REG1 is used to obtain a
stable 12V supply for the circuit and
diode D13 provides protection against
reversed polarity.
Building it
The PC board for this design
measures 95 x 80mm and is coded
0910-5971. After checking the copper
pattern for any defects against the artwork of Fig.4 you can start assembly
by inserting the resistors and diodes.
Note that all the diodes on the board
face the same way; ie, with their cathode bands away from IC2.
Next, insert the transistors and capacitors, ensuring that the electrolytic
capacitors and transistors are correctly oriented. This done, insert the ICs
and the 3-terminal regulator, REG1.
Finally, you can insert the LEDs.
While our prototype has been wired
with the correct coloured LEDs on
the board, this is not necessary for
checking the circuit operation. You
could initially use LEDs that all have
the same colour.
Testing
To test the board, apply +15V to the
input and check that the LEDs turn
on and off in pairs. The red and green
pairs should alternate with each other
and the orange pairs should only turn
on for just over five seconds each
time. The total cycle time should be
around 53 seconds but the exact value
will depend on the tolerance of the
10µF capacitor connected to pins 2
& 6 of IC1.
When wiring the traffic lights on
your layout, 2mm LEDs are the closest
to correct scale for HO layouts (1:87
scale) while 3mm would be good for
O scale layouts (1:43). If you’re into
N scale, the only way to produce a
correct scale traffic light set would
be to use optical fibres.
Use the diagram of Fig.2 to aid
in wiring the traffic lights for your
SC
intersection.
|