Wednesday, June 1, 2022

London Underground Map Dashboard

Background

I work on large projects to re-signal parts of the tube.  Our system automates most of the operation, including automated routing and driving of the trains.  Each project re-signals another portion of the tube; either a single line or multiple related lines.  We need to keep a close eye on the systems for failures so we can assist and/or analyse the root cause. I needed something to assist in watching for failures.

During the workday, I am constantly referring to the tube map and am often checking on the status of the lines to keep an eye out for any problems.  This can be done online, but that is a polling approach i.e. I check on the state once in a while.  I wanted a large visible dashboard to clearly show the state of the lines - something that my attention would be drawn to when something changes (interrupt driven). This resulted in tube map dashboard to provide me with real(ish) time data about how the systems are behaving.

A video of the dashboard is below. 


The dashboard gives me real time updates to the published state of each London Underground line.  Changes are immediately visible as the LEDs associated with a line with problems start flashing.  The flashing draws my attention to it.  The dashboard also provides Text To Speech to explain the details behind a problem  

Design

The dashboard is shown below (banana for scale).  The finished product is a useful map for me, even when not powered.  Once powered it shows the status of each line by different animations. Neopixels (hacked cheap fairy light strings from Amazon) representing each station are fully lit for a given line when "Good Service" is indicated by the Transport for London site.  The pixels flash when there is disruption on a given line, e.g. the pixels of the line slow flash between 50% to 100% is severe delays, fast flashing is minor delays, etc.  There is also a small e-paper display on the right hand side which shows the date/time as well as any disruption notices. 


The map is mounted onto a 5mm plywood sheet with 272 holes drilled for all the stations and 11 for the list of lines along the side.  It is designed to hang on the wall, so I built a wooden frame for it which also allowed some space for the Pi Zero W2 and associated electronics.  The neopixels are hot glued into holes drilled into the wood.  They shine through the paper, which works as an excellent diffusion material.  The back of the map is shown below.



The architecture is shown below.  A Raspberry Pi Zero W2 queries the TfL Open Data site to get the status of the lines and then creates animations on the 4 pixel strings (100 pixels each)  as needed via a demultiplexer.  The demultiplexer is needed to drive the 4 strings off of a single pin (pin 18).  This was necessary as they are fixed address neopixels.  





The Pi also makes service announcements if there are any major issues to announce.  This is done via the text to speech engine at Google Translate and a Bluetooth speaker.  

Conclusion

This project took a long time to complete due to the amount of physical work required and I kept having to buy new parts, materials, and tools to complete it.  I am satisfied with the result and it has allowed me to keep better track of problems on the tube lines that I am helping to deliver.  I am tempted to build it again as I am sure I could improve the quality significantly. A desktop size version would be useful for the office as well, maybe only showing the line portion in the bottom right.

Obviously there are an enormous number of possibilities for similar dashboards for different purposes, so this post may be useful for those wanting to display completely different types of data.  

A YouTube video of my presentation to Raspberry Pint (Twitter @RaspberryPint, Facebook Group: Raspberry Pint, Meetup: Raspberry Pint) is available at this link:

https://www.youtube.com/watch?v=vzorWEc36h4

Resources and Parts

This link has information on the use of neopixels. 

https://learn.adafruit.com/adafruit-neopixel-uberguide

I used these fairy lights, which are fixed address neopixels.  They work as per any neopixels, except you can't join multiple strings together like normal neopixels.  The additional neopixels don't operate separately to the other string(s) as they share the address space of pixels 0-99 (commanding pixel 5 lights the same pixel in all joined strings).   



I used Molex SL connectors for the wire to wire connectors.  


and RS-Pro connectors for the board to wire connectors. 


The Demultiplexer is the Toshiba 4051BP. 

TfL Open Data is a very rich source of data available to everyone.  

https://tfl.gov.uk/info-for/open-data-users/

The display is a 2.13 inch Waveshare 3 colour e-paper.  It is very slow, but works fine for occasional updates such as the clock, which is updated once a minute.