Creating a live UK train-map

Designing and planning

In all honesty, I’m not much of a planner when it comes to projects like these — I prefer to just go for it, and see what happens.

The base shape of the map (makercase.com)
The final product (left), and the laser cut panels (right)

Electronics

It took me a while to find the right components for the project (which admittedly I did forget about for a few months), but here they are:

  • 19 3mm Red LEDS
  • 19 330Ω resistors
  • 39 jumper wires (19 female to female) (20 female to male)
  • Random breadboard
  • Raspberry Pi 3A
Completed wiring (left) and close-up RPi GPIO wiring (left)

Software

This was easily the most frustrating, complex and time-consuming part of the project. Thankfully, I had this repo to help me, but it was still an absolute nightmare.

  1. Subscribe to the Darwin Push Port which provides a live data feed of basically every single train and station update in the UK
  2. Parse and filter the XML feed items to only get status updates to trains arriving at the stations
  3. Start a timer for each station, which calls a function to illuminate the corresponding LED
  1. Creating a timer for every train arrival and depature is not very performant — each timer creates a thread, and the threads will very quickly add up, until you are out of memory
The end result

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Wyatt Sell

Wyatt Sell

I like programming and using technology to make awesome stuff