#### **Description** This
is the hardware and software design of the initial version of the car and remote control. There is still a lot of room for improvement in the hardware part, and there are still many functions that have not been implemented in the software code. Currently, only the wireless remote control and some basic device driver codes have been written. There is still a lot to be improved. You are welcome to criticize and correct me!
The codes and demonstration videos of the car and remote control are given in the attachment (the comments are encoded in UTF8)
#### **Actual pictures**
![DD46026D48809AB59E0BAFBEE44AE720.png]
![F9192333C72F04BAD025D44D6791A2AC.png]
![418C14A214B7805FAB58B6A4AE4EA4FF.png]
![93EF164699441AD21E78A811E422DC4B.png]
![11.png]
![11 (2).png]
#### **Hardware part**
##### 1. Tracking circuit
! [NQEH74YWE4E~4V7(VM2LI.png]
The tracking sensor uses ITR9909, and the tracking circuit uses analog tracking. According to the different color depths of the ground, the three infrared tracking sensors will return voltages of different sizes. The microcontroller can determine the relative position of the car and the track by reading the output voltage. With the PID algorithm, the car can track smoothly.
##### 2. Motor drive circuit
! [`@FOBYXDH7T{F`HVJXZ`V4D.png]
The motor drive chip uses L9110S, which is cheap and more than enough to drive the N20 motor. L9110S itself does not have a PWM speed control port. By adding two NPN transistors to the circuit, the collector interface of the transistor can be used as a PWM speed control interface. By controlling the collector port level, the emitter output of the transistor can be controlled, thereby achieving the effect of PWM speed control. The IO port connected to the base of the two transistors controls the direction of the motor.
##### 3. Remote control power supply circuit
![FG345I1{I9MD{}2@01JNIV.png]
The power supply of the remote control is 3.7V lithium battery. The lithium battery charging and discharging function is realized through the cooperation of TP4056 and peripheral circuits. When 5V input is detected, Q1 is turned off, the circuit is powered by the external 5V power supply, and the lithium battery enters the charging state. When there is no external power input, Q1 is turned on, and the circuit is powered by the lithium battery. The
output end of the lithium battery leads to a voltage sampling resistor to facilitate the detection of battery voltage. When the battery is charging, the red light on the upper right of the remote control lights up. When it is fully charged, the red light goes out and the green light lights up.
##### **4. Other circuits**
(1) The car and the car remote control are designed with buttons, display interfaces, and LED lights to facilitate the expansion of functions according to needs.
(2) The car and the car remote control are designed with NRF24L01 interface and HC-05 interface to facilitate the realization of 2.4G remote control and Bluetooth remote control functions.
(3) The remote controller is equipped with a rocker potentiometer (left over from the last game console training camp, haha, making full use of it), which can be used to control the movement of the car very smoothly (see the demonstration video).
(4) The car is equipped with an ultrasonic sensor and a 3mm LED, which can realize obstacle avoidance and night lighting.
(5) The remote controller is integrated with the Liangshan School DAPLINK download port, so there is no need for multiple downloaders. One downloader can complete the download and debugging of the car + remote controller.
B station link: https://www.bilibili.com/video/BV1Ha4y1A72d/?vd_source=9b76f3726233435e83b31ce2432e4258
#### **Software part**
The attached software code has detailed comments and can be cut or added functions according to needs.
#### **Written in the end**
Overall, I am quite satisfied with the car this time, but there are still many areas for improvement. An improved version will be released later. I would like to thank LiChuang again for giving me this opportunity. The service is comprehensive and the answers to my questions are careful. I will release more high-quality open source projects in the future. Thank you LiChuang!