One of the key challenges in this project is to interface all the various cab components to MSTS. I will deal with the hardware aspects first – and move onto the software in a post a bit later on.
The master controller and the brake controller are reasonably straight forward – they both have electrical contacts in all the relevant positions. My intention for these is to utilise a commercial USB 32-port input/output unit I purchased from eBay, which has not arrived yet.
As for the gauges – I unfortunately don’t have a full set of air gauges as these were missing from C7487 and I don’t wish to destroy my Elcar ones. However – a simple solution will be to make my own utilising stepper motors – more on this one to follow.
The amp gauge, line lights etc were much easier – I was able to get a hold of some K-3090 Dick Smith Electronics Serial I/O Kits – going cheap from a large kit clearance through Allbids. These are in fact the Silicon Chip project from November 2005 – they provide 10 inputs, 10 outputs some analog inputs and a couple of relays. Most interestingly – they are driven by a PIC16F877A – quite a powerful processor for such a simple kit. The analog inputs aren’t much use however, the digital outputs are driven from the microcontroller through a ULN2003 in an open collector setup. Installing a pot and adjusting accordingly leads to being able to drive the gauge from 0 to full based on the digital output… not so useful really .. however… we should now be able to drive the amp gauge by utilising the hardware PWM of the 16F877A to vary the average voltage seen by the meter.. (remember there is a variable resistance as well)
I have not yet started on rewriting the PIC code to achieve this – however it shouldn’t take me all that long to get the amp gauge up and running properly. I will post a photo when I do.
The relay outputs will come in very handy for switching on and off the line lights and brake stand control lights.