Robots-For-All (IEEE - HI)

Freenove 4WD Car Software Support

The Freenove 4WD Car is supported by the following Robots For All libraries:

Freenove 4WD Car Hardware

The Freenove 4WD Car uses an ESP32 as the microcontroller for the car. The ESP32 is part of the FNK0060 module. The following is a simplified schematic of the system:

   +---------+
   |         |                         +3.3 V
   |         |                           |
   |         |                           \
   |         |                           /
   |         |                           \
   |         |                           /
   |         |GPIO 33                    |
   |         |<--------------------------+ Photo Resistors (Light Sensors)
   |         |                           |
   |         |GPIO 2                     \
   |         |----+----> Buzzer          /
   |         |    |                      \
   |         |    `----> Blue LED        /
   |         |                           \
   |         |GPIO 12                    /               Battery +
   |  ESP32  |---------> Ultrasound TX   +--- Ground        |
   |         |                                              \
   |         |GPIO 15                                       / 3K
   |         |<--------- Ultrasound RX (Echo)               \
   |         |                                              /
   |         |GPIO 32                                       |
   |      A0 |----------------------------------------------+--> WS2812 LEDs
   |         |                                              |
   |         |GPIO 0                                        \
   |         |<--------- IR Sensor                          / 1K
   |         |                                              \
   |         |GPIO 13                                       /
   |         |<--------> I2C SDA <---+---> OV2640 Camera    +------ Ground
   |         |                       |
   |         |---------> I2C SCL --->+---> VT16K33 LED Matrix controller
   |         |GPIO 14                |
   |         |                       +---> PCF8574 GPIO Extender
   |         |                       |        |
   |         |                       |        +---> 0: Left line sensor
   |         |                       |        |
   |         |                       |        +---> 1: Center line sensor
   |         |                       |        |
   |         |                       |        +---> 2: Right line sensor
   |         |                       |        |
   |         |                       |        +---> 3:
   |         |                       |        |
   |         |                       |        +---> 4:
   |         |                       |        |
   |         |                       |        +---> 5:
   |         |                       |        |
   |         |                       |        +---> 6:
   |         |                       |        |
   |         |                       |        +---> 7:
   |         |                       |
   |         |                       |
   |         |                       +---> PCA9685 -->+---> 0: Pan Servo
   |         |                                        |
   |         |                                        +---> 1: Tilt Servo
   |         |                                        |
   |         |                                        +---> 2:
   |         |                                        |
   |         |                                        +---> 3:
   |         |                                        |
   |         |                                        +---> 4:
   |         |                                        |
   |         |                                        +---> 5:
   |         |                                        |
   |         |                                        +---> 6:
   |         |                                        |
   |         |                                        +---> 7:
   |         |                                        |
   |         |                                        +---> 8: M2_In2
   |         |                                        |
   |         |                                        +---> 9: M2_In1
   |         |                                        |
   |         |                                        +---> 10: M4_In1
   |         |                                        |
   |         |                                        +---> 11: M4_In2
   |         |                                        |
   |         |                                        +---> 12: M3_In1
   |         |                                        |
   |         |                                        +---> 13: M3_In2
   |         |                                        |
   |         |                                        +---> 14: M1_In1
   |         |                                        |
   |         |                                        +---> 15: M1_In1
   +---------+

GPIO Usage

microSD Card

The microSD card slot is uses the following GPIOs:

Unable to use the microSD card when using the ultrasonic sensor since both the ESP32 needs to drive the CMD line (GPIO15) for the microSD card and the RX ultrasonic sensor is driving GPIO15..

It is possible to use the microSD card if the ultrasonic sensor is not connected. A semaphore is needed to select access to either the microSD card or the I2C bus. When the microSD card is in use, the GPIO pins need to be assigned to the SD controller. When the microSD card is not in use, GPIO2 and GPIO15 needs to be set as a GPIO outputs, and GPIO14 needs needs to be set to the I2C controller.