Swiss Public Transport Display for Home
Never miss your train again! This WiFi-enabled real-time display shows departures from two stations of your choice. Perfect for commuters:
- Setup via smartphone
- 5 brightness levels
- Energy efficient (<1W)
- Compact design
- Live updates of Swiss public transport data
Easy installation: Just needs WiFi (2.4 GHz) and USB power.
Bring the train station display to your home or office! Get accurate departure times for buses, trains, and boats right where you need them.
- Real-time departures from Swiss public transport (trains, buses, trams, boats)
- Two stations - switch between two configurable stations with a double-click
- 5 brightness levels including a power-saving sleep mode
- BTC price ticker in the footer
- OTA firmware updates - update wirelessly via web browser
- WiFi configuration portal - easy setup via smartphone
- Automatic time sync with NTP (handles DST)
- Night mode - automatic power saving from 22:00 to 06:00
- ESP32-2432S028R (CYD - "Cheap Yellow Display")
- ESP32 with integrated 2.8" ILI9341 TFT display (320x240)
- Built-in boot button for controls
- USB power supply (5V)
- 2.4 GHz WiFi network
- PlatformIO (CLI or VS Code extension) Only for building from source
- USB cable for initial flashing
Use my dedicated page to flash the files.
- Power on the device
- If no WiFi is configured, it creates an access point named "Stationboard-AP" and displays connection instructions on screen
- Connect to this AP with your smartphone
- A captive portal opens where you can:
- Select your WiFi network and enter credentials
- Set Station 1 and Station 2 names (e.g., "Zürich HB", "Bern")
- Configure the number of departures to display
- Set default brightness level
Multi-click the button to re-enter the WiFi configuration portal.
| Action | Function |
|---|---|
| Single click | Cycle through brightness levels (0-4) |
| Double click | Switch between Station 1 and Station 2 |
| Multi-click | Enter WiFi configuration portal |
| Long press (10s) | Enter OTA firmware update mode |
- Long press the button for 10 seconds
- The device enters OTA mode and displays its IP address
- Open a web browser and navigate to
http://<device-ip>/update - Upload the new firmware binary
Based on the provided power consumption data for the ESP32 and the LCD backlight, we can estimate the power draw for each brightness level as follows:
- Normal mode @ 240MHz: ~160-170mA
- Normal mode @ 80MHz: ~30-40mA
- Light sleep: ~0.8mA
- Max brightness (255): Could draw 50-100mA or more
- Lower brightness levels will draw proportionally less
| Level | PWM Value | Backlight | ESP32 Mode | Total Draw |
|---|---|---|---|---|
| 0 | 0 | 0mA | 80MHz (30-40mA) | 30-40mA |
| 1 | 64 | ~12.5-25mA | 80MHz (30-40mA) | 42.5-65mA |
| 2 | 128 | ~25-50mA | 80MHz (30-40mA) | 55-90mA |
| 3 | 192 | ~37.5-75mA | 80MHz (30-40mA) | 67.5-115mA |
| 4 | 255 | 50-100mA | Light sleep (~0.8mA) | 50.8-100.8mA |
These estimates assume linear scaling of backlight power consumption with PWM duty cycle. The actual power draw may vary based on the specific characteristics of the LCD and the ESP32-2432S028R.
# Clone the repository
git clone https://github.com/pashol/Stationboard.git
cd Stationboard
# Build firmware
pio run
# Upload to device (connect via USB)
pio run -t upload
# Monitor serial output (optional)
pio device monitorsrc/
├── main.cpp # Entry point, setup/loop, sleep management
├── globals.h/cpp # Configuration struct, constants
├── stationboard.h/cpp# JSON streaming parser, display rendering
├── networking.h/cpp # WiFiManager, BTC API
├── utilities.h/cpp # Time formatting, brightness, SPIFFS config
└── ota.h/cpp # ElegantOTA handling
- TFT_eSPI - Display driver
- WiFiManager - Captive portal for WiFi setup
- ArduinoJson - JSON parsing
- json-streaming-parser - Memory-efficient API response parsing
- ElegantOTA - Web-based firmware updates
- OneButton - Button handling
- Timezone - DST-aware time handling
- Swiss Transport API - Real-time departure data
- BTC price API - Cryptocurrency ticker
- Second station support (double click)
- OTA firmware updates (long press)
- Distance to station as parameter
- Code refactoring
- Power savings
- Fixing sprite issues (low memory)
- Night mode (automatic time-based activation, 22:00-06:00)
- From-To-Stationboard
- OTA over internet
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source. Please check the repository for license details.
- Swiss Transport API for providing free public transport data
- The ESP32 and Arduino communities
