TL;DR: We're a small bag factory in Yiwu, China. Our truck makes a 120km round trip every day between our warehouse and factory. We built an AI driver safety system using old smartphones that detects vehicles, pedestrians, e-bikes, and bicycles ahead — plus lane departure warnings and driver fatigue detection. Everything runs completely offline. Total hardware cost: basically zero.
The Problem: A Daily 120km Drive We Can't Avoid
Like many factories in Zhejiang, we have our warehouse in Yiwu (the world's wholesale capital) and our production facility about 60km away in Longyou, Quzhou. Every single day, our truck makes the round trip:
- Morning: Raw materials from Yiwu warehouse → Longyou factory
- Afternoon: Finished goods from Longyou factory → Yiwu for shipping
That's 120 kilometers and roughly 3 hours of driving every day, on county roads, highways, and busy urban streets. Our driver does this five or six days a week.
We noticed two big problems:
- Fatigue — After a long day of loading and unloading plus driving, attention drops. A moment of drowsiness can be catastrophic.
- Urban hazards — On county roads and in towns, e-bikes and bicycles appear suddenly from side streets. Pedestrians cross unpredictably. Delivery scooters dart in and out of traffic.
We looked at commercial driver-assistance systems. The ones with collision warnings and lane departure start at $300-500 per vehicle, plus installation and subscription fees. For a small factory like ours, that's a lot of money for one truck.
The Idea: What If We Used Old Phones?
We had a drawer full of old Android phones — previous company phones, personal upgrades, test devices. Most still work perfectly fine; they're just slow by today's standards or have cracked screens.
We realized something: even a 3-4 year old phone has a better camera and more processing power than the dashboard cameras and basic ADAS units you can buy.
So we asked ourselves: could we turn these old phones into an AI driver safety system?
What We Built
We developed an Android app called "Guardian" that runs entirely on a phone mounted on the dashboard. It uses the phone's camera and runs AI models locally — no internet connection required.
🔍 Forward Collision Warning
Using the YOLO (You Only Look Once) object detection model, the system continuously scans the road ahead and identifies:
- Cars, trucks, and motorcycles
- Pedestrians
- E-bikes and bicycles
When something gets too close, the app speaks an alert in real-time: "Vehicle ahead, please keep a safe distance" or "Pedestrian detected ahead."
🛣️ Lane Departure Warning
The app uses computer vision to detect lane markings on the road. If the truck drifts out of its lane without a turn signal — a classic sign of driver drowsiness or distraction — it alerts immediately: "Vehicle drifting left, please correct steering" or "Vehicle drifting right, please correct steering."
😴 Driver Fatigue Detection
Using the phone's front-facing camera (when the phone is mounted properly), the app monitors the driver's face for signs of fatigue:
- Eyes closing for extended periods
- Yawning
- Head drooping
When fatigue is detected, it plays a loud alert sound and voice warning to help the driver stay alert or decide to take a break.
📹 Dual-Mode Dashcam
It also functions as a full dashcam, continuously recording the road ahead. If there's an incident, we have the footage — just like any commercial dashcam, but with AI features on top.
How It Performs on Our Route
We've been running this system on our daily route for several weeks now. Here's what we've found:
What works really well:
- Vehicle detection — Cars and trucks ahead are detected reliably, even at highway speeds. The distance estimation isn't perfect, but it's good enough to give an early warning.
- E-bike and pedestrian alerts — This is the most valuable feature for our route. On county roads and through towns, e-bikes appear suddenly. The system gives our driver an extra split second of reaction time.
- Lane departure — Works best on highways with clear lane markings. It's caught a few instances of drifting that our driver didn't even notice.
- Fatigue detection — Our driver says the alerts in the afternoon have helped him stay more alert. Just knowing the system is watching makes him more conscious of his state.
Limitations we've found:
- Night and heavy rain — Performance drops significantly in low light or bad weather, just like human vision.
- No lane markings — Lane departure doesn't work on roads without painted lines (common on rural roads).
- Phone heat — Running AI models continuously on a hot day can cause the phone to warm up. We added a small vent mount to help with cooling.
- This is an assistant, not autopilot — It's an extra pair of eyes, not a replacement for an attentive driver. We made sure our driver understands this clearly.
"At first I thought it would be annoying — another thing beeping at me. But after a week, I got used to it. There were a couple of times with e-bikes coming out of side streets where the alert came before I even saw them. That's worth it right there."
— Our truck driver, Mr. Wang
What This Cost Us
Here's the best part:
- Phone: Free — we used an old company phone that was sitting in a drawer
- Mount: ~$5 from a local shop
- Charging cable: ~$3
- Software: We developed it ourselves
Total cost: under $10. Even if you had to buy a used phone for $40-50, it's still dramatically cheaper than any commercial system.
Why We're Sharing This
We're a factory, not a tech company. We built this because we needed it ourselves, and we think many other small factories, logistics companies, and individual truck drivers could benefit from the same idea.
The key insight is simple: old smartphones are incredibly capable computers that most people throw away or leave in a drawer. With the right software, they can do jobs that used to require expensive specialized hardware.
For other factory owners or logistics managers reading this:
- Look in your desk drawer — Chances are you have old phones that could be repurposed.
- Start small — Try it on one truck first. See if it helps before scaling.
- Manage expectations — This is a driver assistance tool, not a safety guarantee. It adds a layer of protection, but an alert driver is still the most important safety feature.
Next Steps
We're continuing to improve the system. Some things we're working on:
- Better night performance using the phone's low-light camera capabilities
- Adding a speed sign recognition feature
- Generating daily safety reports showing how many alerts were triggered
- Making the app available for other factories to use
Final Thoughts
As a small factory, we're always looking for ways to improve safety and efficiency without breaking the bank. This AI driver safety system is a perfect example of what's possible when you combine everyday hardware with modern AI tools.
Is it as good as a $1000 commercial ADAS system? No. But for a tiny fraction of the cost, it gives us real, tangible safety benefits on a route our driver travels every single day.
For us, that's a no-brainer.
Have you built something similar for your factory or fleet? We'd love to hear about it — drop us a line through our contact page.