Hi all:
I want to do a project too keep a running total of passengers in a bus.
My initial thoughts are:
To use an optical sensor at the entrance/exit to count.
Then there is perhaps a pressure sensor on the step as a possibility.
A small PIC should be able to run the count and display the number on a 2 digit, 7 segment display.
Perhaps a push button to reset the count.
If using optical you would need to control passengers to single file on entrance and exit. You would need 2 optical sensors per door. Because if #1 & #2 fired then that would be incoming. If #2 & #1 fired in that order it would be exiting. The rear door would by most likely exiting only. Most passenger coaches allow for two persons wide coming and going at the front and single exiting at the rear.
This has come up multiple times before, for a simple bus with a simple door try a forum search of people counter, then a Google search of people counter. Then you can worry about a bus with multiple entry / exit.
My local post office collection depot has a occupancy counter, its some sort of overhead coil that detects a persons presence, might be a better way to count people, a infra red beam is prone to double counting.