CHUFFING and Whistle
- FlyingScot
- New User

- Posts: 1
- Joined: Wed Jan 28, 2026 10:06 am
- Location: Motherwell Sunny Scotland
CHUFFING and Whistle
Looking to build an electronic Steam Loco Chuffer and also whistle for G scale Locos DC and Live Steam. And I am somewhat underwhelmed by Live Steam Whistles and Cuffers. Having actually had my hands on the regulator of a Black Five, Patriot and Jubilee class locos to name but a few, I want to hear the loco working hard.
The whistle I want to be R/C controlled OR with a track mounted sensors {magnet}
The Chuffer I want to be LOUD and motion activated, tied to the actual piston motion and the revolutions of the Loco's wheels {though as I think this will need to be tender mounted it may be the rotation of the tender wheels that I might have to measure}
I was thinking of using a miniature MP3 player and having the chuffing sound {single Chuff or Two Chuffs} on an Micro SD card and having the trigger being a axel mounted disc with holes for an opto sensor as the trigger. One issue I can see is if the loco was stopped and obviously the wheel is stationary BUT with the trigger activated. So I may need some means of motion sensing as well.
Any thoughts advice or maybe even someone has done this before so look here feedback ???
thanks
The whistle I want to be R/C controlled OR with a track mounted sensors {magnet}
The Chuffer I want to be LOUD and motion activated, tied to the actual piston motion and the revolutions of the Loco's wheels {though as I think this will need to be tender mounted it may be the rotation of the tender wheels that I might have to measure}
I was thinking of using a miniature MP3 player and having the chuffing sound {single Chuff or Two Chuffs} on an Micro SD card and having the trigger being a axel mounted disc with holes for an opto sensor as the trigger. One issue I can see is if the loco was stopped and obviously the wheel is stationary BUT with the trigger activated. So I may need some means of motion sensing as well.
Any thoughts advice or maybe even someone has done this before so look here feedback ???
thanks
- Durley
- Trainee Fireman

- Posts: 181
- Joined: Sun Apr 14, 2024 8:36 pm
Re: CHUFFING and Whistle
Hi
Mylocosound does a dedicated whistle sound card, https://www.mylocosound.com/whistles.htm and these are loud. I believe it is just an RC triggered MP3 player so you can use their downloadable whistle sounds or any other MP3 files. The BBC sound recording archive is a good source for other whistle sounds https://sound-effects.bbcrewind.co.uk/s ... %20whistle
For electronic chuffs, the best sounding solution I suggest is to use a DCC sound chip with an appropriate sound project. Fosworks sells RC kits that will run an auxiliary DCC chip to give synchronised sounds, with the loco powered from a battery and separate speed controller. https://fosworks.co.uk/r%2Fc-kits
The MP3 route is ok and I have done this with a few diesel locos, but it won’t easily give the seamless sounds that a properly developed DCC sound chip can produce. For example getting the loco to sound like it is coasting versus regulator fully open. It would need some sort of logic controller to control what MP3 file plays under what operating condition. You also have the problem of potential pauses between MP3 tracks.
Mylocosound does a dedicated whistle sound card, https://www.mylocosound.com/whistles.htm and these are loud. I believe it is just an RC triggered MP3 player so you can use their downloadable whistle sounds or any other MP3 files. The BBC sound recording archive is a good source for other whistle sounds https://sound-effects.bbcrewind.co.uk/s ... %20whistle
For electronic chuffs, the best sounding solution I suggest is to use a DCC sound chip with an appropriate sound project. Fosworks sells RC kits that will run an auxiliary DCC chip to give synchronised sounds, with the loco powered from a battery and separate speed controller. https://fosworks.co.uk/r%2Fc-kits
The MP3 route is ok and I have done this with a few diesel locos, but it won’t easily give the seamless sounds that a properly developed DCC sound chip can produce. For example getting the loco to sound like it is coasting versus regulator fully open. It would need some sort of logic controller to control what MP3 file plays under what operating condition. You also have the problem of potential pauses between MP3 tracks.
-
Phil.P
- Trainee Driver

