Website to control robot car using HTML, CSS, and javascript.
The robot car is an Arduino-base with lots of sensors, and IoT devices.
The website has three user roles: controller, viewer, and administrator.
The communication map is: the website sends control data to Firebase cloud messaging over the Internet, the server connected to the same Firebase can get that control data, then send that data to the robot car via Bluetooth. In reverse, the robot car can display the status to the user on the website, which makes up the MQTT communication protocol.
Users can have 3 ways to control the car: buttons, voice recognition, and virtual wheel (computer vision) using Mediapipe javascript.
Video Demo:
I am sorry for the low-quality video because my school requires me to send files smaller than 100MB into the assignment submission. And I am lazy to take another video.
Update: More Web Security and Administrator Role. On the admin page, the user can view the car status table, can change the control page password, can force the user to log out of the control page. More secure on the website where the only way to access the control page is to log in with a password.
Github: https://github.com/Quanghihicoder/Tesla-Ultra-Pro
Thanks!
🛠️ เจาะลึกเบื้องหลังการทำงาน (Deep Dive / Technical Analysis)
A standard robot car drives forward and crashes gracefully. The Tesla Ultra Pro mimics advanced vehicular automation by mounting an HC-SR04 sonar directly onto a constantly sweeping SG90 servo turret atop the roof! The Uno must explicitly maintain the heavy-load differential L298N steering matrices while simultaneously panning the sonar head physically Back-And-Forth like a radar dish to explicitly map spatial geometries and dodge walls before they are reached!
The Multi-Threaded Tracking Problem (Non-Blocking C++)
If you program delay(100) while the Servo turret sweeps left, the loop() completely halts. What happens if the car is driving forward at 5MPH during that 100-millisecond delay? It violently smashes into a chair leg!
- The Tesla Ultra Pro project absolutely forbids standard
delay(). - The programmer must use aggressive
millis()structural arrays to check the Sonar, turn the Servo exactly 1 degree, and check the L298N Motor outputs all completely asynchronously! - The Sonar Geometry Array: As the servo sweeps, it stores data in a massive
int spatialMap[180]array!
// Array mapped 180 degrees. If 90 (Straight Ahead) suddenly drops to 15cm!
if (spatialMap[90] < 15) {
fullStopMechanics();
// Look at the array data... is it clear to the Right (150 degrees)?
if (spatialMap[150] > 50) {
violentlyTurnRight(255); // Maximum PWM power!
} else {
// Both are blocked! Execute absolute emergency reverse mapping!
violentlyReverse(200);
}
}
The L298N Heat & Voltage Spikes
This robotics rig pulls lethal amounts of physical current.
- The Four Massive TT Gear Motors require a dedicated, absolute
12V 4-Amppower supply block (usually three 18650 Lithium batteries). - The
L298Ndriver chip becomes violently hot handling the pulse width modulation switching under extreme torque! - The Arduino Uno is completely isolated electromagnetically! It receives a clean
5Vregulation from the L298N board's internal Buck Converter, completely decoupling the sensitive micro-processor logic from the terrifying electromagnetic spikes of the switching DC motors!
Autonomous Chassis Assembly Needs
- Arduino Uno/Mega (Standard architecture).
- L298N Motor Driver Interface Board (Or L293D Shield, but L298N handles massively more current torque!).
- 4WD TT Gear Motor Robot Base Frame.
- HC-SR04 Ultrasonic Sonar Module mounted securely onto an SG90 Micro Servo Turret.
- Separate Lithium-Ion Battery Matrix. Do NOT use 9V square batteries; their internal resistance is completely incapable of driving four physical geared motors efficiently!