Inspiration

Have you ever had to fight your way onto a bus? Pack yourself like a SARDINE with ALL the other students who are racing to their morning classes, a football game, or just home? To be honest, we all want to go to our destination… ON time. U of M deals with crowded and unsafe buses daily. Before and after classes are the worst. Unpredictable weather, road closures, and school-wide events. Forget taking the bus when events such as U of M vs MSU or Kamala Harris visiting take place. Our problem is crowded transportation, especially for students who rely on school buses to ensure safe and easy access to and from classes.

What it does

Our team came up with a SpartyBus app that tracks real time data on the amount of people entering and leaving a bus. This ensures drivers and students are aware of the limit a bus can hold and whether it's worth stopping at a bus stop. It would implement motion detection on the bus doors to count the number of people that enter and exit the bus. The application would receive this data and broadcast it to users on the SpartBus app.

Raspberry Pi

On the hardware side of the project, we needed to set up a simple circuit with our raspberry pi. The circuit utilized 2 IR sensors, a liquid LCD screen and 3 LEDs. The IR sensors were used to detect if a person was coming or going off of a bus with a threshold that accounts for people standing in the way of the sensor or people who partially got on the bus and then got off. This was achieved very easily on our raspberry pi by using GPIO.BOARD to set pins on the raspberry pi into an input/output mode and using a series of nested loops and if/else statements to count the amount of people getting on a bus. We also implemented 3 LEDs of red, green and yellow color that were intended to be on the outside of a bus and signal how full the bus is. That was accomplished through a series of if statements and changing the signal pins on the raspberry pi accordingly. Lastly, a liquid LCD screen was added to show a live count of the amount of people in a bus as both a sign on the outside of the bus for people who may be getting on it and a value to send to our other code later. The other program on the raspberry pi was able to connect to low voltage bluetooth devices which was how we intended to send our persons count to our app/phone. We then encountered an issue of passing a bit of data from one raspberry pi program to another, but we found a quick solution by creating a text file that the counting program would write to and the broadcasting program would read, allowing for both programs to share data simultaneously.

Challenges we ran into

We tried using a popular MQTT protocol Mosquitto as a broker on the raspberry pi, however using and implementing on a microcontroller had its own fair share of difficulties of trying to understand networking systems. However, we were able to demo and implement, publish the sensor data to the broker via a host from an online tutorial and begin collecting and processing the data to the application client (super exciting!).

Accomplishments that we're proud of

We are proud of having the ability to quickly use hardware input/output to demonstrate a functionality we had in mind using the raspberry pi. Getting 2 different methods to use the raspberry pi to share data, one using the bluetooth and the other using the MQTT protocol (API).

What we learned

We learned a lot about all of the different parts of the system we used, especially the Raspberry Pi. We also learned about how Bluetooth Low-Energy works, and how it’s used to send data to other devices seamlessly with the GATT protocol. Learning how to use Swift and the Xcode IDE was another major area of accomplishment for us, and we were pleasantly surprised by how little code we needed to get what we wanted done.

What's next for SpartyBus

The SpartyBus can be implemented anywhere where buses are used. It would be best marketed to places with a lot of congestion, like campuses and big cities, because its main feature is to detect how crowded a bus is. Given the abundance of apps similar to SpartyBus, like transit and Mbus, SpartyBus stands out by having features that not one app has in one package. Additionally, there are other features that we are planning to add to the SpartyBus app.

Share this project:

Updates