Coder Social home page Coder Social logo

jacksalici / smart-bus-stop Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 40.59 MB

IoT project aimed to improve public transport; enabling fast, easy and accessible mobility.

License: MIT License

C++ 14.43% Python 52.22% HTML 25.26% CSS 0.08% JavaScript 7.25% Mako 0.76%
iot smart-city

smart-bus-stop's Introduction

๐Ÿš IoT-powered smart bus stop

To improve city mobility, enabling faster, easier and safer public transport for the user and at the same time, lower management costs for the administrators.

๐Ÿ“ Abstract

This project was developed as the final project for the Master's Degree in the CS IoT course. Its main focus is to improve public transportation, particularly city buses. The aim is to create a smart bus stop that enables easier access to the service and enhances it through a network of such stations.

In our vision, each smart bus stop will be equipped with a digital kiosk/totem device and a button board. A solar panel may also be provided to the station to make it self-sufficient during sunny hours.

The totem will allow people to see the real-time locations of public services, along with the estimated transit times through various stations. It will also make it possible to purchase tickets on the spot. An NFC/RFID reader will make authentication possible with smartphones and other physical devices (provided, for example, to the elderly who do not own modern mobiles).

A button will be provided for people with disabilities to alert the bus driver to give help or attention.

Once the network of smart stops is established, it will be possible to perform statistical analysis and forecasting on the use of a certain line, allowing better allocation of resources (such as adding or deleting a bus, "dynamic" lines, etc). The project aims to reduce maintenance costs for public administrations. An ideal solution uses an AI-powered camera to count people waiting at the stops and a server that checks if the upcoming bus's maximum capacity would be exceeded, calling for an additional bus.

The project was developed on Arduino and Esp32 dev-board. Although all the parts work smoothly, some components have been simplified (e.g., omitting some security best practices) since more realistic solutions would have been too time-consuming.

Authors: Giacomo Salici @jacksalici and Francesco Marcucci @MRTCc, University of Modena and Reggio Emilia

๐Ÿ— Actors and Architecture

The main actors of the project are the bus stop, the bus stop help button, the bus itself and the main server.

Actor Component Link
Main Server (Overview) Flask Server Details and code
Prophet forecasting Details and code
Bus Stop (Overview) Arduino Details and code
Bus Stop Help button (Overview) Esp32 Details and code
Bus Client (Overview) GPS Tracker Details and code

System Design and Architecture - Created with Miro

Main server ๐Ÿง 

The main server manages a Flask server [code] that offers frontends to the stops. It is subscribed to all MQTT topics and it couples the information of each bus and its next stop. All the details, along with the seat bookings are stored in an SQLite database that represents a digital twin of public transport.

The server receives via MQTT the location of each bus and fetches using Open Route Service the ETA to its next station and sends all the data to it. It receives also the number of seats busy.

From each station, moreover, the server receives the number of people awaiting there and if someone requests help using the specific button. The request is forwarded via MQTT to the upcoming bus.

The count of the people in the crowd is presented to the system administrators on a specific page. Bus lines that can't manage all the people are highlighted.

For the developers, the server has an API endpoint that let to fetch real-time data from the stops such as the number of people there.

Lastly, we develop with Prophet a forecasting model [code] to predict the number of people waiting in the stops in a future moment based on the past recorded data. Since it is just a demo project the recorded data was generated using a script, so the model is not accurate.

Bus Stop ๐Ÿš

Each bus stop has a kiosk loaded on the server offered front-end. Users can use a real-time-updated map to see the location of the bus, along with the actual number of busy seats on that bus.

Users can book a seat by logging in using an NFC reader. An Arduino board [code] sends to the serial port the UID of the NFC tag (or smartphone). It is read on the front-end using the experimental web serial port API. Since the project is just a demo we used the UID as the authentication key ignoring that it would be a severe vulnerability in an actual realization.

Bus Stop Help Button ๐Ÿ•น

Each stop is provided with an ESP32 board that let people toggle a button to call for help [code]. The board is separated from the Arduino NFC reader for the sake of modularity and the decoupling principle.

The same ESP32 board read the value of a potentiometer that simulates the presence of an AI-powered camera that counts people.

Bus Client ๐Ÿš

Each bus is tracked with a GPS sensor. For the demo, we created a smartphone app [code] that sends the location and that allows the user to set the number of busy seats and the next stop.

๐Ÿ“บ Presentations

During the final presentation, we were asked to present a commercial/marketing-oriented presentation and a more technical one. Both are written in Italian.

๐Ÿ’ก Acknowledgement

Other useful links:

smart-bus-stop's People

Contributors

jacksalici avatar mrtcc avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

smart-bus-stop's Issues

esp32 can't save params after timeout

After setting the config portal timeout a callback function for save the parameters is needed.

wifiManager.setConfigPortalTimeout(60);
wifiManager.startConfigPortal("Smart Bus Stop");

It shoud be developed something like this (see AutoConnectWithFSParameters Example):

wifiManager.setSaveConfigCallback(saveConfigCallback);

//callback notifying us of the need to save config
void saveConfigCallback () {
  //save default values
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.