A Raspberry Pi application that displays real-time London bus arrival times on an LCD screen. The application shows upcoming arrivals for both northbound and southbound buses at specified stops.
- Real-time bus arrival information from TfL API
- Displays next two buses for each direction (north/south)
- Shows bus line numbers, expected arrival times, and minutes until arrival
- 30-second refresh rate
- Error handling and automatic recovery
- Clean display formatting for 16x2 LCD screens
- Raspberry Pi (any model with GPIO pins)
- 16x2 LCD display compatible with
rpi_lcd
library - Appropriate wiring between Raspberry Pi and LCD
- Python 3.6+
- Required Python packages:
requests
rpi_lcd
datetime
- Clone this repository to your Raspberry Pi
- Install required packages:
pip install requests rpi_lcd
- Update the variables to your desired TFL Stop ID (as described under "Configuration")
- Ensure your LCD is properly connected to the Raspberry Pi's GPIO pins
The application is configured to monitor two TfL bus stops:
- Northbound:
- Southbound:
To monitor your chosen bus stops, modify the NORTH_URL
and SOUTH_URL
variables at the top of the script. Stop ID's can be found through the TFL's API documentation, or included in the URL for a TFL stop (490006407W in this case).
The LCD displays four lines of information in the following format:
N: Bus 12 17:15 9m
N: Bus 23 17:16 10m
S: Bus 12 17:20 14m
S: Bus 23 17:22 16m
Where:
- N/S indicates direction (North/South)
- Bus number
- Expected arrival time (24-hour format)
- Minutes until arrival
To start the application:
python bus_display.py
The program will continuously update the display every 30 seconds until interrupted with Ctrl+C.
The application includes robust error handling for:
- LCD initialization failures
- API connection issues
- Data parsing problems
- Display update errors
In case of errors, the application will attempt to recover automatically and continue running.
The application can be safely terminated using Ctrl+C. The LCD screen will be cleared upon exit.