# KLNavBot

KLNavBot is a cloud-connected autonomous campus delivery robot built around an ESP32 controller, GPS tracking, ultrasonic obstacle detection, and Firebase-backed real-time monitoring. The project combines embedded control, cloud synchronization, and a modern web dashboard to demonstrate a practical autonomous delivery stack for campuses and smart facilities.

## What This Repository Shows

- ESP32-based robot control for a two-motor mobile platform
- GPS tracking through a NEO-6M module
- Ultrasonic obstacle detection with fail-safe stopping
- Firebase Realtime Database for live status and command exchange
- Browser-based monitoring and route visualization
- Autonomous campus delivery workflow for robotics and IoT demonstrations

## System Highlights

- Real-time tracking of robot position, state, and obstacle status
- Remote manual control through Firebase commands
- Cloud dashboard for live route and robot monitoring
- Secure Firebase rules for public telemetry and authenticated control paths
- MicroPython-based firmware structure for modular ESP32 development

## Repository Structure

| Path | Purpose |
| --- | --- |
| [firmware/main.ino](firmware/main.ino) | ESP32 main loop, WiFi, Firebase polling, GPS upload, obstacle safety |
| [firmware/gps_module.cpp](firmware/gps_module.cpp) | NEO-6M GPS parsing and coordinate conversion |
| [firmware/motor_control.cpp](firmware/motor_control.cpp) | L298N motor driver abstraction for movement commands |
| [dashboard/](dashboard/) | Live web dashboard assets |
| [firebase/](firebase/) | Firebase config and security rules |
| [docs/](docs/) | Architecture and design documentation |

## Core Hardware

- ESP32 for compute, WiFi, and cloud communication
- NEO-6M GPS for location tracking
- HC-SR04 ultrasonic sensor for obstacle detection
- L298N motor driver for differential drive control
- MPU6050-ready sensor fusion architecture for future IMU stabilization

## Firebase Data Model

- `/robotCommands` stores remote motion commands such as `forward`, `backward`, `left`, `right`, and `stop`
- `/robotStatus` stores obstacle state, motion state, and heartbeat timestamps
- `/robotGPS` stores the latest latitude, longitude, and satellite count
- `/deliveryOTP` and admin paths are reserved for authenticated delivery workflows

## Documentation

- [Architecture Diagram](docs/architecture-diagram.md)
- [Hardware Architecture](docs/hardware-architecture.md)
- [Software Architecture](docs/software-architecture.md)
- [Firebase Data Flow Diagram](docs/firebase-data-flow-diagram.md)
- [Sensor Fusion Methodology](docs/sensor-fusion-methodology.md)
- [Navigation Workflow](docs/navigation-workflow.md)
- [Project Results](docs/project-results.md)
- [Future Scope](docs/future-scope.md)

## Getting Started

1. Configure the ESP32 WiFi credentials in the firmware.
2. Set the Firebase project URL and database access rules.
3. Flash the firmware files to the ESP32.
4. Open the dashboard and confirm that GPS, status, and command updates appear in real time.

## For Recruiters

KLNavBot is designed to present a complete robotics stack: embedded firmware, sensor integration, cloud telemetry, real-time UI, and an autonomous delivery workflow. It is a compact demo of the kinds of skills used in robotics, embedded systems, autonomous vehicles, and IoT product development.
