Turn your old smartphone into a high-fidelity autonomous robot brain.
CellBot challenges the idea that you need expensive hardware (Intel RealSense, LiDAR, Jetson Nano) to build a capable autonomous robot.
Instead, it leverages the Android smartphone you already own as a high-performance Sensor Hub. The phone captures 1080p video, fused IMU data, and GPS location, streaming it all via ultra-low latency WebRTC to a PC "Brain." The PC runs heavy Computer Vision and Path Planning algorithms, sending motor commands back to the phone to drive the chassis via a simple USB-OTG Arduino connection.
The result? A sophisticated autonomous platform for the price of a toy car.
- Split-Compute Architecture: Offloads heavy AI/CV processing to a PC while keeping the robot hardware lightweight.
- WebRTC Streaming: Ultra-low latency (<200ms) video and bi-directional JSON data over local Wi-Fi.
- Sensor Fusion: Combines Visual Odometry (Camera), GPS, and IMU data using an Extended Kalman Filter (EKF) for robust state estimation.
- Autonomous Navigation: Waypoint following, lane keeping, and PID-based steering control.
- Live Dashboard: Real-time web interface (Flask/Socket.IO) to monitor video, telemetry, and control the robot manually or autonomously.
[ PC CONTROL CENTER ] [ ANDROID PHONE ] [ ARDUINO ]
(Python/AsyncIO) (Kotlin) (C++)
| | |
[Main Loop] <---(WebRTC Video/Data)---> [Sensor Hub] [Motor Driver]
| | |
+----+----+ +---+---+ |
| | | | |
[Perception] [Fusion] [Camera] [IMU/GPS] |
| | | |
[Navigation] [Control] +----(USB Serial OTG)----> [Parser]
| | |
+----+----+ [Motors]
|
[Dashboard] (Flask/SocketIO)
2WD or 4WD kit.Motors: 4x DC Motors (TT Gearbox style recommended). Motor Driver: L298N or HW-130 Motor Shield.Microcontroller: Arduino Uno or Nano. Bridge:USB OTG Cable (Phone type to USB-A female). Sensor Hub: Any Android Phone (Android 8.0+). Compute: A Laptop/PC on the same Wi-Fi network.
The Brain (PC)Language: Python 3.10+Core Libs: aiortc (WebRTC), opencv-python (Vision), filterpy (Kalman Filter), flask-socketio (Dashboard).
Responsibilities:Receives video & sensor packets.Runs Lane Detection & Visual Odometry.Fuses GPS + IMU + VO into a coherent pose
Kotlin (Jetpack Compose).Libs: stream-webrtc-android, usb-serial-for-android.
Responsibilities:Captures Camera2 frames.Listens to Accelerometer/Gyroscope/Magnetometer & Location Services.Forwards serial commands from WebRTC
Responsibilities:Parses serial strings (e.g., CMD,150,-150).Generates PWM signals for motor drivers.Implements safety watchdog (stops if phone disconnects).
Step 1: Arduino SetupOpen Arduino/Aiduinocontrol.ino. Connect your Arduino. Upload the sketch. Wiring:Left Motor PWM: Pin 6 (En), Pins 4, 5 (Dir)Right Motor PWM: Pin 9 (En), Pins 7, 8 (Dir) Step 2: Android SetupOpen robotcontroller in Android Studio. Build and Install the CellBot Controller app on your phone. Permissions: Allow Camera, Location, and USB access when prompted. Step 3: PC Brain SetupCritical: You must run the Signaling Server and the Main Brain in two separate terminals. Install dependencies:Bashpip install -r brain/requirements.txt Terminal 1: The Switchboard (Keep this running!) signaling_server.py Wait until you see: Starting signaling server on 0.0.0.0:8765Terminal 2: The /main.py Step 4: Launch 🚀Connect your Phone to the Arduino via OTG cable. Open the App on the phone. Enter your PC's local IP address (e.g., 192.168.1.10) and click Connect. Open http://localhost:5000 on your PC to view the Dashboard. Click Manual to drive with arrow keys, or set a waypoint on the map for Autonomous mode. ##🛡️ Safety FeaturesWatchdog Timer If the PC or Phone crashes, the Arduino stops motors after 500ms of silence. Geofencing: Define safe zones on the dashboard map; robot stops if it breaches the boundary. Emergency Stop: Big red button on the Dashboard interface.
Contributions are welcome! Please fork this repository and submit a pull request for improvements to the CV algorithms, EKF tuning, or Dashboard UI.