Tuesday 2 February 2016

Arduino shuttle control - part one

So with the restoration work finished for the moment, I've been playing with the Arduino and learning how to program it, seeing what it can control etc.

My first program was a basic version of the current shuttle system, ie one train up and back, change points, second train up and back, change points, and so on.

Having spent more time researching and programming, I realised that I could also use this device to regulate the train speed, creating a more realistic start and, with extra sensors, I can program it to slow down the train when it reaches a certain point of the shuttle. As the shuttle is wired across all three front boards, all I would need in theory is a sensor at each end - when the train enters each of these sections I could make it slow to a stop, still using the diodes to ensure that the loco comes to a complete standstill in the same place.

As I await the arrival of some current sensors, I continue to program and tweak. Each of the LEDs attached, rather badly, to the unit represents part of the program, ie direction, speed, points & signals.


Before long, I'd transfered this into a bespoke PCB...


So now we're down to just two PCBs. Trouble is, the connecting pins could become loose in operation so I would like a better solution.

Thankfully the Arduino is also available as a Nano:


So I got to work building another PCB, incorporating both sets of points on the first board (only one set is controlled for the shuttle) and soldered the Nano to the board. All went well until it came to testing, where I may have accidentally sent too much power into the Nano unit and blew it up. Thankfully I can cope with the cost (about £3.50) but in the process of de-soldering it, I ended up wrecking the pcb, so the components were harvested and soldered into another board.

This time I've thoroughly tested everything prior to fitting the Nano. As there is still a risk of damaging the unit I'll add some resistors and diodes just to be sure. I'll also be fitting a socket to the board so that the Nano can just plug into it, should it ever fail in future, swapping will be easier.

Just need to add the signal terminals, which I'll do once the socket pins arrive...


No comments:

Post a Comment