Let’s set the RC car aside for a moment and revisit something from Part 1.
Back then, we used the laptop’s built-in webcam to detect objects — people, chairs, dogs, cars. The concept worked.
The execution had one small problem: to point the camera at something, you had to physically carry the laptop there. And to see the results, you had to crane your neck around to look at the screen while simultaneously aiming the webcam in the opposite direction.Imagine trying to check whether there’s a cat behind your house. You’d walk out, hold the laptop up, tilt it toward the garden, then awkwardly twist your head around to see the screen — which now shows the cat, the garden, and your own confused face staring back at you.
Not ideal.
What we actually need is to separate the camera from the screen. Nothing fancy — just the ability to sit inside the house and know there’s a mailman at the front door.
We don’t need to buy a camera. We already have one in our pocket.
The Setup: Phone as Mobile Camera
Using a phone as a mobile surveillance camera — combined with IP Webcam and YOLOv8 — is the most flexible, zero-cost solution for wireless object detection. The phone streams video over Wi-Fi; the laptop receives it, runs the AI, and shows the results.
Think of the app as a real estate agent: it stands in the middle, takes information from the camera, and reports back to the laptop — “there’s a person”, “there’s a car”, “there’s a cat doing something suspicious.”
We don’t need to write that middleman app ourselves. It already exists: IP Webcam, available free on the Google Play Store.
Step 1: Set Up the Phone Camera
Install IP Webcam from the Google Play Store (Android).
Make sure your phone and laptop are on the same Wi-Fi network.
Open the app → scroll to the bottom → tap “Start server”. You’ll see a WiFi IP and Port displayed on screen — something like:
192.168.1.105:8080
Test it in your browser: open Chrome or Edge on your laptop and go to:
http://192.168.1.105:8080/video
You should see a live video feed from your phone camera. If you do, you’re ready for Step 2.
Step 2: Set Up the AI on Your Laptop
If you completed Part 1, you already have everything installed. If not, open PyCharm’s Terminal and run:
pip install opencv-python ultralytics
Create a new Python file — call it detect2.py — and paste this code in. As you’ll notice, it’s nearly identical to what we wrote in Part 1. The only real difference: instead of reading from a webcam, we’re reading from a phone over Wi-Fi.
import cv2
from ultralytics import YOLO
# Load YOLOv8 nano model - smallest and fastest
model = YOLO('yolov8n.pt')
# Replace with your actual IP Webcam address
# Format: http://<WiFi_IP>:<Port>/video
droidcam_url = 'http://192.168.1.105:8080/video'
cap = cv2.VideoCapture(droidcam_url)
if not cap.isOpened():
print("Cannot connect to camera.")
exit()
while cap.isOpened():
success, frame = cap.read()
if success:
# Run YOLOv8 on the frame
results = model(frame)
# Draw detection results on the frame
annotated_frame = results[0].plot()
# Display on screen
cv2.imshow("Mobile Surveillance with YOLOv8", annotated_frame)
# Press 'q' to quit
if cv2.waitKey(1) & 0xFF == ord("q"):
break
else:
break
cap.release()
cv2.destroyAllWindows()
Hit Run. Point your phone at anything. Watch your laptop label it in real time.
Press q to stop, or click the red STOP button in PyCharm.
What Just Happened
The phone captures video. IP Webcam streams it over Wi-Fi. Python receives each frame, feeds it into YOLOv8, and draws labeled boxes around everything it recognizes — all in real time, on your laptop screen, while the phone sits wherever you put it.
At minimum, this gives you what we’d call peace of mind in concept form: you can imagine placing that phone on top of our RC car robot and having it report back what it sees — without anyone needing to carry a laptop around like a confused tourist.
A Note on DroidCam
You might try DroidCam and get: “Cannot connect to camera.”
That’s expected. DroidCam Free doesn’t allow video streaming via URL — that’s a Pro feature, locked behind a ~$5 paywall. We are not paying $5 just to satisfy curiosity when IP Webcam does the same thing for free.
Use IP Webcam. Free, reliable, works with OpenCV out of the box. The right tool for the job.
Next up: we teach the robot to see obstacles — no physical sensor required. Just a webcam, some Python, and the concept that will eventually become the foundation of every self-driving system on the planet.
