1. Initial project plan
! [Lenovo screenshot_20230629201008.png]
2. Schematic description
Because the association has a 12V battery, the voltage is reduced to 5V through the voltage reduction module to power the development board and other external devices. ![Lenovo screenshot_20230629201725.png]
Different from the teaching video, I use two-wheel drive and use TB6611 to drive the car.
![Lenovo screenshot_20230629201736.png]
Uses a 3V active buzzer: it has its own oscillation source inside, and the positive and negative poles are connected to the DC voltage to continuously sound, with a fixed frequency.
Because the pin drive capability of the microcontroller is limited and the power of the buzzer is relatively large, it needs to be driven by a transistor. R11 is the current limiting resistor. If the microcontroller pin (BUZZER) is given a low level, the transistor will be turned on, and 3.3v will Supply power to the buzzer to make a sound. If the buzzer is given a high level, the transistor will be disconnected.
![Lenovo screenshot_20230629201746.png]
The infrared tracking circuit is based on the ITR9909 sensor as the core, uses the LM393 comparator to detect the input status, and cooperates with the potentiometer for precision adjustment. The measurement distance is adjustable within the range of 1mm~15mm.
Car tracking generally involves walking along a black line on a white floor, using the reflection of infrared light in different colors for identification. Infrared light is always emitted to the outside. If the bottom of the car is a white floor, the light will be refracted back. At this time, the receiving tube receives the signal and outputs a low level through the comparator, the LED indicator light turns on, and the microcontroller detects the low level; if the car is driving on Around the black line, the infrared light is absorbed by the black color, and the receiving tube cannot receive the emitted signal. At this time, the comparator circuit output is high level, the LED indicator light goes out, and the microcontroller detects the high level. Tracing is actually a process of finding black lines and walking along them.
![Lenovo screenshot_20230629201822.png]
HC-05 Bluetooth serial communication module is a data transmission module based on Bluetooth Specification V2.0 with EDR Bluetooth protocol. The wireless operating frequency band is 2.4GHz ISM, and the modulation method is GFSK. The maximum transmit power of the module is 4dBm, the receiving sensitivity is -85dBm, and the onboard PCB antenna can achieve communication at a distance of 10 meters. The module adopts stamp hole packaging method, and the module size is 27mm × 13mm × 2mm, which is convenient for customers to embed into the application system. It has a built-in LED light to visually determine the Bluetooth connection status. The module uses CSR's BC417 chip and supports AT commands. Users can change roles (master and slave modes) as well as serial port baud rate, device name and other parameters as needed, making it flexible to use.
![Lenovo screenshot_20230629201840.png]
![image.png]
The model of the ultrasonic module is HY-SRF05. It uses five pins to connect to the microcontroller, namely GND, OUT, VCC, Trig and Echo pins. Except for the power pin Feet, only two signal lines are needed to detect the distance of ultrasonic detection of obstacles in front. Compatible with four-legged HC-SR04.
![Lenovo screenshot_20230629201849.png]
![HokEDvwEVmwZi08DOpYNH7XxBng442AIhNuHWFZn.png]
DC 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.
The battery is fully charged at 12V, and we only need 1/5 of it. Then we 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 two 20K and one 10K resistors to divide the voltage, and take 1/3 of the voltage point and connect it to the ADC pin of the microcontroller.
![Lenovo screenshot_20230629201921.png]
3. PCB 3D model
I have reserved four screw holes on the PCB to facilitate the later fixation of the PCB board.
Front
! [Lenovo Screenshot_20230629202012.png]
Back
! [Lenovo Screenshot_20230629202047.png]