- Posts: 717
- Joined: Thu Jan 31, 2019 3:28 pm
- Location: Staffs. UK
Re: CHUFFING and Whistle
Whistles are easy..
We do a variation on the MLS whistle card, which also allows you to alter the volume from the RC handset.
Using an MP3 player, it is almost impossible to get the 'chuffs' right. - Even if you go down to two beats per revolution. They will just not respond fast enough.
A MyLocoSound card, will also give you standing sounds when stationary, options for coal shovelling, water pump, Westinghouse pump, guard.
Unless the tender wheels are the same diameter as the drivers, then the chuff synchronisation will not be 'right'.
Though personally, as our wheels are so small, I think two chuff per revolution sounds 'better' than four, as you get better separation between chuffs.
Once you are a few feet away from the model, I defy you to be able to see two chuffs is 'wrong'.
Phil.P
We do a variation on the MLS whistle card, which also allows you to alter the volume from the RC handset.
Using an MP3 player, it is almost impossible to get the 'chuffs' right. - Even if you go down to two beats per revolution. They will just not respond fast enough.
A MyLocoSound card, will also give you standing sounds when stationary, options for coal shovelling, water pump, Westinghouse pump, guard.
Unless the tender wheels are the same diameter as the drivers, then the chuff synchronisation will not be 'right'.
Though personally, as our wheels are so small, I think two chuff per revolution sounds 'better' than four, as you get better separation between chuffs.
Once you are a few feet away from the model, I defy you to be able to see two chuffs is 'wrong'.
Phil.P
- Petersfield
- Trainee Fireman

