When I started to build the model railway my plan was to build a custom control panel to control the railway electronics. While I was fine designing the control panel the physical build put me off somewhat. Having avoided the issue for a few months, it occurred to me that I could use a Raspberry pi to provide a virtual control panel and avoid all the pain of wiring. After a bit of experimenting with the Python Pygame library I got the basic graphics working. The main ‘picture’ is exported from ‘AnyRail’ (which I used to design the layout originally), with some additional edits in Visio. I have tried to keep it simple just using Pygame to detect mouse clicks on the points and change their position accordingly. Next will be to add control of the track power and signals – together with cleaning up the code a little !
The Picture here shows the RPi and board electronics. Yes I know the heat-sink for the 5v supply is a bit of overkill but I had it in stock and given this is the back of layout it will not be seen in practice.