Maker.io main logo

Arduino UNO Q Autonomous RC Car | ArUco Tracking & Navigation

59

2026-10-26 | By zameel shahat

Share

License: Attribution-Share Alike ESP32 Arduino

introduction 

This DIY project uses the Arduino UNO Q and a camera to track the position and heading of an RC car relative to four predefined reference points, then autonomously navigate the car to a target location.

The four reference points are marked with ArUco fiducial markers D0, D1, D2, and D3. A fifth marker, D17, is mounted on top of the RC car. The camera detects these markers, allowing the Arduino UNO Q to estimate the car's position and orientation within the driving area.

An ESP32 controls the RC car's motors and communicates wirelessly with the Arduino UNO Q over Wi-Fi. Based on the camera tracking information, the Arduino UNO Q calculates navigation commands and sends them to the ESP32 to guide the car toward the target location.

Challenges and Lessons Learned

The main challenge in this project was making the camera detect the ArUco fiducial marker reliably while the RC car was moving. During development, I learned that camera settings, lighting, marker design, car speed, and motor control all play important roles in making the system work reliably.

1. Camera Exposure and Lighting
Camera exposure and lighting conditions were two important factors affecting marker detection.The WebUI provides a manual exposure adjustment, which helps me find a suitable setting for the actual lighting conditions. I also found that even lighting across the driving area helps the camera detect the markers more consistently by reducing harsh shadows and uneven brightness.

2. ArUco Marker Size and White Border
Marker size is important because the camera must capture enough detail to detect the marker reliably at the working distance.
I also found that a wider white border around the ArUco marker improved detection in my setup. The white margin helps separate the black marker pattern from the surrounding surface, making the marker easier for the vision system to recognize.

3. Finding the Right Car Speed
The car speed must be suitable for the camera's exposure, lighting conditions, and tracking rate. If the car moves too quickly, motion blur or missed tracking updates can affect navigation.
I used the manual control interface in the WebUI to test different speeds and determine which values worked best with my camera and lighting setup.
Once I found suitable speeds, I set them in navigation.py:

AUTO_TURN_SPEED = 10
AUTO_FORWARD_SPEED = 10

These are example values; adjust them to match the results of your own tests.

Safety feature: The navigation controller is also configured to send a STOP command when valid tracking updates are lost beyond the configured timeout. This helps prevent the car from continuing to move using outdated position information.

4. Stopping the Four Servo Motors
The RC car uses four servo motors for movement. During development, I initially tried to stop the car by setting the servo angle to zero in the ESP32 sketch.
However, I found that setting all four servos to zero did not produce a sufficiently stable stop in my setup. I therefore chose to detach all four servos to stop sending their control signals.
This approach worked better for my project than relying on the zero-angle setting.


5- Power Supply Upgrades and Troubleshooting
My first version of the car ran from two 3.7 V 800 mAh Li-ion batteries feeding a 5 A adjustable DC-DC buck converter set to 5 V. The car worked, but now and then it ignored commands.
I replaced the power setup with a KBT 5 V 8 Ah rechargeable battery, and the car's response improved noticeably, with no more commands being ignored.

Parts

1- Arduino UNO Q

2- EMEET C950  4K Webcam

3- Arduino USB-C HUB

4- 3D-printed base for the UNO Q, camera, and USB-C hub

5- 3D-printed car base 

6- ESP32

7- 4 servo motors (Feetech FS90R 360 Degree Continuous Rotation)

8- KBT 5 V 8 Ah rechargeable battery,

9- 4 LEDs 

10- 4 resistors 

11- USB power supply 

Connection and assembly

1- Arduino UNO Q and camera
For building and testing this app, I will use a network connection to the Arduino UNO Q. The UNO Q will be connected to a USB-C hub, with the webcam connected to the hub.
     The hub is powered by a USB power supply. As shown in the following photo. I used a 3D-printed base to hold all the parts and use it to   
    support it in a camera tripod. See the following photos for the base and the connection.

