Technical Overview
The key thought that went into the basic technical design was that we wanted to write our own computer control. This meant interfacing the computer to devices that could control hardware. Arduinos are great for this as they can communicate with a simple serial interface to the computer and they have wide potential for connecting to hardware.
We were new to this sort of modelling so it is fair to say that we did not really plan fully what we were going to do. So things grew in an ad-hoc fashion. The first big insight came at an early show where we met a group demonstrating DCC Ex. DCC is a standard way of enabling communication with the trains and other peripherals. There are many manufacturers making controllers that work with DCC. But DCC Ex is a standard set by a small group of developers which uses an Arduino with a power booster. This sends DCC commands to the track when correct text is sent to the Arduino. This is exactly what we wanted so we could write our own computer program, with an interface that suits us. It meant that we could use text to control both the engines, points and subsequently sounds, lighting and routes the trains could take.
We were designing the layout as a stylised slate village with adjacent slate workings. We wanted the Slate works to have an incline transporting slate from the upper workings. This should give the impression of the truck going up the incline empty and coming down full. The way this was achieved is described elsewhere but uses another Arduino to control the movement of the truck and the sounds at the top and bottom of the mine.
Arduinos can be multipurpose but we felt that a modular design with Arduinos for different functions was something that made the development easier, and Arduinos are relatively cheap.
Since the State mine was active, we wanted to have other points of interest around the village and we began to think of the village as an occasional tourist centre with particular displays over a weekend. This gave us the opportunity to have station announcements, sounds from the chapel and a variety of routes that the trains could follow.
To be able to pre-program tours and routes we needed to know where the trains are as they move around. There are a variety of sensors available commercially to do this, but some experiments showed that we could do this successfully with Hall probes. These are tiny devices that would fit between the sleepers and are sensitive to a magnetic field. They are sensitive enough that, with some supporting electronics, they could detect a tiny magnet fastened on the underside of the trains. We have 14 of these around the track and these connect to homemade electronic boards that convert the signals to something that the third Arduino in the system can read.
For the announcements at each of the stations we needed control for the speakers at these locations. This was done with our fourth Arduino using the tiny DFRobot MP3 players that take mini sd cards. The player is not much larger than the SD card. This of course allowed us to expand our ideas more. The plan now was to make this a tourist event with a special series of activities and tours for visitors. So of course we wanted the chapel to be able to host a concert given by the Treorchy Male Voice Choir.
Next we wanted the village to show up at night so there needed to be lighting added. There are currently 12 independent lighting circuits for different parts of the village. The fifth Arduino controls these. In addition, since there is spare capacity, this device also controls the level crossing.
Finally we recently realised that we wanted sounds in the slate workshops. So we have a sixth Arduino for this with two DFRobot MP3 players. There is spare capacity here for any extra functions that occur later.
This all would seem to imply that there is a considerable complexity in the interface to control this. But since all the commands from the PC are in the form of text all of the complexity is easily hidden. You can see below the current state of the user interface that allows control of the four trains and all the peripheral devices by clicking here.