Servo control of MTH Z-controller transformer voltage, horn, bell
Joined: May 18, 2008
Topics: 17 Replies: 16
posted on Feb 5, 2018 07:22 PM:
My Archive Category
This rainy-afternoon project was more for amusement than something practical I'd expect anyone else to try. But this might spawn other ways to apply low-cost Arduino and similar DIY microcontrollers and remarkably inexpensive (99 cents) servo mechanisms which easily attach to Arduino modules.|
For conventional O-gauge operation, I am not aware of any inexpensive method to smoothly vary AC track voltage under remote control. Typical applications might be to automatically decelerate or accelerate a train approaching or departing a station. Or to automatically adjust track voltage to regulate speed as a train ascends or descends a grade.
I say "smoothly" vary because there are several write-ups on using the string of back-to-back diode method to provide discrete voltage steps...some even using relays under Arduino control to sequence a stair-step of voltages selected from a diode string. The diode string method is simple and inexpensive but is also inefficient from a power standpoint. The standard method for varying AC voltage in most low-end O-gauge controllers (Lionel CW-80, MNH Z-controller) is the semiconductor triac. But it takes specialized knowledge to control triacs from an Arduino.
On the other hand, making a servo motor turn from one angle to another is as simple as a single command using the standard Arduino servo library. So why not just use a servo motor to turn the knob of a Z-controller. Note that in the video a $1 servo-exerciser is used to generate the magic pulse-modulated commands that the 3-wire servo requires.
The Arduino can emulate a DIRECTION change by momentarily commanding zero track voltage.
And since even the entry-level Arduino comes with 2 servo outputs, the obvious next step would be to use a 2nd servo to control whistle/horn and bell. The trick is the buttons on a Z-controller are spaced such that a single servo can activate both!
Multi-button sequences of Horn and Bell can trigger special functions in some O-gauge engines as demonstrated at the end of the video. For example, a controller that is sensing where a train is on a layout can know to activate a short-short-long warning when approaching a grade crossing.