Skip to content

This application features an advanced autonomous RC car powered by the PIC32CZ CA90 microcontroller, offering real-time LiDAR navigation, live camera streaming, precise control, manual override, Wi-Fi monitoring, and on-board display.

License

Notifications You must be signed in to change notification settings

microchip-pic-avr-solutions/pic32cz8110ca90208-cult-smart-rc-car-mplab-mcc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microchip Technologies Inc.

Autonomous Navigation: Smart RC Car With Obstacle Avoidance

Introduction

This application demonstrates a comprehensive system for controlling and autonomously navigating a 4WD RC car. The vehicle can be operated manually via an RC receiver or can navigate autonomously using data from a 360-degree LiDAR sensor, which enables real-time obstacle detection and path planning. The car is also equipped with an Serial Peripheral Interface (SPI) based ArduCAM® MEGA camera module for image capture and a 9DOF 3 Click board™ used as an Inertial Measurement Unit (IMU) for collecting motion and orientation data.

All sensor data—including live images from the camera, LiDAR readings, and IMU data—are transmitted wirelessly to a PC using a TCP server-client communication protocol. This allows the PC to receive and process real-time visual, spatial, and motion information from the vehicle. The system provides a robust platform for developing and testing advanced navigation algorithms, remote control solutions, sensor integration, and wireless data transmission techniques in mobile robotics applications.

Smart RC Car
Figure 1. Smart RC Car

System Block Diagram
Figure 2. System Block Diagram

Modules/Technology Used

  • Peripheral modules

    • PORT
    • SYSTICK
    • SERCOM1 - UART
    • SERCOM2 - SPI
    • SERCOM3 - SPI
    • SERCOM4 - UART
    • SERCOM5 - I2C
    • TCC0
    • TCC9
    • EIC
    • EVSYS
  • Drivers

    • I2C
    • SPI
    • USART
  • Wireless

    • WINCS02
    • RNWF WINCS Wi-Fi Service
    • RNWF WINCS NET Service
  • System Services

    • Time
    • CONSOLE
    • DEBUG
  • Middleware libraries

    • Harmony Core

Project Graph
Figure 3. Project Graph

Related Documentation

Software Used

Hardware Used

Software Setup

Run the requirements Python file in the command prompt to install the required packages needed for the Graphical User Interface.

Software Setup
Figure 4. Software Setup

Hardware Modification

Remove the Universal Asynchronous Receiver and Transmitter (UART) series resistors (R215 and R220) on the WINCS02 Add-on Board.

WINCS02 Setup
Figure 5. WINCS02 Setup

Hardware Setup

  1. Attach the WINCS02 Add-on Board to the mikroBUS™ Extension of the PIC32CZ CA90 Curiosity Ultra development board.

    WINCS02 Add-on Board Connection
    Figure 6. WINCS02 Add-on Board Connection

  2. Place the custom Arduino® shield board onto the Arduino® extension of the PIC32CZ CA90 Curiosity Ultra development board.

    Custom Arduino® Shield Board Mounting
    Figure 7. Custom Arduino® Shield Board Mounting

    Note: The Gerber file and schematic for the custom Arduino® shield are available in the design_files folder.

  3. Attach the 9DOF 3 Click to the mikroBUS™ Extension of the Arduino® shield board.

    9DOF 3 Click Board™ Connection
    Figure 8. 9DOF 3 Click Board™ Connection

  4. Feed the PWM signals from the board to the Motor Driver as per the following table:

    Table 1. Motor Driver Pinouts

    Output Pin Motor Driver Pin
    OUT0 M1A and M2A
    OUT1 M1B and M2B
    GND GND

    Motor Driver Pinouts on Arduino® Shield
    Figure 9. Motor Driver Pinouts on the Arduino® Shield

    Motor Driver Pinouts
    Figure 10. Motor Driver Pinouts

  5. Connect the Steering Servo motor to the PWM output (OUT2) as per the following table:

    Table 2. Servo Motor Pinouts

    Output Pin Servo Motor Pin
    OUT2 PWM
    VCC VCC
    GND GND

    Servo Motor Connection
    Figure 11. Servo Motor Connection

  6. Use 5V via the excess power header in the PWPulse-Width Modulation (PWM) outputs.

    Power Input
    Figure 12. Power Input

  7. Attach the LiDAR module to the PIC32CZ CA90 Curiosity Ultra development board using the LiDAR connector.

    LiDAR Module Connection
    Figure 13. LiDAR Module Connection

  8. Use the PPM Input connector (fourth header) for the RC receiver Pulse Position Modulation (PPM) output as per the following table:

    Table 3. RC Receiver Pinouts

    Input Pin RC Receiver Pin
    PIN 4 PPM
    VCC VCC
    GND GND

     Pulse Position Modulation (PPM)PPM Input Connector
    Figure 14. Pulse Position Modulation (PPM) Input Connector

  9. Attach the OLED display to the PIC32CZ CA90 Curiosity Ultra development board using the GFX connector.

    OLED Display Connection
    Figure 15. OLED Display Connection

  10. Connect the ArduCAM® MEGA camera module to Extension 1 of the PIC32CZ CA90 Curiosity Ultra development board using the GFX connector as per the following table:

    Table 4. ArduCAM® Camera Module Pinouts

    EXT1 Pin ArduCAM® Camera
    PIN16 MOSI
    PIN18 SCK
    PIN15 CS
    PIN17 MISO
    PIN20 VCC
    PIN19 GND

    ArduCAM® Camera Module Connection
    Figure 16. ArduCAM® Camera Module Connection