Arduino UNO Q connection

2- RC Car
* the following is the schematic for the electrical components of the RC car

RcCarWiring

  • The following is the car base assembly

CarBaseAssy

  • The following is the car assembly

Car Assy

power supply and control

  • The Arduino UNO Q and the camera are powered from the USB HUB. The USB HUB
     powered by a USB power supply (see the photo in the connection and assembly)
    The UNO Q uses the USB HUB to control the camera, get access to the image, and use it to locate the position of the fiducial marker and calculate the RC car position.

  • The RC car has 2 rechargeable 3.7-volt batteries connected in series (6.4V). A switch in the back of the car will turn OFF and ON the power from the batteries to the DC-to-DC buck converter. 
    The buck converter supply the 5 DC V to the servo motors and the ESP32.
    The ESP32 receives the command by WiFi from the UNO Q and sends the control signal to the servo motors and the LEDs.   

Software

you can find all software file at https://github.com/electronicsmagic/Autonomous-RC-Car 

A-  The Arduino UNO Q application
is organized into a main Python program, supporting Python modules, and WebUI frontend assets. Each file handles a specific part of the autonomous RC car system.
1. Python Application
1-1 main.py — Main Application
The main entry point of the application. It initializes the camera, WebUI, calibration system, ArUco tracker, car controller, and navigation controller, then starts the application.
1-2 config.py — Configuration
     Contains the application's configurable parameters, such as camera resolution, camera device,  
     ESP32 network address, and navigation-related settings.
1-3 aruco_tracker.py — ArUco Tracking
Uses OpenCV to detect ArUco markers D0–D3 for calibration and D17 on the RC car for tracking. It estimates the car's position and heading and provides this information to the WebUI and navigation controller.
1-4 navigation.py — Autonomous Navigation
Calculates the direction and distance to the target location. It determines when the car should turn, move forward, or stop based on the tracked position and heading.
1-5 car_control.py — RC Car Control
Handles communication with the ESP32 over Wi-Fi and sends commands to control the RC car's movement and speed.
1-6 camera_settings.py — Camera Configuration
Configures the camera settings used by the application, including exposure and focus. It helps establish suitable camera settings for reliable ArUco marker detection.

2. WebUI Frontend Assets
2-1 index.html — Web Interface
Defines the structure of the webpage, including the camera display, manual driving controls, and autonomous navigation interface.
2-2 app.js — Web Interface Logic
Handles webpage interactions and communication with the Python application, including sending user commands and displaying camera tracking information.
2-3 style.css — Web Interface Styling
Controls the appearance of the webpage, including layout, spacing, colors, fonts, and the presentation of interface elements.

B- Esp32 sketch
1- The ESP32 connects to the home Wi-Fi network and obtains an IP address from the router. The Arduino UNO Q uses this IP address to send HTTP commands to the ESP32 to control
the RC car's 4 continuous-rotation servo motors and four LEDs.

2- The ESP32 sketch also hosts a web page that can be accessed through the same IP address using a web browser. This interface allows the user to control the RC car's direction and adjust its speed manually.

WebMotorControl

3- A separate servo calibration web page is also provided to adjust and test the stop position of each of the four servo motors.

WebMotorCalibration

Setup

A- EPS32 setup

1- Power from USB only. Disconnect
the battery, then connect the ESP32 to your computer with a USB cable. Never connect USB and battery power at the same time, because the two supplies can feed current into each other.
2- Enter your Wi-Fi details and upload.

WiFiSSD


In the sketch, replace the Wi-Fi name and password in the two lines at the top. In the Arduino IDE, select your ESP32 board and port, then upload the sketch.
3- Find the IP address.

ESP32Monitor


