← Back to Projects

MBTA Tracker

Project Cover

This project was heavily inspired by this video; a few days before getting started, I also learned that you can buy a prettier (for now!) T tracker here but opted to build my own anyway. Here’s what we’re working with:

+a bunch of wires from my Putz’s (the name of my dorm hall) workbench.

Anyways. I thought that was out of the question, so I resolved to move my work onto a big screen later and start out with an eight pin OLED display that Yabi gave me. After some initial planning, I started off for real by writing a Python program to fetch information about the Red Line stops closest to my dorm from the V3 API, since I’d be learning C++ as I went along and thought reference code in a language I’m more comfortable with would make it significantly easier. Turns out that C++ is not that hard to pick up; there were a few other things, like getting the ESP32 connected to WiFi, that I expected to be a lot more complicated than they actually ended up being.

I wired everything up and tried to get some simple code displayed on the screen to make sure it was working properly, and this is where things went wrong for a bit. Not only were my attempts to Frankenstein a few online tutorials failing, which I later learned (at 2AM + from Yabi, who had work in the morning) was occurring because I was treating a screen that used SPI like one that used I2C, I also discovered that the screen was likely fried (either from a previous project or by me). I turned to my smallest and last Yabi-gifted screen, a four-pin OLED. Thankfully, I was able to get this one working just fine.

I then rewrote my MBTA script in C++. Aside from the screen, the T shutting down at 2AM and refusing to cough up the data for the morning trains ended up being my biggest bottleneck. After catching a few small bugs in my functions for dealing with time…

...it worked!

What's next:

Lastly, here are some resources I found helpful if you’re interested in making a T tracker of your own!