Fitting a mini MP3 sound system in a loco
Posted: Fri Jun 14, 2019 6:41 am
I have finally got around to fitting a miniMP3 player in my small #18 diesel. I had lots of problems that I finally tracked down to bad batteries.
It turned into a major exercise, having to replace the batteries, and then fit better speakers.
And it’s not particularly successful.
Loco 18 was given me by a friend of a friend and seems to be an LGB steam cab with a diesel hood added. Everything about it is so ‘unusual’, that I christened it ‘Ugly’.
When I received it, 8 years ago, I fitted six, NiMH batteries in every nook and cranny, incl 3 in the cab, 2.4GHz RC and one of my picaxe sound generating systems in the hood. The speaker was a tiny 1” Mylar type in the cab ceiling – the only place I could think of. It had an open doorway at the rear of the otherwise enclosed cab.
The sound was always ‘hopeless’ and since I am hoping to use it as the main loco in my still-dreamed-of indoor line, It was a natural for experimenting with the miniMP3 player and recorded sounds.
See the details of the mp3 player here https://gardenrails.org/forum/viewtopi ... 37&t=12308
So the old picaxe sound circuit was removed. I made a new board with the mp3 and another picaxe to control the mp3. The picaxe measures the motor voltage (speed) and plays five, different sound tracks, depending on motor voltage. It also controls the volume depending on whether the loco is accelerating or slowing. The playing of the sound tracks and volume are controlled by serial commands from the picaxe to the mp3, via a single wire. The mp3 includes quite a good amplifier.
There is an ‘engine starting’ track that only plays at power on. Then an ‘idling’ track, a ‘low speed’ track, a ‘medium speed’, and ‘top speed’ track.
I hoped that just three different sound tracks of engine speed (RPM) would be sufficient to sound ‘good enough’ and that the ‘jumps’ between the tracks would not be too noticeable. The tracks are all only about 5 seconds long WAV types and just ‘loop’ again and again, with no sound gap between tracks. There is a very short gap when changing between tracks.
My first installation just wouldn’t work, but I finally tracked it down to bad batteries which allowed low voltage dips to reset the mp3. So I decided on my first use of 18650 Li-Ion batteries. (I’ve used plenty of LiPo.) Two of them (2500mAh) replaced the six, 8 year old, NiMh 2300mAh cells. They are a bit larger than the AA cells so I had to hack the body about a bit. But least I could remove the three cells from the cab. (I learned that the 18 in 18650 refers to the dia and the 65 refers to the length.)
It still didn’t work.
After more experimenting, I found that the mp3 must have ‘enough time’ to start up before the picaxe starts sending commands. So a simple 1 second delay and finally the mp3/picaxe worked, but the sound was still ‘hopeless’ with the tiny speaker. Initially I had mounted a small oval (“laptop”) speaker in the cab ceiling. But the volume was not great and mounting a speaker directly against the ceiling causes the bass to be lost. How to improve the sound?
I had a couple of these small oval shaped speakers spare, 40mm x 20mm.
Two of them just fitted side-by-side in the doorway, and putting a wooden slatted gate in front didn’t seem to affect the volume. The cab provided a nice ‘enclosure’.The 8 ohm speakers are connected in parallel and provide much better volume.
Just for interest, this what the installation looks like from under the body. The batteries extend down into ‘battery cupboards ?’ under the running board.
Total cost about 25AUD or say 13GBP for the player, TF card, picaxe, 5V regulator and speakers.
So where did I get the sound tracks?
I searched for diesel loco or truck sound files on the web, making sure there was no mention of copyright. A friend supplied some more sounds from his own videos.
I then used the free program, Audacity, to mix various sounds together and to change the ‘speed’ of the files.
Would I do it again? Probably not in a loco. It’s a lot of work finding and producing the sound files and then writing the picaxe program. I’m still not happy with the higher speed diesel sounds – they are just a ‘roar’. The mp3 is probably better for playing lots of different sounds such as at a station.
More than likely, the original picaxe diesel sound generator would probably have been good enough if I had just upgraded the speaker.
Here’s the link to a video so you can hear it. At the end of the video, I show a similar small diesel with one of my picaxe sound generating systems, for comparison.
It turned into a major exercise, having to replace the batteries, and then fit better speakers.
And it’s not particularly successful.
Loco 18 was given me by a friend of a friend and seems to be an LGB steam cab with a diesel hood added. Everything about it is so ‘unusual’, that I christened it ‘Ugly’.
When I received it, 8 years ago, I fitted six, NiMH batteries in every nook and cranny, incl 3 in the cab, 2.4GHz RC and one of my picaxe sound generating systems in the hood. The speaker was a tiny 1” Mylar type in the cab ceiling – the only place I could think of. It had an open doorway at the rear of the otherwise enclosed cab.
The sound was always ‘hopeless’ and since I am hoping to use it as the main loco in my still-dreamed-of indoor line, It was a natural for experimenting with the miniMP3 player and recorded sounds.
See the details of the mp3 player here https://gardenrails.org/forum/viewtopi ... 37&t=12308
So the old picaxe sound circuit was removed. I made a new board with the mp3 and another picaxe to control the mp3. The picaxe measures the motor voltage (speed) and plays five, different sound tracks, depending on motor voltage. It also controls the volume depending on whether the loco is accelerating or slowing. The playing of the sound tracks and volume are controlled by serial commands from the picaxe to the mp3, via a single wire. The mp3 includes quite a good amplifier.
There is an ‘engine starting’ track that only plays at power on. Then an ‘idling’ track, a ‘low speed’ track, a ‘medium speed’, and ‘top speed’ track.
I hoped that just three different sound tracks of engine speed (RPM) would be sufficient to sound ‘good enough’ and that the ‘jumps’ between the tracks would not be too noticeable. The tracks are all only about 5 seconds long WAV types and just ‘loop’ again and again, with no sound gap between tracks. There is a very short gap when changing between tracks.
My first installation just wouldn’t work, but I finally tracked it down to bad batteries which allowed low voltage dips to reset the mp3. So I decided on my first use of 18650 Li-Ion batteries. (I’ve used plenty of LiPo.) Two of them (2500mAh) replaced the six, 8 year old, NiMh 2300mAh cells. They are a bit larger than the AA cells so I had to hack the body about a bit. But least I could remove the three cells from the cab. (I learned that the 18 in 18650 refers to the dia and the 65 refers to the length.)
It still didn’t work.
After more experimenting, I found that the mp3 must have ‘enough time’ to start up before the picaxe starts sending commands. So a simple 1 second delay and finally the mp3/picaxe worked, but the sound was still ‘hopeless’ with the tiny speaker. Initially I had mounted a small oval (“laptop”) speaker in the cab ceiling. But the volume was not great and mounting a speaker directly against the ceiling causes the bass to be lost. How to improve the sound?
I had a couple of these small oval shaped speakers spare, 40mm x 20mm.
Two of them just fitted side-by-side in the doorway, and putting a wooden slatted gate in front didn’t seem to affect the volume. The cab provided a nice ‘enclosure’.The 8 ohm speakers are connected in parallel and provide much better volume.
Just for interest, this what the installation looks like from under the body. The batteries extend down into ‘battery cupboards ?’ under the running board.
Total cost about 25AUD or say 13GBP for the player, TF card, picaxe, 5V regulator and speakers.
So where did I get the sound tracks?
I searched for diesel loco or truck sound files on the web, making sure there was no mention of copyright. A friend supplied some more sounds from his own videos.
I then used the free program, Audacity, to mix various sounds together and to change the ‘speed’ of the files.
Would I do it again? Probably not in a loco. It’s a lot of work finding and producing the sound files and then writing the picaxe program. I’m still not happy with the higher speed diesel sounds – they are just a ‘roar’. The mp3 is probably better for playing lots of different sounds such as at a station.
More than likely, the original picaxe diesel sound generator would probably have been good enough if I had just upgraded the speaker.
Here’s the link to a video so you can hear it. At the end of the video, I show a similar small diesel with one of my picaxe sound generating systems, for comparison.