Open the Serial Monitor (115200 baud). The ESP32 prints its IP address once it connects. If nothing appears, press the EN (reset) button on the board. Write the address down, because the UNO Q app needs it too.
It's also worth reserving this address for the ESP32 in your router settings so it never changes.
4- Switch to battery power.
Unplug the USB cable and turn on the battery power. Put the car on a stand so the wheels are off the ground.
5- Test the car.
On a phone or computer connected to the same Wi-Fi, open http://<IP address>/ in a browser. Press each button and check that the car responds correctly.
6- Calibrate the servos.
Open http://<IP address>/calibration. Move each slider until that wheel stops completely, and write down the number for each servo. The value is usually near 90, but it is different for every servo.
7- Put the numbers in the sketch.
The calibration page only holds the numbers in memory, so they are lost when the ESP32 restarts. Replace the four SERVO_STOP_... values in the sketch with the numbers you found.
8- Upload again.
Repeat step 1 (battery disconnected, USB connected) and upload the sketch with the new numbers.
9- Final check.
Unplug the USB cable and turn on the battery power. Check that the wheels stay still when stopped and that the car drives straight at low speed. If it drifts, repeat from step 4.

B — Arduino UNO Q Setup

1- Before starting the system, open config.py on the Arduino UNO Q and configure the following parameters:
Enter the IP address of the ESP32 that controls the RC car.
Set the width (X dimension) and height (Y dimension) of the area in which the car will operate.

ConfigData


For my setup, the operating area is 5 × 7 feet.
Make sure the IP address matches the ESP32's current network address and that the X and Y dimensions match the physical area where the reference markers will be placed.

2. Print the ArUco Markers
Generate and print five ArUco markers using the ArUco Marker Generator:
D0, D1, D2, and D3: Reference markers used to calibrate the operating area.
D17: The marker used to track the RC car's position and orientation.
Select the 4×4 ArUco dictionary with 50 markers (DICT_4X4_50) to match the dictionary used by the tracking software.
Print the markers clearly, with good contrast between the black pattern and white background. Leave a white border of approximately 15–20 mm around each marker, as in my setup. Keep the printed markers flat and ensure that the marker patterns are not stretched or distorted.

3. Position the Markers
Place the four reference markers at the corners of the operating area:
D0: Origin, at coordinates (0, 0).
D1: X-axis corner, at coordinates (X dimension, 0).
D2: Opposite corner, at coordinates (X dimension, Y dimension).
D3: Y-axis corner, at coordinates (0, Y dimension).
Attach marker D17 securely to the top of the RC car. Keep its orientation consistent so that the tracking software can determine which direction is the front of the car.
Once the markers are positioned, the UNO Q camera can detect the reference markers during calibration and use D17 to track the moving car.


The following displays the position of the camera and the marker 

FullSetup

Run the app

1. Launch the app and adjust the camera
Click Run in the top-right corner of the Arduino App. The app will open a webpage displaying the RC car control dashboard.
Adjust the camera exposure in the camera controls until the ArUco markers are clearly visible.
2. Test manual control
In the RC Car Manual Control section, use the movement buttons to check that you can control the car correctly. Verify that the car moves in the expected directions and stops when you click Stop.
3. Calibrate the operating area
Follow the Four-Step Calibration procedure on the webpage. Once calibration is complete, the dashboard will display the car’s estimated position in the operating area.

CalibrationDone


4. Start automatic navigation
In the Automatic Navigation section, enter the desired target position (X and Y coordinates), then click Go to Target.
The car will attempt to navigate to the specified position. See the demo video for a demonstration of automatic navigation.

Número de parte del fabricante ABX00173
ARDUINO UNO Q 4GB RAM 32GB EMMC
Arduino
$79.00
Ver más Details
Número de parte del fabricante 2442
SERVOMOTOR RC 130 RPM 5V
Adafruit Industries LLC
Número de parte del fabricante TPX00241
8 IN 1 USB-C DONGLE (ARDUINO BRA
Arduino
$20.64
Ver más Details
Add all DigiKey Parts to Cart
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.