Here’s a project I’ve been working on for a while under lockdown. After years of controlling my switches from TMCC or Legacy remotes, I decided to implement a physical control panel.
I had a few design objectives for the project:
- Control 10 switches controlled by DZ-2500s, and 1 controlled by a DZ-1000/DZ-2000.
- Switch position should be toggled by one press of a momentary button.
- Indicate switch status with bicolor LEDs.
- Provide an indication when any yards were open (to guard against trains on the mainline running into the yard)
- Provide one-touch control to open or close all the yard switches.
At least the DZ-2500s might be done with discrete logic, but I had plenty of Arduino parts on hand (and time) so I decided the project would be based on an Arduino Pro Mini. The Arduino reads and controls the switches directly, and controls the LEDs with two MCP23017 expander chips over I2c. Power is supplied by a half-wave rectified supply with a Pololu 5V buck regulator.
I designed a PCB in Diptrace, sent it off to OSH Park, and got back my boards a little over a week later. Here is the assembled board:
The switches with DZ-2500s were easy: the DZ-2500 drives the white wire to 5V when the switch is curved, and to 1.1V when through. So the Arduino reads the switch state directly from the white wire, and pulls the white wire low to toggle the switch position.
The switch with a DZ-1000 was more of a challenge, since it was never designed for single wire control like the DZ-2500. The DZ-2000 controller also has a white wire that is supposed to indicate switch position, but I discovered it only indicate the last commanded position of the switch. If the switch was thrown manually or by the non-derailing connections it would not be correct.
However, experimentation showed that while connected to the DZ-2000, one of the DZ-1000 control wires is low when curved, and has a sine wave ranging from +3V to +18V when through. I’ve no idea why that voltage appears, but I could feed it to an Arduino input and get a high signal. Because the signal is up to 18V, I used a 47k series resistor to keep the current to about 0.25 mA – supposedly within the safe zone for the input pin’s clamping diodes.
To control the DZ-1000, I used triacs connected to each control wire. The Arduino reads the current state of the switch and fires the appropriate triac to toggle the switch.
I built an enclosure from some plywood and Masonite, and painted it with Rustoleum silver hammered spray:
Toggles and LEDs installed. The wiring is unusually neat for me:
Neatness didn’t last. After much stringing of wires under the layout and cursing of terminal blocks:
And the panel installed and running!
The “YARDS” LED is green when the yards are closed, and blinking when any yard is open. Pressing the associated toggle closes any yard switches that are open, or, if all the yards are closed off, opens them all.
Maybe over-engineered to implement basic switch functionality, but it was a fun project, and will make running trains (especially under DCS) a lot smoother than when switching was only with the remote.