How to Program the Hex File

The pre-built hex file can be programmed by following the below steps:

  1. Open MPLAB® X IDE.
  2. Close all existing projects in IDE, if any project is opened.
  3. Go to File>Import>Hex/ELF File.
  4. In the Import Image File window, in the Step 1 - Create Prebuilt Project section, click the Browse button to select the prebuilt hex file.
  5. Choose PIC32CZ8110CA90208 under Select Device.
  6. Ensure the proper tool is selected under Hardware Tool.
  7. Click on Next button.
  8. In the "Import Image File" window, Step 2 - Select Project Name and Folder, select appropriate project name and folder.
  9. Click the Finish button.
  10. In MPLAB® X IDE, click the Make and Program Device button to program the device.
  11. Follow the steps in the Running the Demo section below.

Running the Demo

  1. Before running the GUI application, ensure the steps Software Setup section have been executed.
  2. Run the Smart_RC_Car_GUI application in the scripts folder and the GUI application will open as shown below.

Smart RC Car GUI
Figure 17. Smart RC Car GUI

  1. Get the IP address of the RC car from the OLED display and enter it in the TCP Server Details. Make sure the RC car and PC are in the same network.

Wi-Fi Connection Setup
Figure 18. Wi-Fi Connection Setup

  1. Make sure the RC transmitter's joysticks and switches are in the default position, as below.

RC Transmitter Default Position
Figure 19. RC Transmitter Default Position

  1. Turn on the RC transmitter by flipping the power switch as shown below.

RC Transmitter Power Up
Figure 20. RC Transmitter Power Up

  1. Power on the RC car by flipping the toggle switch on the right side of the RC car. Make sure the battery voltage is above 9V.

RC Car Power Up
Figure 21. RC Car Power Up

  1. Wait for the status message of the RC car on the OLED display (left side of the RC car).

RC Car Start-up Status
Figure 22. RC Car Start-up Status

  1. The connection status will show in the OLED display.

Connection Status (Not Connected)
Figure 23. Connection Status (Not Connected)

  1. Once it is connected, use the Connect button for receiving the telemetry data of the Smart RC Car.

Telemetry Data Connection
Figure 24. Telemetry Data Connection

  1. The telemetry connection status will be displayed in the OLED display and the RC car will be ready once the system goes online.

Connection Status (Connected)
Figure 25. Connection Status (Connected)

  1. The OLED display also shows the disconnection of the telemetry data.

Telemetry Disconnection Status
Figure 26. Telemetry Disconnection Status

  1. Select the Lidar option in the drop-down menu of the TCP Client Details section, and the IMU, Motor and LiDAR data will appear after the Receive command from the GUI.

Image Preview in GUI
Figure 27. Image Preview in GUI

