A comprehensive web application for the Ahmedabad Municipal Transport Service (AMTS) that combines bus route information with real-time seat occupancy monitoring using Arduino sensors. This system provides commuters with detailed bus schedules, routes, fares, and live seat availability data.
- Detailed Route Information: Complete bus routes with stops and timings
- Real-time Schedules: Current bus timings and frequency
- Fare Calculator: Accurate fare information for different route segments
- Contact Information: AMTS office details and support
- Live Seat Status: Real-time occupancy monitoring using ultrasonic sensors
- Visual Seat Map: Interactive bus seat layout with availability indicators
- Arduino Integration: Hardware sensor integration for accurate seat detection
- Simulation Mode: Fallback mode when hardware is not connected
- Responsive Design: Works seamlessly on all devices
- RESTful API: Clean backend API for seat status
- Real-time Updates: Live data refreshing every second
- Error Handling: Graceful fallback to simulation mode
- Frontend: React.js, Bootstrap 5, CSS3
- Backend: Node.js, Express.js
- Hardware: Arduino Uno, Ultrasonic Sensor (HC-SR04)
- Communication: Serial Port Communication, REST API
- Tools: CORS for cross-origin requests
- Node.js (v14 or higher)
- npm (v6 or higher)
- Arduino IDE (for hardware setup)
- Arduino Uno with ultrasonic sensor (optional - has simulation mode)
git clone https://github.com/hetgardi/D.E-CURSOR.git
cd D.E-CURSORnpm installIf you want to use the real sensor:
- Connect HC-SR04 ultrasonic sensor to Arduino:
- VCC โ 5V
- GND โ GND
- Trig โ Pin 9
- Echo โ Pin 10
- Upload the Arduino code from
arduino/seat_sensor.ino - Connect Arduino to your computer
- Update the COM port in
server.js(line 17)
npm run start-serverThe server will run on http://localhost:3001
npm startThe application will be available at http://localhost:3000
D.E-CURSOR/
โโโ arduino/
โ โโโ seat_sensor.ino # Arduino sensor code
โโโ public/
โ โโโ index.html # HTML template
โโโ src/
โ โโโ components/
โ โ โโโ BusTracker.js # Bus routes and schedules
โ โ โโโ BusTracker.css # Bus tracker styles
โ โ โโโ SeatMap.js # Real-time seat map
โ โ โโโ SeatMap.css # Seat map styles
โ โโโ App.js # Main application component
โ โโโ App.css # Application styles
โ โโโ index.js # React entry point
โ โโโ index.css # Global styles
โโโ server.js # Express backend server
โโโ package.json # Project dependencies
โโโ README.md # This file
Returns the current seat occupancy status.
Response:
{
"status": "free" | "occupied",
"mode": "sensor" | "simulation"
}- Hardware Mode: Arduino with ultrasonic sensor detects seat occupancy
- Serial Communication: Arduino sends status via USB serial port
- Backend Processing: Node.js server reads serial data and serves via API
- Frontend Display: React app fetches and displays real-time seat status
- Simulation Mode: When hardware is unavailable, system runs in demo mode
- Comprehensive AMTS route database
- Real-time schedule display
- Interactive fare calculator
- Mobile-responsive design
npm start- Start React development servernpm run start-server- Start backend API servernpm run build- Build production bundlenpm test- Run test suite
Update the COM port in server.js:
const serialPath = 'COM5'; // Change to your Arduino portAdjust distance threshold in arduino/seat_sensor.ino:
if (distance > 0 && distance < 10) { // Adjust threshold as needed
Serial.println("occupied");
}- Fork the repository
- Create a 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
For questions or support:
- GitHub: @hetgardi
- Project: D.E-CURSOR
This project is open source and available under the MIT License.
- Multiple sensor support for all seats
- Mobile application
- Real-time GPS bus tracking
- Digital ticket booking integration
- Push notifications for seat availability
- Historical occupancy analytics
- Integration with city transport systems