- Posts: 151
- Joined: Sun Nov 12, 2023 7:40 pm
Re: CHUFFING and Whistle
Hello - I am going through something similar at the moment. (A manual battery powered steam outline loco, conversion to RC with sound). I too have spent some time on the footplate, though nothing as big or glamorous as your 460s and consequently am a bit more aware (and fussyFlyingScot wrote: ↑Wed Jan 28, 2026 10:53 am Looking to build an electronic Steam Loco Chuffer and also whistle for G scale Locos DC and Live Steam. And I am somewhat underwhelmed by Live Steam Whistles and Cuffers. Having actually had my hands on the regulator of a Black Five, Patriot and Jubilee class locos to name but a few, I want to hear the loco working hard.
The whistle I want to be R/C controlled OR with a track mounted sensors {magnet}
The Chuffer I want to be LOUD and motion activated, tied to the actual piston motion and the revolutions of the Loco's wheels ....
Any thoughts advice or maybe even someone has done this before so look here feedback ???
thanks
Any concerns/technical queries, if one of our members doesn't answer them here, maybe you could drop MLS a message via their contact us page?
I'm not far enough ahead of you to be able to give an authoritative answer but depending on your timescale, may be able to give sensible feedback in a few weeks/months.
- Petersfield
- Trainee Fireman

- Posts: 151
- Joined: Sun Nov 12, 2023 7:40 pm
Re: CHUFFING and Whistle
PS - this is the relevant bit of the reply I received from MyLocoSound, the first part of this sounds like it may meet your wishes.
There are two ways of controlling the chuff with our soundcard; by voltage
and by wheel rotation.
The wheel rotation method involves fitting a chuff timer. The usual method
is to glue four magnets (or three for a three cylinder loco) around one of
the axles and then to position a reed switch close by so that the switch
closes four times per wheel revolution. In that way you get an accurate
chuff when the loco starts moving and then when in motion, including wheel
slip. Some US locos, such as the Bachmann Lyn, come with a chuff timer
fitted as standard.
The other method requires no installation work. It automatically reads the
back emf at the motor and then sounds the chuff according to the voltage
read. Using a TV remote control you can set the voltage at which the loco
starts moving and then the rate at which the chuff increases as the voltage
goes up. There is a good customer video at
which shows how to do it.
The voltage method is simpler to set up but becomes inaccurate if your locos
are running at slow speeds up and down gradients.
- ge_rik
- Administrator

- Posts: 7788
- Joined: Sun Oct 25, 2009 10:20 pm
- Location: Cheshire
- Contact:
Re: CHUFFING and Whistle
..... and what a darned good customer video it is .......
Rik
Rik
- Petersfield
- Trainee Fireman

- Posts: 151
- Joined: Sun Nov 12, 2023 7:40 pm
Re: CHUFFING and Whistle
I thought that voice was familiar!
Yes, I may be wearing the tape out a bit later. Thanks for making that film Rik. I did have a Sony TV myself before I moved, not sure whether I still have the remote for it. (The TV stuff has been in boxes since the move, too many good books to read, just haven't got round to unpacking the TV/video yet). Maybe I'd better investigate which of my neighbours has a Sony TV remote I can borrow!
-
Phil.P
- Trainee Driver

- Posts: 717
- Joined: Thu Jan 31, 2019 3:28 pm
- Location: Staffs. UK
Re: CHUFFING and Whistle
If you were to purchase a MLS, et Al...
From somewhere around here, I am sure something could be worked out regarding a suitable TV remote?
Phil.P
From somewhere around here, I am sure something could be worked out regarding a suitable TV remote?
Phil.P
- Petersfield
- Trainee Fireman

- Posts: 151
- Joined: Sun Nov 12, 2023 7:40 pm
-
jasa
- Cleaner

- Posts: 14
- Joined: Fri Dec 08, 2023 6:22 am
Re: CHUFFING and Whistle
Good morning.
I have been working on a similar solution for some time.
My approach is based on using a microcontroller, MCU, which, in addition to sound, controls the other functions of the locomotive.
The MCU model is an ESP32 with a DAC output.
To 'produce' the sound, I use the XT_DAC_AUDIO library (xtronical.com).
An amplifier needs to be added (I use a PAM8403).
I use WAV as the sound file format, generated with Audacity and HxD tools. This MCU has enough space to store such files in memory.
At the moment, I have sounds for chuff, whistle, bell, brake, and stop puff.
To simulate the chuff and have it approximately synchronized with the wheel rotation, I am experimenting with a model that:
- Uses the motor's maximum rpm.
- Assumes linearity between voltage (PWM) and motor speed.
With these axioms, the interval between chuffs is calculated for each speed value (8-bit PWM resolution) and timer interrupts to control sound output.
I like locomotives with smoke. I use an ultrasonic humidifier to simulate the smoke. This device synchronizes with the chuffs.
I try to produce four chuffs per wheel rotation—which seems appropriate for two-piston locomotives, something I believe I understood from posts on this forum.
Perhaps deviations from the model (possible non-linearity in the motor’s response to voltage levels, or speed reduction in a real environment: slopes, load...) are manageable.
Otherwise, it’s always possible to base the system on precise wheel rotation detection.
Regards.
I have been working on a similar solution for some time.
My approach is based on using a microcontroller, MCU, which, in addition to sound, controls the other functions of the locomotive.
The MCU model is an ESP32 with a DAC output.
To 'produce' the sound, I use the XT_DAC_AUDIO library (xtronical.com).
An amplifier needs to be added (I use a PAM8403).
I use WAV as the sound file format, generated with Audacity and HxD tools. This MCU has enough space to store such files in memory.
At the moment, I have sounds for chuff, whistle, bell, brake, and stop puff.
To simulate the chuff and have it approximately synchronized with the wheel rotation, I am experimenting with a model that:
- Uses the motor's maximum rpm.
- Assumes linearity between voltage (PWM) and motor speed.
With these axioms, the interval between chuffs is calculated for each speed value (8-bit PWM resolution) and timer interrupts to control sound output.
I like locomotives with smoke. I use an ultrasonic humidifier to simulate the smoke. This device synchronizes with the chuffs.
I try to produce four chuffs per wheel rotation—which seems appropriate for two-piston locomotives, something I believe I understood from posts on this forum.
Perhaps deviations from the model (possible non-linearity in the motor’s response to voltage levels, or speed reduction in a real environment: slopes, load...) are manageable.
Otherwise, it’s always possible to base the system on precise wheel rotation detection.
Regards.
- ge_rik
- Administrator

- Posts: 7788
- Joined: Sun Oct 25, 2009 10:20 pm
- Location: Cheshire
- Contact:
Re: CHUFFING and Whistle
That sounds fascinating. I've been considering making my own steam chuff sound system for some time, using Arduino. I got ChatGPT to produce this code but haven't got around to playing with it yet. Would be interested in your experiments so far.jasa wrote: ↑Sat Feb 07, 2026 7:04 am Good morning.
I have been working on a similar solution for some time.
My approach is based on using a microcontroller, MCU, which, in addition to sound, controls the other functions of the locomotive.
The MCU model is an ESP32 with a DAC output.
To 'produce' the sound, I use the XT_DAC_AUDIO library (xtronical.com).
An amplifier needs to be added (I use a PAM8403).
I use WAV as the sound file format, generated with Audacity and HxD tools. This MCU has enough space to store such files in memory.
At the moment, I have sounds for chuff, whistle, bell, brake, and stop puff.
To simulate the chuff and have it approximately synchronized with the wheel rotation, I am experimenting with a model that:
- Uses the motor's maximum rpm.
- Assumes linearity between voltage (PWM) and motor speed.
With these axioms, the interval between chuffs is calculated for each speed value (8-bit PWM resolution) and timer interrupts to control sound output.
I like locomotives with smoke. I use an ultrasonic humidifier to simulate the smoke. This device synchronizes with the chuffs.
I try to produce four chuffs per wheel rotation—which seems appropriate for two-piston locomotives, something I believe I understood from posts on this forum.
Perhaps deviations from the model (possible non-linearity in the motor’s response to voltage levels, or speed reduction in a real environment: slopes, load...) are manageable.
Otherwise, it’s always possible to base the system on precise wheel rotation detection.
Regards.
Code: Select all
// Steam Locomotive Chuff Generator
// 4 beats per cycle, speed controlled by analog voltage
const int throttlePin = A0; // Voltage input
const int speakerPin = 9; // Speaker or amplifier input
// Chuff sound parameters
const int chuffFrequency = 180; // Hz (low = steam-like)
const int chuffDuration = 35; // ms length of each chuff
const int chuffPause = 25; // ms silence between chuffs
// Speed control limits (adjust to taste)
const int minCycleTime = 1200; // ms (slow chuffing)
const int maxCycleTime = 250; // ms (fast chuffing)
void setup() {
pinMode(speakerPin, OUTPUT);
}
void loop() {
// Read throttle voltage
int throttle = analogRead(throttlePin); // 0–1023
// Map voltage to total cycle time (4 chuffs per cycle)
int cycleTime = map(throttle, 0, 1023, minCycleTime, maxCycleTime);
// Time between chuffs
int beatInterval = cycleTime / 4;
// Generate 4 chuffs
for (int i = 0; i < 4; i++) {
tone(speakerPin, chuffFrequency);
delay(chuffDuration);
noTone(speakerPin);
delay(beatInterval - chuffDuration);
}
}
-
jasa
- Cleaner

- Posts: 14
- Joined: Fri Dec 08, 2023 6:22 am
Re: CHUFFING and Whistle
Good morning.ge_rik wrote: ↑Sat Feb 07, 2026 8:36 amThat sounds fascinating. I've been considering making my own steam chuff sound system for some time, using Arduino. I got ChatGPT to produce this code but haven't got around to playing with it yet. Would be interested in your experiments so far.jasa wrote: ↑Sat Feb 07, 2026 7:04 am Good morning.
I have been working on a similar solution for some time.
My approach is based on using a microcontroller, MCU, which, in addition to sound, controls the other functions of the locomotive.
The MCU model is an ESP32 with a DAC output.
To 'produce' the sound, I use the XT_DAC_AUDIO library (xtronical.com).
An amplifier needs to be added (I use a PAM8403).
I use WAV as the sound file format, generated with Audacity and HxD tools. This MCU has enough space to store such files in memory.
At the moment, I have sounds for chuff, whistle, bell, brake, and stop puff.
To simulate the chuff and have it approximately synchronized with the wheel rotation, I am experimenting with a model that:
- Uses the motor's maximum rpm.
- Assumes linearity between voltage (PWM) and motor speed.
With these axioms, the interval between chuffs is calculated for each speed value (8-bit PWM resolution) and timer interrupts to control sound output.
I like locomotives with smoke. I use an ultrasonic humidifier to simulate the smoke. This device synchronizes with the chuffs.
I try to produce four chuffs per wheel rotation—which seems appropriate for two-piston locomotives, something I believe I understood from posts on this forum.
Perhaps deviations from the model (possible non-linearity in the motor’s response to voltage levels, or speed reduction in a real environment: slopes, load...) are manageable.
Otherwise, it’s always possible to base the system on precise wheel rotation detection.
Regards.
RikCode: Select all
// Steam Locomotive Chuff Generator // 4 beats per cycle, speed controlled by analog voltage const int throttlePin = A0; // Voltage input const int speakerPin = 9; // Speaker or amplifier input // Chuff sound parameters const int chuffFrequency = 180; // Hz (low = steam-like) const int chuffDuration = 35; // ms length of each chuff const int chuffPause = 25; // ms silence between chuffs // Speed control limits (adjust to taste) const int minCycleTime = 1200; // ms (slow chuffing) const int maxCycleTime = 250; // ms (fast chuffing) void setup() { pinMode(speakerPin, OUTPUT); } void loop() { // Read throttle voltage int throttle = analogRead(throttlePin); // 0–1023 // Map voltage to total cycle time (4 chuffs per cycle) int cycleTime = map(throttle, 0, 1023, minCycleTime, maxCycleTime); // Time between chuffs int beatInterval = cycleTime / 4; // Generate 4 chuffs for (int i = 0; i < 4; i++) { tone(speakerPin, chuffFrequency); delay(chuffDuration); noTone(speakerPin); delay(beatInterval - chuffDuration); } }
Next I transcript example code. I use Platformio for programming in Visual Studio Code.
Hardware need:
ESP32 with DAC pin in 25 (I changed the pinDac statement in another case).
PAM8403 amplifier.
resistor 10K
resistor 1k.
Conexions:
pinDac->10Kresistor->1kresistor->gnd
|
pin L amplifier
MCU 5V -> amplifier 5V
MCU gnd -> amplifier gnd
amplifier leff+ -> speeker +
ampifier left- -> speeker -
This use a voltage divider for protect the amplifier.
The first file, platformio.ini:
Code: Select all
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps = https://github.com/WeekendWarrior1/XTronical_XT_DAC_Audio_Mirror/archive/master.zip
monitor_speed = 115200
upload_port=com3
Code: Select all
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp32/rom/ets_sys.h"
#include "xt_DAC_Audio.h"
// sound (HxD tool copy as C. Change array's name by chuff and prefix by const.
#include "chuff.h";
// counter sound's' interrupts
volatile int soundCounter = 0;
// pin with DAC capacity
int pinDac = 25;
// last pwm
int lastPwm = 0;
// engine speed
int RPM = 60;
// timer object
hw_timer_t * timer = NULL;
// Dac_audio object
XT_Dac_Audio_Class DacAudio = XT_DAC_Audio_Class(pinDac, 0);
// wave object
XT_Wave_Class Chuff = XT_Wave_Class(chuff)
// Semaphore for mutual exclusion
portMUX_TYPE timerMux = portMUX_INITIALIZER_UNLOCKED;
// the timer is set for count microseconds. This explain the 1000000 factor.
// The factor 60 because RPM is in minutes.
// 255 for PWM resolution: 8 bits
// 4 piston strokes
// For calculate interval between chuffs: interval = K / pwm seconds. (See getInterval function).
float K = (60.0 * 255.0 * 1000000.0) / (RPM * 4);
// Interrupt routine
void IRAM_ATTR onTimer(){
portENTER_CRITICAL_ISR(&timerMux);
soundCounter++;
portEXIT_CRITICAL_ISR(&timerMux);
}
float getInterval(int pwm){
// force range
pwm = pwm < 0 ? 0 : pwm > 255 ? 255 : pwm;
if (pwm != lastPwm){
lastPwm = pwm;
}
if (lastPwm > 0)
return K / lastPwm;
else
return 0;
}
void setTimer(float interval){
portENTER_CRITICAL_ISR(&mux);
timerAlarmDisable(timerHere);
if (interval > 0){
timerAlarmWrite(timerHere, (int) interval, true);
timerAlarmEnable(timerHere);
}
portEXIT_CRITICAL_ISR(&mux);
}
void setup(){
Serial.begin(115200);
// timer and interrupt
timer = timerBegin(3, 80, true); // timer count microsecond.
timerAttachInterrupt(timer, &onTimer, true);
}
void makeSound(){
DacAudio.FillBuffer();
DacAudio.Play(Chuff);
}
void loop(){
if (soundCounter > 0){
makeSound();
portENTER_CRITICAL_ISR(&timerMux);
soundCounter--;
portEXIT_CRITICAL_ISR(&timerMux);
}
if (Serial.available()) {
setTimer(getInterval(Serial.readInt()));
}
}
How it works.
In setup, we enable Serial and the timer.
Initially the timer is off.
when I write a value for pwm in the serial monitor other than 0, the timer is enabled, and at each interval, soundCounter is incremented by one.
If soundCounter is greather than 0, the chuff is played.
The chuff remain playing while pwm is not zeroed
This code can be adapted to use other sound production models, for example:
Code: Select all
void makeSound(){
tone(speakerPin, chuffFrequency);
delay(chuffDuration);
noTone(speakerPin);
}
Regards.
-
jasa
- Cleaner

- Posts: 14
- Joined: Fri Dec 08, 2023 6:22 am
Re: CHUFFING and Whistle
Sorry.
Interval is calculated in microseconds.
Interval is calculated in microseconds.
- ge_rik
- Administrator

- Posts: 7788
- Joined: Sun Oct 25, 2009 10:20 pm
- Location: Cheshire
- Contact:
Re: CHUFFING and Whistle
That's great. Thanks for sharing.
Looks like I've now got another project on the Todo list.
Rik
Looks like I've now got another project on the Todo list.
Rik
Who is online
Users browsing this forum: No registered users and 0 guests