This is only a preview of the July 1994 issue of Silicon Chip. You can view 30 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 "Build A 4-Bay Bow-Tie UHF Antenna":
Items relevant to "The PreChamp 2-Transistor Preamplifier":
Items relevant to "Steam Train Whistle & Diesel Horn Simulator":
Items relevant to "Build A Portable 6V SLA Battery Charger":
|
Steam Train Whistle &
Diesel Horn Simulator
There’s nothing like a steam whistle
to add realism to your model railroad
layout. This unit sounds just like the
real thing & can be easily modified to
provide a diesel horn sound.
By JOHN CLARKE
Mention steam trains to those who
are old enough and it brings back
memories of “the good old days”, the
steam engine and, of course, the steam
whistle.
Many would wish that the days of
steam were still here. However, it is
perhaps fortunate that they are not.
While it is now a novelty to ride in a
restored steam train, it does not take
long to realise that they are extremely
noisy and dirty. In their favour though,
steam trains do have a character which
is distinctive and exciting.
Part of the unique character of
54 Silicon Chip
the steam engine is the whistle. The
sounds from a steam whistle are unmistakable. Its well-know trademarks
include the rise and fall in pitch as
the train approaches and then passes
the observer; the dying sound of the
whistle as the train blasts into a tunnel; the warning whistle as the train
is about to leave the station; and the
variations in intensity heard when the
train is traversing hilly country.
In Australia, steam train whistles
are more sonorous than their British
counterparts and this is because they
actually consist of several whistles,
each producing a different note. The
result is a distinctive sound that remains embedded in the memory of
those who love steam.
Although the steam whistle does
create much nostalgia, its origins are
rather prosaic. Because there is steam
in the boiler, some of it can drive the
whistle and this is done by pulling a
cord which opens a steam valve. Initially, as the steam pressure builds up,
the sound level rises until it reaches
its maximum intensity. When the
steam valve is subsequently closed, the
sound level drops off abruptly.
Note that, because the whistle is
driven by steam, there is a significant
amount of white noise evident in the
steam whistle sound.
The SILICON CHIP Steam Whistle/
Diesel Horn simulates all the requisite notes, noise and level changes
to produce a very realistic effect. It
uses just two ICs and the circuitry
all fits on a small PC board. This
PC board carries two pushbutton
switches, labelled FAST and SLOW,
to produce two different steam train
whistle sounds.
Pressing the SLOW switch simulates
the effect of the engineer opening the
valve slowly, while the FAST switch
simulates the sound when the cord is
pulled quickly.
Alternatively, the whistle sound can
be triggered using remote switches or
by using the Level Crossing Detector
described in the March 1994 issue. In
this way, the whistle can be made to
sound automatically as the train goes
through a level crossing.
Fig.1: block diagram of the Steam
Train Whistle. The sound is produced
by mixing the outputs of three
oscillators & a white noise source
together.
OSCILLATOR 1
740Hz
IC1a
OSCILLATOR 2
525Hz
IC1b
ENVELOPE
SHAPER
MIXER
OSCILLATOR 3
420Hz
SLOW
S1
IC1c
Block diagram
AMPLIFIER
Q2
VOLUME
VR1
IC2
FAST
S2
8
WHITE NOISE
GENERATOR
Fig.1 shows the block diagram of
the steam whistle. As shown, the
whistle sound is made up by mixing
the outputs from three oscillators and
a white noise source. The resulting
output from the mixer is then fed to an
envelope shaper and finally to an audio amplifier via volume control VR1.
The three oscillators, IC1a-IC1c,
operate at 740Hz, 525Hz and 420Hz
respectively. These frequency values
were obtained from the NSW State
Rail Archives and match those used in
real steam locomotives. Note that the
oscillators do not produce pure sine
waves but include second harmonics
extending up to 1480Hz.
Q1,IC1d
Typical Australian locomotives use
a 5-chime whistle but we have elected
to use only three oscillators. The reason we can get away with this is that
some of the chime frequencies are very
closely related (ie, second harmonic)
and the oscillators we use are already
rich in second harmonics.
The envelope shaper is triggered
using either S1 or S2 to provide the
slow or fast rise time respectively. S1
gradually increases the volume of the
mixer output over about 200ms, while
S2 provides a virtually instantaneous
response.
For diesel horn sounds, the oscillator frequencies are altered and the
Fig.2 (below): the final circuit uses
op amps IC1a-IC1c as the oscillator
stages, while Q1 forms the white noise
source. The outputs from these stages
are mixed together & fed via envelope
shaper Q2 to audio output stage IC2.
+12V
1.8k
100k
1.8k
100k
100k
Q1
120k
BC548
C
1.8k
100k
100k
100k
10k
12
100k
10
14
IC1a
LM324
13
100k
IC1b
9
22k
.039
100k
+12V
0V
.056
100k
100k
6
7
IC1c
+6V
27k
.056
525Hz
OSCILLATOR
100k
100k
.033
3
10k
2
420Hz
OSCILLATOR
1
IC1d
11
10
16VW
10k
4
2.2M
NOISE
GENERATOR
47k
10
+12V
33k
D1
1N4148
1000
16VW
100k
15k
390
FAST
S2
C VOLUME
VR1
50k
E
B
22
16VW
3
2
6
IC2
LM386
4
2.2
16VW
B
.047
Q2
BC548
SLOW
S1
14
22k
740Hz
OSCILLATOR
B
5
0.1
0.1
1k
5
10
16VW
E
C
VIEWED FROM
BELOW
22
10
8
.047
STEAM WHISTLE/DIESEL HORN SIMULATOR
July 1994 55
EXT SWITCH
C3
.056
10uF
0.1
100k
1
.047
47k
IC1
LM324
10uF
D1
VR1
IC2
LM386
.047
1000uF
100k
0V
C1
.039
10
S2
10
1k
Q2
2.2uF
390
+12V
1.8k
R1 22k
100k
100k
100k
100k
100k
100k
R2 22k
1.8k
C2
.056
TO
SPEAKER
100k
1
100k
22
S1
33k
Q1
15k
120k
10k
10k
10k
2.2M
100k
100k
100k
100k
R3 27k
1.8k
.033
22uF
EXT SWITCH
Fig.3: the two pushbutton switches are shown here mounted on the board but may be mounted at
some remote location if desired (eg, on the control panel of your layout). Alternatively, the circuit
can be triggered using the Level Crossing Detector described in the March 1994 issue, or triggered
using the optional reed switch/ monostable circuit shown in Fig.6.
Fig.4: check your etched board against this full-size artwork before installing any of the parts.
noise generator output is disconnected
from the mixer. Again, typical Australian diesel horns have five chimes but
only three are used here for the reasons
discussed above.
Circuit details
Refer now to Fig.2 for the full circuit details. The three oscillators are
Schmitt trigger types which use three
of the four op amps in a quad LM324
package. The remaining op amp (IC1d)
is used to amplify the white noise generated by transistor Q1. Transistor Q2
and its associated components make
up the envelope shaper, while IC2
forms the audio amplifier.
Since the Schmitt trigger oscillators
all operate in identical fashion, we’ll
just consider IC1a. As shown, its
non-inverting input (pin 12) is biased
by two 100kΩ resistors across the 12V
supply, while a 100kΩ feedback resistor is connected between pin 12 and
TABLE 1
C1
C2
C3
IC1a
IC1b
IC1c
Steam
.039uF
.056uF
.056uF
740Hz
525Hz
420Hz
2-Car Diesel
.047uF
.056uF
.056uF
600Hz
520Hz
420Hz
40-43, 4401-4440 Diesel
0.1uF
0.12uF
.056uF
277Hz
329Hz
440Hz
422, 442, 47, 73 48126 Diesel
.056uF
0.12uF
.056uF
548Hz
322Hz
429Hz
56 Silicon Chip
the output at pin 14. A 1.8kΩ pull-up
resistor is also connected to the output
and this ensures that pin 14 goes fully
high (to produce a more symmetrical
waveform).
The oscillator action is as follows.
At switch on, capaci
tor C1 at the
inverting input (pin 13) of IC1a is
discharged and so the pin 14 output is
high and pin 12 is at +8V. The capacitor now begins to charge via resistor
R1 (22kΩ) until the voltage on pin 13
reaches 8V (the upper threshold of pin
12). At this point, pin 14 goes low and
the 100kΩ feedback resistor pulls pin
12 to +4V.
C1 now discharges via R1 and pin
14 until it reaches the lower threshold voltage (+4V). When this voltage
is reached, pin 14 switches high
again and so the process is repeated
indefinitely while ever power is applied. The frequency of oscillation
(740Hz) is determined by the values
of R1 & C1.
Oscillators IC1b & IC1c operate in
exactly the same manner except that
the frequencies are different because
of the differing RC values at their inverting inputs.
The resulting triangle wave capacitor voltages from the three oscillator
stages are mixed together via 100kΩ
resistors and fed to the collector of
transistor Q2. This waveshape is used
instead of the square wave from the op
amp output since it has a high second
harmonic content, which is what we
want for the whistle.
The noise source is obtained by
reverse connecting transistor Q1, so
that its base-emitter junction breaks
down. This breakdown occurs at about
5V and the 120kΩ resistor limits the
current into Q1 to prevent damage to
the transistor. The resulting output
at the collector is rich in noise and is
AC-coupled into pin 3 of non-inverting
amplifier stage IC1d.
IC1d operates with a gain of 221,
as set by the 2.2MΩ feedback resistor and the 10kΩ resistor at pin 2.
The amplifier is DC biased to 1/2Vcc
via the two 10kΩ resistors across the
supply and the 100kΩ resistor to pin
3. A 10µF capacitor decouples the
half-supply rail.
The amplified noise output appears
at pin 1 of IC1d and is mixed with the
oscillator signals at the collector of Q2
via a 47kΩ resistor.
Envelope shaper
As previously mentioned, Q2 forms
the envelope shaper. Normally, Q2 is
biased on via D1 which taps a voltage
divider consisting of 33kΩ and 15kΩ
resistors. The 1kΩ emitter resistor
stabilises the bias, while the 2.2µF
capacitor shunts signal to ground.
Since Q2 is normally turned on, all
of the signal at the collector is shunted
to ground and no sound is heard from
the loudspeaker. However, if switch
S1 is pressed, the 22µF capacitor on
Q2’s base slowly discharges via the
associated 100kΩ resistor and so Q2
gradually turns off. As a result, the
signal on Q2’s collector gradually
increases to a maximum to produce a
steam whistle sound with a slow attack
time (about 200ms).
When S1 is subsequently released,
the 22µF capacitor quick
ly charges
via the 33kΩ/15kΩ voltage divider
and diode D1. Q2 now turns on again
and shunts the signal to ground, thus
shutting off the steam whistle sound.
The FAST switch (S2) works in
virtually identical fashion to S1 except the it shunts Q2’s base voltage to
ground almost immediately via the
associated 390Ω resistor. This produces a whistle with a fast attack time (ie,
the whistle rises to maximum volume
almost immediately when the switch
is pressed).
The signal at Q2’s collector is
AC-coupled to volume control VR1 and
then fed into pin 3 of IC2, an LM386
audio amplifier. This IC has an output
power capability of about 325mW and
a gain of 20 when connected as shown
in Fig.2. Its output appears at pin 5
and drives an 8-ohm loudspeaker via
a 10µF capacitor and a 22Ω current
limiting resistor. In addition, a Zobel
network comprising a series 10Ω resistor and .047µF capacitor is connected
PARTS LIST
1 PC board, code 09305941,
142 x 61mm
2 2-way PC-mount screw
terminal blocks
2 PC-mount pushbutton click
action switches (S1,S2)
4 PC stakes
1 20mm length of 0.8mm tinned
copper wire (for link)
1 50kΩ horizontal trimpot (VR1)
Semiconductors
1 LM324 quad op amp (IC1)
1 LM386 audio amplifier (IC2)
2 BC548 transistors (Q1,Q2)
1 1N4148, 1N914 diode (D1)
Capacitors
1 1000µF 16VW PC electrolytic
1 22µF 16VW PC electrolytic
2 10µF 16VW PC electrolytic
1 2.2µF 16VW PC electrolytic
1 0.1µF MKT polyester
2 .056µF 5% MKT polyester
2 .047µF MKT polyester
1 .039µF 5% MKT polyester
1 .033µF MKT polyester
Resistors (0.25W, 1%)
1 2.2MΩ
1 15kΩ
1 120kΩ
3 10kΩ
14 100kΩ
3 1.8kΩ
1 47kΩ
1 390Ω
1 33kΩ
1 22Ω
1 27kΩ
2 10Ω
2 22kΩ
Diesel horn parts
Note: add 1 x 0.47µF, 1 x 0.1µF
& 1 x 0.12µF 5% MKT polyester
capacitors to include the diesel
horn sounds listed in Table 1.
RESISTOR COLOUR CODES
❏
No.
❏ 1
❏ 1
❏
14
❏ 1
❏ 1
❏ 1
❏ 2
❏ 1
❏ 3
❏ 3
❏ 1
❏ 1
❏ 2
Value
2.2MΩ
120kΩ
100kΩ
47kΩ
33kΩ
27kΩ
22kΩ
15kΩ
10kΩ
1.8kΩ
390Ω
22Ω
10Ω
4-Band Code (1%)
red red green brown
brown red yellow brown
brown black yellow brown
yellow violet orange brown
orange orange orange brown
red violet orange brown
red red orange brown
brown green orange brown
brown black orange brown
brown grey red brown
orange white brown brown
red red black brown
brown black black brown
5-Band Code (1%)
red red black yellow brown
brown red black orange brown
brown black black orange brown
yellow violet black red brown
orange orange black red brown
red violet black red brown
red red black red brown
brown green black red brown
brown black black red brown
brown grey black brown brown
orange white black black brown
red red black gold brown
brown black black gold brown
July 1994 57
Make sure that all polarised parts are correctly oriented when installing them
on the PC board & don’t forget the wire link. A small 8-ohm loudspeaker
hidden underneath the layout can be used to provide the sound. This should be
mounted near a level crossing or some other appropriate place.
across the output to maintain high
frequency stability.
Power for the circuit can be derived
from a 12V DC plugpack supply or
from the train controller itself. A 10Ω
resistor and a 1000µF capacitor provide supply decoupling and filtering.
followed by the diode and the capacitors.
Note that the values shown for C1,
C2 & C3 are for the steam whistle
simulation. If you want a diesel horn
sound, these capacitors will have to
be selected from Table 1. There are
three different diesel horn sounds to
Construction
choose from, to suit your locomotive.
The Steam Train Whistle circuit is In addition, the noise generator must
built on a PC board coded 09305941 be disabled by omitting the 47k# mixand measuring 142 x 61mm. Fig.3 ing resistor at pin 1 of IC1
Fig.3 shows switches S1 and S2
shows the parts layout on the board.
Begin construction by inserting the mounted on the board and you can
PC stakes (for the external switches) do the same if you wish. In most apand the wire link. This done, install plications, however, the switches will
the ICs, making sure that they are ori- be mounted separately from the board
(eg, on the control panel) or some other
ented correctly.
The resistors are installed next, triggering device will be used.
The main point to watch here
+12V
is that the switches are correctly
D1
oriented (ie, the flat section on
33k
1N4148
each switch body goes towards the
adjacent transistor). If you orient
5 6
the switches incorrectly, the whis100k
Q1
IC4c
tle will sound permanently when
BC548
C
10k B
4
power is applied.
390
15k
Finally, install the transistors
E
(Q1 & Q2), VR1 and the PC-mount
FAST
S2
screw terminals. The unit should
LEVEL CROSSING
STEAM
now be carefully checked to
DETECTOR
WHISTLE
ensure that all parts are in their
Fig.5: this diagram shows how the Level
correct locations and that all poCrossing Detector can be used to trigger
larised parts are correctly oriented.
the Steam Whistle circuit. The output
The circuit is designed to be
from the Level Crossing Detector simply
powered from a regulated +12V
takes the place of switch S1 (or switch S2
supply. Our Railpower Walk
if you want a fast attack time).
58 Silicon Chip
around Throttle for Model Railroads
(April 1988 and May 1988) and the
Infrared Remote Control for Model
Railroads (April, May and June 1992)
have suitable supply rails or, as previously mentioned, you can use a 12V
DC plugpack supply.
To test the unit, set VR1 to mid-position, connect the loudspeaker and
apply power. The steam whistle (or
diesel horn) should now sound when
either S1 or S2 is pressed. Adjust VR1
so that the unit produces the desired
volume.
A basic installation would simply
involve mounting the switches in
a convenient position on the main
control panel of your layout. Leads
could then be run back to the PC board,
which could be hidden under the layout along with the loudspeaker. The
best place to mount the loudspeaker
would probably be near a level crossing or near a station or tunnel.
If you do elect to use this approach,
make sure that the switch wiring is
correct (see previous warning).
A more complex arrangement would
involve using the Level Crossing Detector (SILICON CHIP, March 1994) to
trigger the unit. All you have to do
is connect the output from the Level
Crossing Detec
tor across one set of
switch terminals – see Fig.5. That way,
the steam whistle will automatically
sound each time the train goes through
the level crossing. The whistle will
sound for as long as it takes the train
to pass through the section between
the detection magnets.
A third option is to trigger the steam
A Simple Timer Circuit For The Steam Train Whistle
+12V
This simple interface
10
circuit will enable you to
16VW
10k
Q1
10k
BC548
trigger the Steam Train
4
8
C
OUTPUT TO
7
3 10k B
D1
Whistle from either the
D1
STEAMWHISTLE
TIME
10k
10k
10k
10k 1N4148
1N4148
SWITCH
ADJUST
IC1
Level Crossing Detector
TO
E
VR1
7555
100
LEVEL CROSSING
5
6
or from a separate reed
100k
DETECTOR OR
.01
REED SWITCH
switch, and have it sound
2
1
0.1
for a preset time (adjustable
47
from 0.5 to 5.5 seconds).
N
B
INPUT
The circuit is simply a
E
C
S
monostable which, when
VIEWED FROM
REED
triggered, provides a low
BELOW
SWITCH
STEAM WHISTLE TIMER
output signal of between
0.5 seconds and 5.5 secFig.6: the circuit for the Steam Whistle Timer uses monostable IC1 to drive
onds, depending on the
switching transistor Q1. VR1 adjusts the period.
setting of trimpot VR1.
This low output can be used to
capacitor decouples the supply
so that the magnet will close the
simulate the closing of a switch.
for IC1, while the 0.1µF capacitor
contacts.
Fig.6 shows the circuit details.
at pin 5 decouples the internal
IC1 is a 7555 timer which is con66% resistive divider across the
PARTS LIST
nected as a monostable. Initially, its
supply.
1
PC
board, code 05207941,
pin 2 input is high, the pin 3 outConstruction of the circuit in62 x 39mm
put is low and transistor Q1 is off.
volves assembling the parts onto
1 7555, LMC555CN, TLC555
When a low going signal is applied
a PC board coded 05207941 (62 x
CMOS timer (IC1)
to the input, pin 2 is pulled low via
39mm) – see Fig.7. Follow the over1 BC548 NPN transistor (Q1)
a .01µF capacitor. As a result, pin
lay diagram when installing the
1 1N4148, 1N914 diode (D1)
3 now goes high and turns on Q1
parts on the board and make sure
1 100kΩ horizontal trimpot
which in turn triggers the Steam
that D1, IC1 and the electrolytic
4 10kΩ 0.25W 1% resistors
Train Whistle.
capacitors are oriented correctly.
1 100Ω 0.25W 1% resistor
The pin 3 output remains high
The circuit can be tested by ap6 PC stakes or 1 x 4-way & 1
until the 47µF capacitor at pins 6
plying power and shorting the inx 2-way PC-mount screw
and 7 charges to 66% of the supply
put terminals to trigger IC1. When
terminals
voltage. This period is set by the
this is done, the steam whistle
value of VR1 and its series 10kΩ
should sound.
Capacitors
resistor. In practice, VR1 is adjustThe reed switch can be laid
1 47µF 16VW PC electrolytic
ed to set the required duration of
inside the track and triggered by
1 10µF 16VW PC electrolytic
the whistle.
a permanent magnet in a similar
1 0.1µF MKT polyester
Power for the circuit is derived
manner to the Level Crossing De1 .01µF MKT polyester
from the +12V rail used to power
tector. Note that the reed switch
the Steam Train Whistle. A 10µF
will need to be oriented correctly
Fig.7: the parts layout for the timer circuit.
whistle using the monostable circuit
shown in Fig.6. This option allows
you to set the duration of the whistle
to between 0.5 and 5.5 seconds and
Fig.8: the full-size PC board pattern.
will give a more realistic effect.
Naturally, the loudspeaker should
be mounted near to where the train
will be when the whistle blows, to
ensure maximum realism. If you want
the whistle to sound at different locations on the track, just add additional
SC
circuits.
July 1994 59
|