This Blog describes the ongoing development of a 16mm scale 45mm gauge garden railway situated in the North West of England, UK from 2004 to the present day.
I can't believe it is four months since my last update on progress. At this time of year, not a lot happens outside. Rather than full running-sessions, there are occasional part running-sessions and test runs. I have continued shooting the next instalments of the year long video and carried out some repairs and finishing - off jobs in the workshop. I have added a new loco to the roster, but that is currently being rebuilt to improve its appearance and running. A new bit of electronic kit has been added to the workshop and some sound effect modules added to the outside.
Infrastructure
Sound modules
As indicated above, this time of year is not the best for carrying out outdoor work, but I have made use of some low cost MP3 players to add ambient sound effects to the railway.
At present, the sawmill has some relevant steam powered sawmill sound effects and the cattle trucks can be equipped with appropriate sounds of cows.
As the players have plenty of spare capacity on their SD cards for other sounds, which can be made to loop indefinitely, I will probably add more effects and place them at other strategic points around the railway.
Most of the 3D scanned and printed figures in 1930s costume have now been painted. The fellow members of the amateur drama society who volunteered have been given a model of themselves mounted on a plaque.
Their twins have been added to my stock of figures for deployment when running sessions resume in the Spring.
Rolling Stock
Cardboard Hunslet
The major development with rolling stock is the addition of another loco - a Quarry Hunslet(ish) loco constructed from a Rail-Road cardboard kit. Having read an account of a loco constructed from card in the February 2023 edition of Garden Rail, I decided to give it a try by evaluating to potential of a Rail-Road (formerly Loco Lines) kit.
I am in two minds about the card's efficacy as a construction medium. The advantages seem to be the eas with which the material can be cut and joined and also the affordance of having the livery and lining pre-printed. The disadvantages (for me) are the durability of the finished loco and, paradoxically, the added complication of protecting the finish of the loco during the construction process - all to easy to mar the surface with a gluey finger. The kit doesn't include detailing enhancements but these can be bought elsewhere (eg Garden Railway Specialists).
The chassis which comes with the kit, is just that. It is very rudimentary and underpowered. However, to be fair, it claims only to be a basic chassis and its price reflects this.
I am in the process of enhancing the appearance of the loco and giving it a more powerful chassis.
Refurbishing locos
A couple of locos have been refurbished. Loco #6, Manning Wardle 0-6-0T Harthill, and Loco #7, Fowler 0-4-0DM, Tollemache have had a few minor repairs to their bodywork and various blemishes touched-up. The Fowler has also had its number plates re-attached to the sides of the cab, using clear silicon sealant as I am discovering that Superglue isn't that super and doesn't really glue brass to paintwork securely.
Their bodies have both been given a couple of coats of clear lacquer to add some extra protection and to unify their liveries.
Battery loco guides
I have written three generalised guides to the construction of battery locos:
Two more guides are in the process of being written:
Scratchbuilt locos
3D printed locos
These guides are designed to complement the information I have already published on batteries and radio control.
Other
Card cutter
The article about the card loco in Garden Rail mentioned the use of a computer controlled card cutter which seemed like a useful bit of kit. In addition to cutting card, it can also cut thin plasticard and self adhesive vinyl with a precision of 0.1mm.
Looking online, these cutters appeared to range in price from £200 GBP to over £650 GBP, somewhat more than my slender budget will allow.
A quick search of eBay revealed a few secondhand cutters for starting prices from £150 to £350. I did consider adding one of these cheaper cutters to my Christmas and Birthday list but I then spotted a cutter with a starting price of £19.99 GBP. It was without a power supply and untested but I felt it was worth a punt.
I won it for £19.99 GBP. A suitable power supply was acquired for the modest sum of £14 GBP, and a new blade and cutting mat for £10 GBP each. The software was downloaded and I used some of my stock of self adhesive white vinyl to create some letters for my goods stock.
I was delighted to find my tentative venture has paid off. Vinyl lettering and masking is the first job on the agenda. I might then explore its capabilities for cutting card and plasticard.
Videos
The History of the PLR Part 6
The latest instalment of the ongoing history of the PLR has now been completed and posted on YouTube.
I am finding these videos which have now become an annual event, are handy for me in remembering what I've done in the past year. They also act as an incentive for me to get jobs done.
Year Long Video
I have now completed the November, December and January segments of my Year Long video. Having broken the journey from one terminus to the other into twelve sections, I have drawn up a fairly detailed shooting schedule to ensure that there aren't any continuity errors as the train progresses Down and back Up the line. I'm also trying hard to choose the days for filming which provide contrasting weather conditions.
I'm pleased to say that January's session coincided with a cold, snowy spell of weather.
As January marks the start of each journey, the shoots took place at each of the two termini - Beeston Market:
...... and Bickerton:
Now looking forward to seeing what the weather brings in February and March. I've planted some crocus and miniature daffodil bulbs alongside the track earmarked for these two sessions - I just hope they will be in bloom at the middle of each month.
I am constantly surprised by the low prices of tech gadgets on eBay and other online shopping platforms such as AliExpress. I sometimes invest in what I consider to be intriguing cheap items just to explore their potential. One such impulse-buy was a couple of MP3 sound cubes.
Overview
Not only were they ridiculously cheap, they were compact and versatile, including an inbuilt FM radio receiver and, as it turned out, a fairly loud amplifier. A quick experiment revealed that, for garden railway purposes, they could easily be set-up to play sound clip files (both .MP3 and .WAV) as loops.
The unit is quite compact (50x48x52mm) and can presently be bought for less than £10 GBP on eBay (Search for MP3 cube player).
The controls are quite basic and similar to most gadgets of this kind.
The menu button allows you to choose between the radio and the mp3 player, and also to loop the playing each file on the micro SD card. Pressing the last or next buttons allow you to select the required files to be played and holding these down allows you to increase and decrease the volume. The start/stop button, as expected, allows you to play or stop playing a file.
Of course, it also needs a micro SD card but, as it will only be playing a single file, a 2gB card will be sufficient. These can be picked up for around £1.50 on eBay.
PS - I have since discovered a similar cube player on eBay (without the FM radio) for a third of the price - though I haven't tried it and so don't know how it compares.
Triggering effects remotely
I haven't yet taken one of them apart to figure out if it can be triggered remotely through one of my Deltang/Micron RC receivers but, given my previous experience of triggering a similar device (see How I used a cheap MP3 player as a loco soundcard), I would imagine these can be readily adapted.
Sourcing the sounds
I decided that I would use these cubes to provide ambient sound effects around the railway - more specifically, the sound of a sawmill in action for Peckforton timber yard and the sound of cattle lowing for one of my cattle wagons.
The first task was to track down sources for these sounds. I used a couple of sources, a free sound effects website (Freesound.org) for the cattle sounds and YouTube for the sawmill effects.
Freesound.org
A search for "cows" revealed 713 sounds.
Pressing the 'play' button on each file enabled me to hear each sound and so, after identifying three sounds which I felt were appropriate, I downloaded them. This required me to register with the website but, given the sounds are free, this seems to be only a minor inconvenience.
A search for "sawmill" yielded just fourteen files. Only one of them was, I felt, appropriate as it was recorded in a steam powered sawmill, so I downloaded that. I wanted a wider variety of sawmill sounds and so turned to YouTube.
YouTube.com
YouTube generally provides a wide range of files, but it's a lot harder to sift the wheat from the chaff.
A search for "Steam sawmill" revealed many more clips which were suitable.
After selecting a couple of videos which seemed to have a good selection of sounds, the next problem was, of course, how to download them. Rather than signing-up for a YouTube account, I decided to use AnyVideoConverter - a versatile little freebie program which not only enables me to convert a wide range of audio and video clips into different formats, it can download YouTube videos and save them - in this case I wanted them saved as MP3 files
To download the required video and convert it require six fairly straightforward steps:
The format for the file was chosen from the drop-down list - in this case MP3 (it's towards the bottom of the list beside the musical note symbol)
The Add URL tab was clicked
The + sign was clicked to add a new URL
The URL for the video clip was pasted in (using Control V) after having been copied from the YouTube Share tab
Start download was clicked
Once the file had finished downloading, the Convert button was clicked
Editing the sound clips
Although I could have simply just transferred the sound clips to the SD card in each player, I decided to mix them together. This has allowed me to overlay one sound on top of another and provide some variation. To do this, I used Audacity - a well established freebie open-source sound editing package.
The sound effects certainly add a new dimension to the ambiance of the railway. The players are charged up periodically using a bog-standard USB charger and I find the batteries easily last for an operating session of a couple of hours - though I only tend to play the sounds when I am filming in their vicinity. The added bonus is that, if there is something interesting on the radio, I can switch one of the cubes over the Radio 4 while relaxing in a deckchair with a cup of tea.
In the previous stages of my investigations into controlling a loco using a Bluetooth phone app you will see that -
..... I started off by using a freebie app and its associated code provided by Steve Massiker at arduinorailwaycontrol.com(see Part 1)
.... I then tinkered with the default speed settings to try and improve the way the loco responded at slow speeds (see Part 2)
...... I moved on to explore the potential of a different phone app (RoboRemoFree) as this enabled me to have 255 speed steps rather than the nine speed steps offered by Steve's set-up (see Part 3)
In this part of my investigations, I will describe how I added a set of digitised sound files to be (sort of) synchronised with the speed of the loco.
Introduction
Arduino is an Open Source development, which means the resources are made freely available for anyone to explore and further enhance. As a consequence, over the years, numerous add-ons have been developed which enable the basic micro-controller boards to be extended. In the first parts of my explorations, a motor driver and a Bluetooth transceiver were added. In this section, I have added another module - a small SD card player which can be controlled by the Arduino board.
The DFPlayer Mini not only interfaces with the Arduino, it also includes an audio amplifier enabling it to be connected directly to a speaker to provide up to 2 watts of output. Its small size (20 x 20 x 10mm) makes it ideal for squeezing into the insides of a battery powere loco. I bought mine from a UK supplier for £3.50, but they can be bought directly from China or Hong Kong for less the £1.00.
To control the DFPlayer, I downloaded a library of instructions from the GitHub website and installed them in the Arduino IDE program.
The procedure for installing the library I followed was:
Click the 'Sketch' menu item and select Include Library and then Add ZIP. library
Navigate to where I saved the ZIP file
Open it
The library is now installed. When selecting the Include Library option once more, the new library should appear the the bottom of the list of installed libraries.
Before editing the code, I needed to wire up the Player, motor driver and Bluetooth transceiver to the Nano, so I would know to which pins they were connected.
The wiring
I needed to change the existing wiring (seePart 3) to add the Player to the Nano. The Player and the Bluetooth transceiver are both serial communication devices and only one serial device can normally be added to the Nano. However, it is possible to add another serial device by using the port used by the Nano to communicate with the computer. In addition, the library which I had just installed required the Player to be connected to pins D8 and D9 and so, the motor driver needed to be connected to another pin which could provide PWM output.
You will notice when comparing this wiring diagram with that used previously, that I made a series of other changes as well.
I removed the voltage regulator. The L298N motor driver can supply 5 volts (provided its input does not exceed 12 volts) and so this was tapped to power the Player, the Nano and the HC-06 transceiver.
I kept the control pins for the motor driver the same (D5 and D6) but moved the PWM input to pin D3.
The serial connections for the DFPlayer were attached to pins D8 and D9.
The TX and RX connections for the HC-06 were attached to Pins D1 and D0 via a plug and socket so the transceiver could be disconnected when the Nano was connected to the computer.
A 3mm white LED was connected to Pin D12 via a 220ohm resistor for a front light.
The Sound files
I prepared twelve sound files:
001 - Silence (1 min)
002 - Silence plus horn sound (2.5 seconds)
003 - engine start-up to idle (7 seconds)
004 - idle (15 secs)
005 - idle plus horn (2.5 seconds)
006 - slow run (15 secs)
007 - slow run plus horn (2.5 secs)
008 - mid run (15 secs)
009 - mid run plus horn (4 secs)
010 - fast run (15 secs)
011 - fast run plus horn (2.5 secs)
012 - shut down (7 secs)
It's not essential to have the numbers at the start of each file name, but it is essential that the files are saved on the SD card in the correct order. When the Arduino executes the command to play, for example, file 3, it will play the third file stored on the card. Putting the numbers in front of the file names helps ensure they are in the correct order before they are copied and pasted from the computer to the card.
I downloaded several sound clips from the internet until eventually homing in on some clips of an old tractor on the SoundSnap website. Although it cost me $15 to buy five sound clips (only three of which I used), I had been unable to track down anything which gave me the range of sounds I wanted. I figured that there was not a lot of difference between the sounds made by a tractor and a narrow gauge diesel locomotive - though no doubt some purists will disagree!
The clips were edited using Audacity - wonderful free program which enabled me to select and save sections from the downloaded sound files and also superimpose the sound of the horn over the sound of the engine noise, and adjust the volume of the two so one wasn't drowned out by the other.
The edited files were exported as 16-bit WAVs, which means they play immediately they are called up by the Arduino code. On other players with MP3 files, I have found there can be a silent gap of up to a second between tracks or when one track loops around.
Unfortunately, as the files I used were edited from paid-for originals, I cannot provide them here so I am afraid you will have to do your own tracking-down of files (or also pay for the ones I used)
The RoboRemo App
As I wanted more than five controls on the screen of the app, I had to abandon the free version of RoboRemo and invest in the paid-for Bluetooth version - at a cost of £2.89.
I set up five buttons and one slider:
The actions for the buttons were (without the quote marks):
Reverse - 'r'
Forward - 'f'
STOP - 'x'
Horn - 'h'
Engine start/stop - 'e'
The slider was given an id of 's' and the scale (min, max) set from 30 to 255.
The code
As previously, the entire code is shown here first followed by a break-down of each section explaining its function. This should enable you to copy and paste the code into Arduino IDE if you want to follow in my footsteps
//Train control using RoboRemo
//Slider on app has id of 's' and range of 40 to 255
//Forward button on app has action 'f'
//Reverse button on app has action 'b'
//STOP button on app has action 'x'
#include <softwareserial .h="">
#include <DFPlayerMini_Fast.h>
// SOFTWARE SERIAL
SoftwareSerial mySerial(10, 11); // RX, TX for SD player
DFPlayerMini_Fast myMP3; // Initialising SD Player
//Pin connections
int motorSpeedPin = 3;
#define IN1 6 //motor Fwd
#define IN2 5 //motor Reverse
#define fwdLED 12 //Front facing LED pin
#define revLED 13 //Rear facing LED pin
// VARIABLES //
int val = 0; //Speed
int oldval = 0; //Previous speed
int Track = 1; // which track is playing
char cmd[100]; //Command from app
int cmdIndex; //Used to index character in the command
int loSound = 80; // Speed setting between idle and slow run sounds
int midSound = 120; // Speed setting for slow to mid run sounds
int hiSound = 170; // Speed setting for mid to high speed run sounds
void setup() {
// Initializing Serial (Hardware and Software Serial)
Serial.begin(9600);
mySerial.begin(9600);
myMP3.begin(mySerial);
myMP3.volume(30); //Volume setting
myMP3.loop(1); //Loops first (silent) sound track
// Initialising Motor-Driver
pinMode(motorSpeedPin, OUTPUT);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
analogWrite(motorSpeedPin, 0);
// Initialising LED pins
pinMode(fwdLED, OUTPUT);
pinMode(revLED, OUTPUT);
digitalWrite(fwdLED, HIGH); //Turns on front LED as indicator that loco is switched on
}
void loop() {
// ---- Intrepreting app commands
if(Serial.available()) {
char c = (char)Serial.read();
if(c=='\n') {
cmd[cmdIndex] = 0;
exeCmd(); // execute the command
cmdIndex = 0; // reset the cmdIndex
} else {
cmd[cmdIndex] = c;
if(cmdIndex<99) cmdIndex++;
}
}
}
//// FUNCTIONS ////
void exeCmd() {
if(cmd[0]=='s') {
oldval = val;
val = 0;
for(int i=2; cmd[i]!=0; i++) { // number begins at 2
val = val*10 + (cmd[i]-'0'); // if cmd is "speed 100", val will be 100
}
}
if(val<loSound-10) val=0; //Sets speed to zero to stop motor buzz on default PWM setting
// Direction and Stop
if (cmd[0] =='f') { // (f) Forward
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(fwdLED, HIGH);
digitalWrite(revLED, LOW);
}
if (cmd[0] =='b') { // (b) Backward
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(fwdLED, LOW);
digitalWrite(revLED, HIGH);
}
if (cmd[0] =='x') { // (x) Stop button
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(fwdLED, LOW);
digitalWrite(revLED, LOW);
myMP3.loop(1);
Track = 1;
val = 0;
oldval = 0;
}
analogWrite(motorSpeedPin, val); // Throttle
//Playing the SD card tracks
//There are twelve tracks on the SD card
//001 - Silence (1 min)
//002 - Silence plus horn sound (2 seconds)
//003 - engine start-up to idle (15 seconds)
//004 - idle (15 secs)
//005 - idle plus horn (2.5 seconds)
//006 - slow run (15 secs)
//007 - slow run plus horn (2.5 secs)
//008 - mid run (15 secs)
//009 - mid run plus horn (4 secs)
//010 - fast run (15 secs)
//011 - fast run plus horn (2.5 secs)
//010 - shut down (3 secs)
if(cmd[0]=='e' && Track==1){
myMP3.play(3);
delay(10000);
myMP3.loop(4);//Play 'engine start-up' and then on to 'idle' (Track 4)
Track = 4;
cmd[0]='n';
}
if(cmd[0]=='e' && Track==4){
myMP3.play(12);
delay(7000);
myMP3.loop(1);//Play 'engine shut down' then on to silence (Track 1)
Track = 1;
cmd[0]='n';
}
if(cmd[0]=='h' && (Track==1 || Track==4 || Track==6 || Track==8 || Track==10)) {
myMP3.play(Track + 1); //Play relevant horn track
delay(3000);
myMP3.loop(Track);
}
if(Track==4 && val>loSound){
myMP3.loop(6);
Track = 6;
}
if(Track==6 && val<loSound){
myMP3.loop(4);
Track = 4;
}
if(Track==6 && val>midSound){
myMP3.loop(8);
Track=8;
}
if(Track==8 && val<midSound){
myMP3.loop(6);
Track=6;
}
if(Track==8 && val>hiSound){
myMP3.loop(10);
Track=10;
}
if(Track==10 && val<hiSound){
myMP3.loop(8);
Track=8;
}
}
NOTE:
Check that the symbols are showing up correctly in the code - some browsers change them.
For example the last part of the code should look like this
How it works
The first section sets up the serial connection and opens the library for the DFPlayer
#include <SoftwareSerial.h>
#include <DFPlayerMini_Fast.h>
// SOFTWARE SERIAL
SoftwareSerial mySerial(10, 11); // RX, TX for SD player
DFPlayerMini_Fast myMP3; // Initialising SD Player
The next section sets up the pins for the various devices. Note: Because the Bluetooth transceiver is using the Hardware Serial port, it does not need to be initialised.
//Pin connections
int motorSpeedPin = 3;
#define IN1 6 //motor Fwd
#define IN2 5 //motor Reverse
#define fwdLED 12 //Front facing LED pin
#define revLED 13 //Rear facing LED pin
The next chunk of code sets-up the variables used in the program:
// VARIABLES //
int val = 0; //Speed
int oldval = 0; //Previous speed
int Track = 1; // which track is playing
char cmd[100]; //Command from app
int cmdIndex; //Used to index character in the command
int loSound = 80; // Speed setting between idle and slow run sounds
int midSound = 120; // Speed setting for slow to mid run sounds
int hiSound = 170; // Speed setting for mid to high speed run sounds
Hopefully the comments (signified with a prefix of //) make them self explanatory.
The setup section of the program is very similar to that used in Part 3, with a couple of slight amendments:
void setup() {
// Initializing Serial (Hardware and Software Serial)
Serial.begin(9600);
mySerial.begin(9600);
myMP3.begin(mySerial);
myMP3.volume(30); //Volume setting
myMP3.loop(1); //Loops first (silent) sound track
// Initialising Motor-Driver
pinMode(motorSpeedPin, OUTPUT);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
analogWrite(motorSpeedPin, 0);
// Initialising LED pins
pinMode(fwdLED, OUTPUT);
pinMode(revLED, OUTPUT);
digitalWrite(fwdLED, HIGH); //Turns on front LED as indicator that loco is switched on
}
The initialisation of the serial connections is slightly different as the Bluetooth module is connected to the Hardware Serial port and so is initialised with Serial.begin(9600) which sets up the baud rate for the communication. Similarly, the baud rate for the player is also set at 9600.
The final command turns on the front LED. I found this useful when testing the loco, to check that the Arduino board was switched on and functioning as expected.
The main loop is exactly the same as in Part 3. This parses the information sent by the app which arrives as a series of individual characters, and then when the terminal character for each string is receiver ('/n'), puts the characters together as a string.
There is only one function (exeCmd), the first part of which was explained in Part 3.
//// FUNCTIONS ////
void exeCmd() {
if(cmd[0]=='s') {
oldval = val;
val = 0;
for(int i=2; cmd[i]!=0; i++) { // number begins at 2
val = val*10 + (cmd[i]-'0'); // if cmd is "speed 100", val will be 100
}
}
The next statement is new:
if(val<loSound-10) val=0; //Sets speed to zero to stop motor buzz on default PWM setting
I find that the motor buzzes because the default PWM setting (490Hz) is quite low. So when stationary, I turn off the motor to stop it from buzzing. I am in the process of playing around with the PWM settings and intend to increase the setting to help prevent excess noise from the motor.
The main differences are that in each sub section, there are commands to control the forward and reverse LED lights - turning them on (by setting the output to HIGH) or turning them off (by setting the output to LOW). In addition, at the end of the STOP sub-section, in addition to turning off both LEDs and setting the speed (val) to zero, the player is instructed to play the first track (silence). The final section of the Function, controls the SD player.The first part of this section controls what happens if the 'e' instruction is received from the Bluetooth app (ie when the Engine Start/Stop button is pressed).
if(cmd[0]=='e' && Track==1){
myMP3.play(3);
delay(10000);
myMP3.loop(4);//Play 'engine start-up' and then on to 'idle' (Track 4)
Track = 4;
cmd[0]='n';
}
if(cmd[0]=='e' && Track==4){
myMP3.play(12);
delay(7000);
myMP3.loop(1);//Play 'engine shut down' then on to silence (Track 1)
Track = 1;
cmd[0]='n';
}
The first 'if' statement checks whether the player is playing Track 1 (ie silence). If so it will play Track 3 (engine start-up) for seven seconds and then move on play the sound of the engine idling (ie track 4). The second 'if' statement, checks whether Track 4 is playing (ie the idling sound). If so, it will play the engine shot-down track (Track 12) for seven seconds and then play silence (Track 1). The next 'if' statement, detects whether the horn button has been pressed on the app. If so, it then checks which track is playing and plays the track following it - for example, if Track 6 (slow run) is playing, it will play track 7 for 3 seconds before returning to play Track 6.
As you can see, if one of the trigger values for speed which were set at the beginning of the program is reached, it checks which track is playing and either moves up or down to the next relevant track.
Conclusion
Of source, it is not perfect. In an ideal world, the pitch and speed at which the sound of the engine is played would vary in proportion to the speed of the locomotive. This is not achievable when the sounds are tracks on an SD player. I did try playing a track which accelerated or decelerated the sound as the tracks changed, but this proved impossible to work reliably. Like the horn or the engine start/stop tracks, the Arduino was unable to do something else and, as these tracks were triggered by a speed change, it was unable to detect the new speed until the track finished playing - which either led to some very jerky running or completely confused the system as to which track ought to be playing. If someone with more programming knowledge than me is able to sort out this conundrum I will be very grateful. In the meantime, I am quite pleased with the outcome.
It took me several tries until I got the relative speeds of the sounds matched to the speed of the loco without making the jump from one track to the next too noticeable. If I had more time and more patience, I could add several more speed triggers and more tracks to make the increases and decreases in engine sound less noticeable - but I'll leave that to someone else.
I have organised this post to, hopefully, cover various combinations of soundcards and Deltang / RC Trains receivers. I cannot cover all possible combinations but have focused on the soundcards and receivers which I have used on my own railway, ie:
Hopefully there will be something here which meets your needs - if not directly then maybe the information could enable you to apply the general principles shown here to other soundcard/receiver combinations.
How soundcard effects are triggered
The majority of soundcards require 0v inputs to trigger their special effects (apart from DCC interfaced soundcards). In essence, to trigger an effect (such as the whistle), the input terminal on the card needs to be connected to the negative (0v) terminal of its power supply. This could be done with a simple switch such as a push button, or a reed switch mounted under the loco and operated by a magnet placed on the track.
However, with radio control, it is possible to trigger the effects remotely at any time by pressing a button or flicking a joystick on the transmitter. The receiver in the loco interprets this signal and in some way connects the 0v (negative) supply to the relevant input on the soundcard.
For example, a servo connected to the receiver could be arranged to press a push-button switch. My friend in Australia (Greg Hunter - Sandstone and Termite Railway) uses servos to operate reversing switches in his locos .......
and servo operated push-button micro-switches for controlling accessories.
Alternatively, it is possible to buy switching units which can be connected to the pins of the receiver to carry out the switching.
By contrast, the great advantage of theDeltang / RC Trainsreceivers is that they have outputs which can deliver 0v without the need for any external circuitry.
Below are some examples of how various soundcards can be connected to Deltang receivers to trigger onboard effects such as a whistle.
The Deltang / RC Trains Rx65b receiver
The Deltang / RC Trains Rx65b receiver/controller has fifteen pads which provide outputs and can be used as inputs (eg for sensing when a reed switch has been activated by running over a magnet).
Pads 1- 12 provide outputs of 3.5v or 0v (ground) and are limited to a maximum of 20mA output (but lower is better!). Pads A, B and C are buffered and provide either 0v (ground) when on or are 'floating' (ie disconnected) when off. They can handle currents of up to 2 amps (but lower is better - remember the whole Rx is rated at 2A including the motor!).
The outputs respond to signals sent from various transmitter channels. The way each pad responds to signals can be reprogrammed (see How to reprogram Deltang receivers) but they are provided with a useful set of default values when they are initially purchased.
Since the Rx65b was released in 2014, the default outputs have changed. From November 2015 (version 611-11 - shown by two 11s in gold on the large chip on the circuit board), .........
This is an Rx65b v611-10
This is an Rx65b v611-11
.......... the default outputs on the Rx65b v611-11 suitable for controlling soundcards are:
Item
Setting
Details
P3
On/Off
Ch2, Idle high, 0v when channel is Low, Momentary action
P4
On/Off
Ch4, Idle high, 0v when channel is Low, Momentary action
P5
On/Off
Ch5, Start high, toggle when channel is Low, Latching action
P9
On/Off
Ch3, Idle high, 0v when channel is High, Momentary action
P10
On/Off
Ch3, Idle high, 0v when channel is Low, Momentary action
P11
On/Off
Ch3, Start high, toggle when channel is High, Latching action
P12
On/Off
Ch3, Start high, toggle when channel is Low, Latching action
P15 (C)
On/Off
Ch5, Start disconnected, 0v (on) when channel is Low, Momentary action
To some readers, the above table may look like gobbledegook initially, but with a little explanation, hopefully it will make more sense.
For example, the output from P3 (Pad 3) is normally high (ie gives 3.5v) but when the receiver gets a signal from the transmitter on channel 2, the output changes to 0v until it no longer receives that signal - ie it will deliver 0v while the button is being pressed on the transmitter.
The output from Pad 5 starts off high (3.5v) but changes to 0v when it receives a signal on Channel 5 (eg when the bind button is pressed on Deltang transmitters). It will stay at 0v until Channel 5 (the bind button) is activated again.
Because soundcards tend to operate with an internal voltage of 5v and Deltang receivers have an internal voltage of 3.3v or 3.5v, it is advisable to put a 1k ohm resistor in the leads connecting the output pads of the receiver to the input pads of the soundcard to help prevent excess current being passed from the soundcard to the receiver (see below).
Connecting the Rx65 to a MyLocoSound (MLS) Universal steam soundcard
The most recent version of the Universal MyLocoSound (MLS) soundcardhas five input triggers for:
Loco whistle
Bell
Guard's whistle
Safety valve
Airbrake pump
in addition to its digitally created steam or diesel engine sounds which can be either synchronised with the motor voltage or a wheel cam.
Any of the pads which deliver 0v can be used to trigger the MLS card. This is how I have wired-up a MyLocoSound sound card to one of my locos which is bound to a Deltang / RC Trains Tx20 transmitter:
Pad C (Channel 5 / Bind button) to soundcard F1 input (Whistle)
Pad 3 (Channel 2 / Function button on Tx20) to soundcard F2 input (Bell)
Pad 9 (Channel 3 / Direction switch fwd) to soundcard F3 input (Guard's whistle)
Pad 4 (Channel 4 / Function button on Tx20 or reprogrammed Inertia knob on Tx22 or Tx24) to soundcard F4 input (Safety valve)
Pad 10 (Channel 3 / Direction switch rev) to soundcard F5 input (Airbrake pump)
Here's a video of the set-up in action with my RC Trains Tx20transmitter which has buttons to energise Channels 2, 3 (direction switch), 4 and 5 (bind button).
Connecting the Rx65 to the MTroniks / Spoerer DigiSounds card
As the name suggests, the MTroniks / Peter Spoerer DigiSoundscard uses digitised sounds to emulate the sounds of a diesel loco. The one I use in my locos is the Small Diesel card. Originally intended for boats, it comes in a waterproof housing with standard JST spaced pins for connection. It has two inputs - one to trigger the horn and the other to trigger the engine start/stop effect so the wiring for this is much simpler.
As with the MLScard above, any of the pads which deliver 0v can be used to trigger the sounds but in my IP Engineering 'Jessie' loco, I use the bind button on my Tx22 to trigger the horn and the direction switch for starting and stopping the engine sound. I have therefore used Pad C to trigger the horn and Pad 12 to trigger the engine start/stopeffect.
A short video of the soundcard in action (Please note - in this video I had reprogrammed an Rx65b v611-10 to provide non latching 0v outputs on P12. On the Rx65b v611-11, a latching 0v output is provided by default on P12 and so there is no need to leave the direction switch in the 'on' position. Flicking it 'on' and then off will start the engine sound and then flicking it 'on' and off again will stop the engine sound - I must make another video!)
Connecting an Rx65b to a Dallee DC v3 soundcard
I have two Dallee sound cards installed in my locos, one for steam sounds and the other for a diesel railcar. The wiring is the same for both. This is the Dallee DC v3 steam card. This card has now been superseded by a more recent model but the wiring will be largely similar.
As with all the soundcards shown here, the Dallee DCv3 card needs to
be wired up to the battery supply and to the motor leads initially. Once
that has been achieved, then various triggers can be connected to the
0v outputs of the Deltang / RC Trains Rx65b receiver.
In my case, I connected the whistle trigger input to Pad C, the cylinder blow-down (or full revs) trigger to Pad 11 and the sounds off trigger to Pad 12.
On a Deltang / RC Trains Tx22 transmitter, this means the whistle sounds when I press the Bind Button (Channel 5 low), the cylinder blow-down sounds when I flick the Direction Switch to the forward position (Channel 3 Low) and the sounds are muted when I flick the Direction Switch to the reverse position (Channel 3 High).
Here's the soundcard in action in my 'Anglicised' LGB Stainz locomotive. Still some slight adjustment needed to sync the chuffs to the motor voltage but it does demonstrate the various sounds in operation.
Connecting an Rx65b to a Phoenix 2k2 soundcard
I was fortunate enough to pick up a secondhandPhoenix 2k2 sound card on eBay for a very reasonable price. It was fitted to a flat wagon with wheel contacts, presumably so it could be towed behind any track powered loco to provide 'portable' sound effects.
When I bought the card, it was programmed with USA diesel sound effects
which, of course, were quite inappropriate for my UK based narrow gauge
railway and so I sent it off to Phil Partridge who now owns and runs RC Trains. He has the equipment and the wherewithal to reprogram Phoenix sound cards and so he set it up for me with a European steam sound. The whistle sounds quite meaty but I am impressed by the range of additional sounds which this card provides.
It was wired-up to an Rx65b in the usual way but as there are several sound triggers, I set it up so it would work with a Deltang/RC Trains Tx20 transmitter, which has a couple of additional buttons which use Channel 2 and Channel 4.
As can be seen, Pad 3 (Channel 2) is connected to trigger input 13 (bell), Pad 4 (Channel 4) is connected to trigger input 10 (drifting), Pad 9 (Channel 3 High) is connected to trigger input 12 (coal loading) and Pad 10 (Channel 3 Low) is connected to trigger input 11 (water fill) and Pad C (Channel 5) is connected to trigger input 14 (whistle).
This means that when I press the F1 button on my Tx20 transmitter, the bell sounds; when I press the F2 button, the loco chuffs start drifting rather than labouring; when I press the bind button, the whistle sounds; when I flick the direction switch forwards the coal fill sound starts when the loco is stationary and which I flick the direction switch the other way, there is the sound of the loco's water tank being filled.
Here's a video of the loco in action demonstrating all its sounds ......
The Deltang Rx102 receiver
The Deltang Rx102 is a fairly standard DSM2 receiver which does not has an ESC incorporated on the same board in the same way as the Rx65b. It can be connected directly to servos to operate, for example, the regulator and reverser controls on a live steam locomotive, or can be connected to a third party ESC such as the Brian Jones Mac 5 or the MTroniks Viper Loco 10.
The default outputs from the pins of the Rx102 are for directional lighting (Pins 6 and 7) or servos (Pins 1-5 and 8).
Pins
Default setting
Pin1:
Ch1 Servo [Throttle]
Pin2:
Ch4 Servo
Pin3:
Ch3 Servo [Direction]
Pin4:
Ch2 Servo
Pin5:
Ch5 Servo
Pin6:
Front light
Pin7:
Rear light
Pin8 (side):
Ch6 Servo
However, to make the Rx102 more suitable for triggering sound card effects, it is possible to reprogram the pins to give 'on/off' (ie 3.1v / 0v) outputs. Unfortunately this cannot be done with a Deltang or RC Trains Tx20 transmitter which is by far the easiest way; the reprogramming has to be done with a Deltang Prog 3 or Deltang Prog 4 programmer module which can be tricky to set-up (for more information see How to reprogram Deltang receivers).
Connecting the Rx65b and an Rx102 to a Technobots Programmable soundcard
The Technobots programmable soundcardwas originally developed for use in model boats but is well suited to the production of sounds for small to medium sized narrow gauge diesel locos.
As suggested by its name, the twelve electronically generated default
engine sounds can be reprogrammed to create your own tailored versions.
It has two inputs, for engine speed and horn. Unlike other soundcards
which detect the motor voltage from the ESC, the engine speed is
determined by the servo signal from the receiver. As the Rx65b
integrates the receiver and ESC on one board, the connection between the
receiver and the ESC is internal to the board and not normally
accessible. However, Pad 8 mirrors the servo output from Channel 1 and,
theoretically, it should be possible to connect the Technobots
Progammable Soundcardto an Rx65b using Pad 8 for the engine speed input and, say, Pad C for triggering the horn with the bind buttonor Pad 12 to trigger the horn from the Direction Switchon the transmitter.
However, I experienced difficulties with this arrangement in my diesel loco. The engine sounds worked well when going forward but were erratic when in reverse. Alan Bond, who developed the Technobots card, found no difficulty in interfacing his soundcard with an Rx65b in this way and so I have included the wiring diagram here in case you have more success. I experimented with other ways to interface this soundcard - so these are shown below.
This approach is probably the most straightforward. A third party ESC (I used a Brian Jones Mac 3) is connected to an RCT/Deltang Rx102. The 'servo' signal from the receiver passes to both the ESC and the soundcard. Pin 5 of the Rx102 was reprogrammed with a Deltang Prog 3 programmer so that it was 'off' (ie 0v) when the bind button (Channel 5) was pressed on the transmitter (see How to reprogram Deltang receivers). This worked well but I was finding that the level of motor control I was getting from the ESC was not as precise as it is from an RC Trains/Deltang Rx65b, particularly at slow speeds. As you may know from various videos of the Peckforton Light Railway (eg , operation and control are very important to me.
Eventually I decided to use a hybrid circuit. An Rx65b and an Rx102are both bound to the same Selecta channel on my Tx22 - the Rx65bcontrols the motor while the servo signal from the Rx102 controls the soundcard. A 5v voltage regulator circuit provides power from the 12v supply for the Rx102. Not the most elegant solution, but it works!
Here is the arrangement in action. I used one of the twelve default sounds for this video but subsequently I have tinkered with the sounds in the programmable soundcard to devise an even more rattly, clanking diesel.
Interfacing an Rx65b with the sound module from a greetings card
After building and fitting radio control to the diminutive Plate Frame Simplex kit fromIP Engineering (see How I constructed a Plate Frame Simplex), I decided to rise to the challenge of fitting it with sound. The main difficulty was, of course, size. I couldn't find a commercially available railway soundcard which was small enough to fit inside. However, I noticed on eBay that the sound modules which are fitted into greetings cards (eg those which play 'Happy Birthday" when they are opened were available quite cheaply - in my case, £1.29 including postage.
In addition to the soundboard, there was a speaker, two push buttons (one to play the sounds and one to record) and a microphone. After recording a suitable diesel engine sound, I removed the batteries, speaker, mike and the record push button and soldered a wire from the mike input to the 'play' button input to make the sound repeat (for more information on the modifications to the module see - How I modified a greetings card module as a soundcard).
Rather than triggering the sound from the Rx65b which could have been done quite easily by connecting any of the pads which give a 0v momentary output to the play button input, I fixed the play button into the roof of the cab on the Simplex. The sound is not exactly high fidelity, but does give the impression of the Simplex motor.
I have not (as yet) found a way of overcoming a half-second pause every 60 seconds as the sound loops back to the start - but for £1.29, I'm not complaining.
As there was still sufficient space, I decided to add a second module with a recording of a klaxon horn. This was wired up to Pad C (Channel 5) of the Rx65b so the horn sounds when the bind button is pressed on the transmitter.
The engine sound diminishes when the horn is sounded which I could improve by adding a couple of resistors to the speaker output leads, but this would reduce the sound of the engine which is already quite soft and so it is another compromise with which I can live, given then overall cost of this sound system.
The Rx61b controller receiver
My Ford(ish) railmotor, bashed from two freelance Andel coaches, was constructed in 2012 and converted to Deltang radio control in 2013. This was before the Rx65 had been developed and so I equipped it with the most up-to-date and sophisticated receiver which Deltang produced at the time, the Rx61b. This had eight output pads in addition to the motor control pads.
Prior to my experiments with soundcards and Deltang's subsequent changes to the way output pads were configured by default, none of the pads provided a 0v output in response to transmitter signals. Those relevant to providing triggers for soundcards were P4 - P7.
Item
Setting
Details
P4
On/Off
Direction switch (Ch3)
Item being switched needs current limiting resistor
Switch right for ON (centre/left OFF)
P5
On/Off
Direction switch (Ch3)
Item being switched needs current limiting resistor
Switch left for ON (centre/right OFF)
P6
On/Off
Bind button (Ch5)
Item being switched needs current limiting resistor
ON while button pressed, OFF when released (momentary)
P7
On/Off
Bind button (Ch5)
Item being switched needs current limiting resistor
Toggle ON/OFF each time button is pressed (latching)
These were the settings I used to trigger the events on the MP3 player (see below).
Since 2013, there have been two further versions of the Rx61. The current model (Rx61d), still has eight Pads ......
........ some of which now provide 0v outputs which can be used for triggering soundcard effects directly.
Item
Setting
Details
P3
On/Off
Direction switch (Ch3)
On when channel is Low, Momentary action
P4
On/Off
Direction switch (Ch3)
On when channel is High, Momentary action
P5
On/Off
Bind button (Ch5)
Start off, toggle when channel is Low, Latching action
P6
On/Off
Ch3
Idle high (3.3v), 0v when channel is Low, Momentary action
P7
On/Off
Ch3
Idle high (3.3v), 0v when channel is High, Momentary action
P8
Servo
Ch5
If I was using the Rx61d, I would use Pads P6 and P7 for the sounds and P5 for the lighting (see below) .......
Interfacing the Rx61b with a cheap MP3 player for multiple effects
When I bought my MP3 player on eBay in 2014, it cost just under £5. I see similar ones can now be bought for around £6.50. What is attractive about these players is they include a reasonably powerful amplifier.
The player was dismantled and the sounds were edited in Audacity (a free sound editing program for PC and Mac) and then saved as four separate tracks on a Micro SD card inserted into the MP3 player (for more information see How I used an MP3 player as a soundcard).
The contacts for the buttons which control moving to the next or previous tracks (and volume) on the MP3 player circuit board were connected via transistor inverter switch circuits to Pad 4 and Pad 5 of the Rx61b. The inverter was required to change the 3.3v output from the pads to 0v (see How I constructed a transistor inverter switch). As there was no separate sound trigger needed for the hooter (it was edited into the tracks for the various engine sounds), Pad 7 was used to switch the interior lighting on and off.
If I used the latest version of the receiver (Rx61d), I would wire up the 'Next' and 'Previous' switch contacts to Pad 6 and Pad 7. There is now no need for the transistor inverter switch as these pads provide 0v outputs when energised. The lighting LEDs would now be connected to Pad 7 as this provides a latching 3.3v on/off output energised by Channel 5 (the bind button on the transmitter)
Whilst the MP3 player sound system is not the most elegant and suffers from a one second pause as the player changes tracks, for less the £10 it is quite versatile in the range of sounds it can produce and the sound quality is better than that provide by the greetings card module.
Conclusion
As most Deltang receivers now provide 0v outputs by default, they are ideally suited to triggering sound effects on most soundcards with a minimum of wiring.
You may have noticed that most of the circuits above include 1k resistors in the wiring between the receiver pads and the sound card input triggers. As Deltang receivers have an internal voltage of 3.5v and most sound cards have an internal voltage of 5v, it is possible that excess current could pass back from the sound card to the receiver. The resistor provides some protection from this potential problem.
This is, by no means, a comprehensive guide to interfacing all types of sound card to all types of Deltang receivers. However, the general principles demonstrated here should apply to most receivers and sound cards.
Although I have checked and double checked the information presented here, it is possible that some errors have crept in. Please let me know if you spot any 'deliberate' mistakes and please feel free to contact me if you have any queries which are not covered in this article.