Autonomous MedRover is a web-connected hospital delivery rover prototype.
Users place medicine/supply delivery requests from a web portal, and an ESP32-based line-following robot navigates to the selected room route (A/B/C), performs delivery wait, and returns to base.
- Domain: Indoor healthcare logistics automation
- Robot: ESP32 + IR line sensors + motor driver + DC motors
- Control: PD line following with junction-based routing and recovery logic
- Cloud: Supabase (order polling + status updates)
- Frontend: React/Vite web portal for order placement and tracking
hardware_esp32/- ESP32 firmware sketches and calibration versionsline_follow_v33.ino- latest route logic (A/B/C + return behavior)line_follow_v32.ino- previous stable iteration
web_portal/- React app for ordering and order visibilityREADME.md- this file
- User places an order in the web portal (room code A/B/C).
- ESP32 polls Supabase for
pendingorders. - Robot updates order to
in_transitand starts mission. - Robot follows line, counts junctions, turns based on target room.
- At room, robot pauses (
ROOM_WAIT_MS), performs U-turn, and returns. - On home arrival, mission completes and order is marked
delivered.
- A: turn left at junction 1, serve room, return to start.
- B: turn left at junction 2, serve room, return to start.
- Return path is tuned to avoid unnecessary intermediate stop before home.
- C: continue on main line to top endpoint, serve room, U-turn, return to start.
Route timings and turn thresholds depend on your floor track and must be tuned in firmware constants.
- ESP32 development board
- 5-channel IR line sensor array
- Motor driver (compatible with used pin mapping)
- 2 DC geared motors + wheels + chassis
- Battery/power module with common ground
- Black tape track on light floor
- Arduino IDE (or PlatformIO) with ESP32 board support
- Required libraries:
WiFi.hHTTPClient.hArduinoJson.h
- Node.js + npm (for
web_portal)
cd web_portal
npm install
npm run devCreate a local env file from web_portal/.env.example:
cd web_portal
cp .env.example .envThen set:
VITE_SUPABASE_URLVITE_SUPABASE_ANON_KEY
The web portal already reads these from import.meta.env.
This repo includes root netlify.toml with:
- Base directory:
web_portal - Build command:
npm run build - Publish directory:
dist - SPA redirect rule to
index.html
In Netlify:
- Import the GitHub repository.
- Build settings will auto-detect from
netlify.toml. - Add environment variables in Site settings -> Environment variables:
VITE_SUPABASE_URLVITE_SUPABASE_ANON_KEY
- Trigger deploy.
- Open
hardware_esp32/line_follow_v33.ino. - Set Wi-Fi and Supabase credentials.
- Select ESP32 board and upload.
- Open Serial Monitor at
115200.
A/B/C- choose routeg- start missions- stopp- print settingsi- print IR snapshotw- IR watch mode+/-- base speed adjust]/[- Kp adjust>/<- Kd adjust
baseSpeed,turnSpeed,rightOffsetJUNCTION_PAUSE_MS,ROOM_WAIT_MSBRANCH_MIN_TRAVEL_MS,LINE_END_CONFIRM_MSRETURN_MIN_TRAVEL_MS,RETURN_JUNCTION_COOLDOWN
Tune these values on your real track for reliable turning and home return.
- Keep secrets (Wi-Fi password, API keys) out of public repositories.
- Use calibration sketches in
hardware_esp32/to validate sensor and motor setup before full mission runs.
- Dynamic map/routing instead of fixed A/B/C logic
- Obstacle detection and avoidance
- Better telemetry dashboard (battery, mission timestamps, errors)
- Safer credential handling and OTA updates