Metro tracker
A 60-LED strip by the door that shows when the next train arrives. One pixel per minute, so you can read it on the way out without touching a phone.
Why?
This small project started because I live few minutes away from a metro station. It is close enough that the question is never "when is the next train", it is "should I leave right now or not".
To answer it I had to take out the phone, unlock it, wait for the app to load and read the number. It is not a lot of work, but I had to do it every time, usually with a bag in one hand and coffee in another. So half of the time I just did not check, went down anyway and spent eleven minutes on the platform.
I wanted something which I can just look at, like a clock on the wall.
The idea
Take a strip of 60 LEDs, hang it near the door and use one LED per minute. If LED number 7 is on, then the train arrives in 7 minutes. No numbers, no screen, no app, you just look at it while putting your shoes on.
How it works
Flow is pretty simple:
- Connect to WiFi
- Call transit API and get arrival predictions
- Parse JSON response with cJSON
- For every train turn on LED with index equal to minutes till arrival
- Wait and repeat
- PROFIT!
But after the first version I realized that few small things have to be added to make it actually readable.
Only one direction. API returns trains for both directions and they are marked with group number in the response. Showing both of them on one strip makes it a mess, so I filter by group and keep only the direction I use.
Green zone. LEDs from 5 to 10 have small green tint. This is the window when it makes sense to leave: if the train is somewhere there I can walk down and get on it. Trains outside of this window are shown in red, inside — in yellow. So I don't have to do any math, color does it for me.
Every 10th LED has small cyan tint. Without it you have to count LEDs one by one to understand which one is lit. With these marks you just see "a bit after the second mark" and it is enough.
Smooth movement. First version was updating LEDs once per API call and the lit LED was jumping one position down. It looks like a glitch, not like a movement. So now I remember previous positions and during the whole interval between updates I slowly fade out the old LED and fade in the new one. Train slides down the strip instead of jumping. Also brightness is not linear for the eye, so I square it before sending to the LEDs, otherwise fading looks uneven — nothing happens for a while and then everything happens at once.
Broken WiFi is visible. If connection is lost the whole strip becomes red gradient. This one is important: if the display just freezes with old data I will trust it and miss the train, so it is better to fail loudly.
Result
It works and I use it every day. Unexpected part is that I stopped noticing it as a device, I just look at the wall while going out and my feet either speed up or not.
Hardware
- ESP32 board, it has WiFi and enough power to drive the strip
- 60 WS2812B LEDs, one data pin is enough for all of them
- Status LED which blinks during boot and on every API call, so I can see what is happening without connecting serial cable