Build A London Bus Arrival Ticker With Raspberry Pi
If you live in London, there’s a good chance you rely on one of the two major public transport systems, the Tube and buses. Although the Tube is quite frequent, buses can be quite infrequent, especially outside Central London.
This is why I thought this would make a fantastic little project to make with a Raspberry Pi. We’ll essentially be making the electronic arrivals display found at most London bus stops, which cycle through arrival times for the next bus stop.
If you rely on buses, especially where the buses are quite infrequent, this is definitely something you should give a shot at! Best part, it can cost as little as around $50 to put together!
- Raspberry Pi (any model will do)
- Hitachi HD44780 driven character LCD screen
- 1,000 Ω resistor
- 10K potentiometer
Wiring it up
Refer to the diagram above on how to wire up your project. Some things to keep in mind:
- The 1K Ω resistor is important to prevent a very high current flowing to the Raspberry Pi, from the LCD’s backlight. Some LCD modules do not have a built in a resistor, so it’s recommended to keep one in place. Others, like Adafruit’s LCD modules always have one, allowing you to omit the resistor.
- The 10K potentiometer simply serves as contrast control, and will typically need to be turned up quite high.
- Many LCD modules sold online are not soldered, and even if you press push a header into it, electrical contact will not be made. You can, however, buy some pre-soldered LCD modules from certain suppliers online.
Getting the code up and running
I’ve hosted the Python code for this project on GitHub, but before we can run the code, we’ll need to install a pre-requisite module from Adafruit. This module is compatible with any Hitachi HD44780 driven character LCD module on the market (of which almost all are), even those having more than 2 lines of display (although the code does not take advantage of more than 2 lines). To install Adafruit’s Python module, you’ll need to connect your Raspberry Pi to the internet and type the following commands at the terminal:
wget https://github.com/adafruit/Adafruit_Python_CharLCD/archive/master.tar.gztar -xzvf master.tar.gz
sudo python setup.py install
This will update all the necessary modules on your Pi, and then install the Adafruit Python module. Then you’re ready to install my code, by typing the following:
tar -xzvf ldn-bus-ticker.tar.gz
You’re now ready to run the code! Simply type:
… Where N is your bus stop code. This is the same code found at every London bus stop, inside a sign that typically says “Text 1234 to 87287 to get live bus arrival times”
If you don’t live in London but still want to try it out, head to this site where you can find a map of all bus stops in London.
Click on any one, and if you scroll down you should find the same text with a bus stop code, as on the real signs. You can watch a Vine of this project in action here!
Hope you’ve enjoyed this project! If you have any problems, drop a comment below!
If you're looking for your next job as a software engineer, have companies apply to you by adding your profile to Snap.hr.