I commute by train to my office every day, so my schedule ends up being tightly coupled to the train schedule. Far too frequently, I make my way to the platform at the end of the day only to see something like this:
Cancellations and delays. I could check the app every day when I’m thinking of leaving but I wanted to have something I could glance at. I built this little pi-powered gadget to stick above my monitor that grabs the times and keeps me in the loop!
Rig up an e-paper display to a raspberry pi, pulling data from the metro-north website.
- 3-D Printer to Make a Case
This guide is going to mostly point to other resources that have done a great job already.
Step 1: Raspberry Pi, Meet Display
The e-ink display makes a lot of sense here because the schedule is static for long periods of time. With an LCD screen, you can run the risk of burn-in and ghosting.
Setting the raspberry pi up with the e-paper display was a straightforward bit of wiring following a tutorial. It does a much better jobs than me re-hashing it, so check it out over at instructables.
They detail exactly which wires go to which pins. There’s also a python example script there that creates an updating clock.
Step 2: Grabbing Metro-North Times
We’ll need to grab the times from the Metro-North website to display on our screen. There’s two options to go about doing this:
Metro-North API: This MTA resource provides a great deal of information across a variety of different transportation methods in and around New York City. This is a pretty robust solution to use if you’re incorporating this as part of something like an app or need access to super real-time data.
Metro-North Status: This service isn’t really meant to be queried at a high volume. However, for hacking together a project that isn’t spamming requests, it can be really quick to get up and running. I used the code written by github user oogali for this.
Step 3: Displaying the Times
I’ve reproduced the display code below – you’ll be able to see that it’s really just a merging of the two pieces of code referenced in the above sections.
Step 4: Closing Things Up
At this point, all I needed was a case. Since the whole thing is meant to capture the same blocky aesthetic as the current train displays, it was relatively straightfoward to create a rectangular box in Fusion360 and then print it on my Ender 3-D printer. I’m certainly a beginner when it comes to CAD but there wasn’t much iteration involved here. I’m making the STL file from the build available here.
I decided to use hot glue to keep the board and display fixed in the locations I wanted them. I used a dremel tool to cut a small opening for the USB power cable to make an exit from the case. Once that was done, all that it took to get it mounted was some tape to the top of my monitor giving me a clean finished product that I could glance at when the end of the day rolled around.