# Intelligent car based on Liangshan School
### 1. Function description
1. Bluetooth remote control: Connect to the mobile phone through the Bluetooth module, and you can control the movement of the
car on the mobile phone. 2. Four-way motor drive: Control the motor through the output of the microcontroller, and the motor drives the wheels. The car moves forward and backward
3. Five-way infrared tracking: detects the black line on the ground through the reflective infrared photoelectric detection tube, so that the car moves along the black line (not implemented)
4. Ultrasonic obstacle avoidance: detects obstacles ahead through the ultrasonic module Object
5. ADC voltage collection: detect battery power
6. Independent button to switch sports mode: the mode button defaults to tracking mode, which can switch obstacle avoidance mode and Bluetooth remote control mode; the start button starts or stops the car
### 2. Hardware
1 .Main control: Based on the Lichuang·Liangshanpai development board, its main control chip is the GD32F450ZGT6 from the domestic GigaDevice Innovation;
2. Motor: TT motor, Mecanum wheel (originally used N20 motor, the merchant issued two is broken);
3. Motor driver chip: RZ7899, which has the advantages of simple control logic, compact chip, and low standby current;
4. Ultrasonic module: HC-SR04 ultrasonic module, which is cheap, simple in principle, and only uses 2 Signal pins, rich information on the Internet, convenient for novices to learn and use the function;
5. Bluetooth remote control module: HC-05 Bluetooth module, suitable for short-distance remote control solutions, easy for novices to use;
6. Battery: 2 14500 batteries
## # 3. Schematic design description
#### The power supply
is on the pcb board because the power supply does not power up the main control, causing my wires to fly
! [image.png]

Motor drive circuit
! [image.png]

Button circuit
! [image.png ]

LED circuit
! [image.png]

Tracking circuit
! [image.png]

Module interface
! [image.png]

ADC voltage acquisition circuit
! [image.png]

### 3. PCB design instructions
1. Board size 100× 100mm
2. The PCB is a 2-layer board
### 4. Debugging part
1. The first two boards were welded with a knife tip. At first I thought it was a welding problem. After connecting the main control and power supply, I realized that I only gave The driver is powered
. 2. It may be that the TT motor speed is too high and the pwn is not easy to control (it turned out that I bought an N20 motor with 300 rpm, but two of the ones sent by the merchant were broken, and it was too late for the merchant to re-deliver the goods. )
Debugging, watch the video below
### 5. Summary:
Hardware is too difficult to learn and follow. I don’t know where the problem is now. When I block the infrared with my hand, it turns off, and when I remove it, it turns on. Put it on the ground and it will either turn off or light up completely, and the potentiometer will also be adjusted. It's so confidence-inspiring!