## Features
·Bluetooth controls vehicle movement
·Three-wheel structure, 2 power wheels, convenient and flexible control
·OLED displays key information (SPEED upper limit 100) SPEED: speed percentage POWER: power value
·18650 battery pack (7.4V) power supply, Sufficient power
·The car lights can be controlled by Bluetooth
·Two toggle switches (the upper one is the main control circuit switch, the lower one is the motor switch), double insurance to prevent the car from rolling away
·Double indicator lights to clarify the vehicle status
## Full picture
! [WeChat Picture_20230226220609 .jpg]

![1677418850926.jpg]

##
Function Introduction ·Double switch design
![1677418850881.jpg]

In order to prevent the car from rolling due to abnormal conditions, the car has a double switch design.
The upper switch is an electronically controlled switch. When turned on, all power sources except the motor can be turned on, and the power light will light up at the same time
! [Power supply.png]

The power input uses an xt30 interface external battery, and a self-restoring fuse and Schottky diode are added to prevent short circuit and positive Reverse connection of the negative pole may cause circuit damage to the motherboard. The power supply and ground at the motor are connected to other circuits at a single point through a 0 ohm resistor to reduce ripple interference.
![Step-down.png]

Use a double step-down scheme for components with different rated voltages in the circuit. First, the 7.4V battery power is reduced to 5V through the LM2596S switching power supply chip, and then the 5V is reduced to 3.3V through the linear voltage regulator AMS1117.
·ADC power collection
ADC is the abbreviation of analog-to-digital converter (or AD converter). ADC is a device that converts analog quantities into digital quantities. A common application is to convert continuously changing voltage values into digital quantities. The principle is the sampling principle, which can be simply understood as sampling the voltage value at a certain frequency so that the continuous value becomes a discrete value, and a number of digital quantities are obtained.
Using two lithium batteries for power supply, the maximum voltage is 4.2*2=8.4V. However, the reference voltage of the Liangshan School development board is 3.3V and cannot collect 8.4V. Then you need to use resistors to divide the voltage or use an op amp circuit to reduce the voltage. to within the voltage tolerated by the microcontroller. Here we use three 10K resistors to divide the voltage, and take 1/3 of the voltage point and connect it to the ADC pin of the microcontroller.
(Use the formula real-time ADC value - under-power ADC value to get a more intuitive power value, that is, the battery is under-powered when the obtained power value is 0)
![1677418850908.jpg]

·Bluetooth module
![Bluetooth.png]

HC-06 Bluetooth is designed based on Bluetooth 3.0 SPP, which can support Windows, Linux, android data transparent transmission. The working frequency band is 2.4GHZ, the modulation method is GFSK, the maximum transmission power is 8db, the maximum transmission distance is 30 meters, and the user can modify the device name and baud
through AT commands.
Rate and other commands, convenient and flexible to use.
Use HC-06 to send data to the microcontroller with a mobile phone to control movement, headlight switch and other operations, which can realize the core function of the remote control car
and drive module
! [Driver.png]

Use 2 rz7899 to drive two n20 motors using PWM respectively, plus The tail universal wheel can complete flexible movement
! [WeChat picture_20230226223826.jpg]

The motor and the motherboard here are connected using an xt30 connector, which is stable and pressure-resistant
·OLED display
! [QQ screenshot 20230226224925.png]

Display using the i2c protocol Screen. Since the content of displayed information is relatively simple, the i2c protocol can be used. The screen refresh rate is 10hz (100ms interrupt in timer), which is used to display speed, power and other information.
## Postscript
: Press the speed button once to increase the speed by 10 (the upper limit is 100). After the speed reaches 100, press it again to roll back to 10, and so on.
·This physical display is the v2.0 solution. The v1.1 solution has many functions that cannot be used normally due to unreasonable design.
·Because the n20 wheel is too small and the rear universal wheel is too large, causing the body to lean forward, the external tracking module cannot be installed and used normally (the interface is reserved, but after installation, the infrared light will stick to the ground and the line patrol will be abnormal). In the follow-up plan It will be improved
. The buzzer can be used normally. However, since the current version does not have much need for buzzers and OLED is more intuitive, the use of buzzers has not been added to the code.
·There is a five-way switch on the board. The original intention was to use the five-way switch to adjust some parameters. However, due to errors in the early circuit design, the five-way switch could not be used normally. Subsequent versions will be improved.
·There is an RST button on the motherboard for emergencies and for convenient programming and restarting. Because the Liangshan core board is facing down, the reset button on the core board is inconvenient to press.
·Each button has hardware pull-up and hardware debouncing. You can directly ignore the software debouncing when writing the program.
·The ultrasonic module package is reversed and cannot be installed normally.
·There is a DAC audio amplifier on the board that was originally intended for playing music, but a mistake in the circuit design resulted in it not being able to be used properly. Later versions will consider external power amplifier modules instead of onboard ones.
·This version of the battery cannot be placed stably due to its small size. In the future, we will consider using waste cardboard and copper pillars to fix it above the core board.
·There are test points on the board to test whether the voltage of each part is correct.
·An anti-reverse connection diode and fuse are added to the power supply because in the v1.1 version, the reverse connection of the power supply breaks down the entire board.
·The OLED and ADC in the software refer to the Lichuang library
. ·The DAC and motor drive solutions in the hardware refer to the official Lichuang solution
. Therefore, we would like to thank Lichuang for its support.