Note: Use the Stop button to stop the data transfer.

  1. Select the Lidar option in the drop-down menu in the TCP Client Details, and the IMU, Motor and LiDAR data will appear after the Receive command from the GUI.

LiDAR Data Preview
Figure 28. LiDAR Data Preview

Note: Use the Stop button to stop the data transfer.

  1. The user can control the RC car manually by moving the joysticks in the RC transmitter.

Manual RC Car Control
Figure 29. Manual RC Car Control

  1. User can view the LiDAR data in real time as a 360° map while the RC car is in motion.

Real-time LiDAR Map
Figure 30. Real-Time LiDAR Map

  1. The user can choose between Manual or Autonomous modes by flipping the channel 7 toggle switch in the RC transmitter.

Mode Selection (Manual/Autonomous)
Figure 31. Mode Selection (Manual/Autonomous)

Note: User can remotely RESET the RC Car by moving the joysticks to the specified location on the RC transmitter as shown below.

Remote Reset via RC Transmitter
Figure 32. Remote Reset via RC Transmitter

Pin Descriptions

  • OLED display I/Os:

    Table 6. OLED I2C Pins

    Port Pin Shield Pin Pin Functionality Peripheral Used
    PC25 D14 SDA SERCOM5-PAD0
    PC26 D15 SCL SERCOM5-PAD1
  • WINCS02 Add-on Board I/Os:

    Table 7. WINCS02 Module SPI and I/O Pins

    Port Pin mikroBUS™ Pin Pin Functionality Peripheral Used
    PC12 MOSI MOSI SERCOM3-PAD0
    PC13 SCK SCK SERCOM3-PAD1
    PC14 CS CS SERCOM3-PAD2
    PC15 MIS0 MIS0 SERCOM3-PAD3
    PA08 INT IRQ EIC-EXTINT8
    PB27 RST RESET GPIO
  • LiDAR module I/Os:

    Table 8. LiDAR Module UART and I/O Pins

    Port Pin Shield Pin Pin Functionality Peripheral Used
    PG10 D8 ENABLE GPIO
    PC21 D1 TXD SERCOM4-PAD0
    PC22 D0 RXD SERCOM4-PAD1
  • Motor control I/Os:

    Table 9. Motor Control PMW Pins

    Port Pin Shield Pin Pin Functionality Peripheral Used
    PG05 D3 PWM TCC9_WO0
    PG06 D2 PWM TCC9_WO1
    PG07 D4 PWM TCC9_WO2
    PG09 D7 PWM TCC9_WO3
  • RC Receiver Pulse Position Modulation (PPM) I/O:

    Table 10. RC Receiver Pulse Position Modulation (PPM) Pin

    Port Pin Shield Pin Pin Functionality Peripheral Used
    PB11 D9 IRQ TCC0 and EXTINT11
  • Camera module I/Os:

    Table 11. Camera Module SPI Pins

    Port Pin EXT1 Pin Pin Functionality Peripheral Used
    PC08 PIN16 MOSI SERCOM2-PAD0
    PC09 PIN18 SCK SERCOM2-PAD1
    PC10 PIN15 CS GPIO
    PC11 PIN17 MISO SERCOM2-PAD3
  • Serial console I/Os:

    Table 12. Serial Console UART Pins

    Port Pin Pin Functionality Peripheral Used
    PC04 TX SERCOM1-PAD0
    PC07 RX SERCOM1-PAD3

Conclusion

The Smart RC Car with Autonomous Navigation and Obstacle Avoidance integrates advanced sensors, wireless communication, and real-time control on Microchip’s PIC32CZ CA90 platform. Featuring LiDAR, camera, IMU, and wireless telemetry, this project establishes a robust foundation for research and development in autonomous vehicles, robotics, and sensor fusion. Its modular hardware and software architecture enables straightforward customization and expansion, making it well-suited for mobile robotics and autonomous vehicles. This flexibility supports complex navigation and controls challenges in real-world environments.

About

This application features an advanced autonomous RC car powered by the PIC32CZ CA90 microcontroller, offering real-time LiDAR navigation, live camera streaming, precise control, manual override, Wi-Fi monitoring, and on-board display.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages