a6Vva2W7

Intelligent cars based on the Liangshan School

 
Overview
1. Schematic Design:
The schematic includes expansion board pin interfaces, power input, buttons and headlight indicators, buzzer, light intensity detection, Bluetooth and remote control modules, ultrasonic module, line-following circuit, motor drive, and N20 motor assembly. Interfaces for a camera module and a 0.96-inch LCD screen are also reserved.
2. PCB Design:
Due to the numerous interfaces, especially the large number of sensor modules in the front half of the car, there are many circuits that need to be arranged rationally.
3. Software Design:
The software design mainly includes writing driver programs and obstacle avoidance, line-following, and remote control programs.
3.1. Driver Program Writing:
The driver program includes the initialization of LEDs, buttons, buzzer, motor, ultrasonic module, ADC, serial port, and Bluetooth serial port. Special attention needs to be paid to the initialization of the motor and Bluetooth modules.
During motor initialization, attention must be paid to the pin configuration (ensuring that the MCU pins connected to the RZ7889's forward/reverse pins can function as a Timer's PWM function).
During Bluetooth module initialization, it's crucial to distinguish it from the inherent serial port of the Liangshanpai (a mobile communication platform) and write the Bluetooth serial port callback function.
3.2. Obstacle Avoidance Function Development:
When the car enters obstacle avoidance mode, the ultrasonic module at the front of the car will detect the distance to obstacles in real time. If the distance between the detected obstacle and the car is less than 10cm, the car will activate its buzzer and turn left to avoid the obstacle.
3.3. Tracking Function Development:
The tracking function determines the car's movement based on the status of the five infrared modules at the front of the car. For example, if one or three of the middle modules detect a black line, the car will move straight; if the middle and slightly left-middle modules detect a black line, the car will veer slightly to the left; if the leftmost infrared module detects a black line, the car will turn sharply to the left.
Partial code implementation is as follows:
3.4. Remote Control Function Development
Before writing the remote control code, a corresponding Bluetooth APP needs to be designed.
Open the webpage http://app.gzjkw.net/, first design the screen component ,
then design the background program.
Its operating principle is that pressing the relevant button on the APP sends relevant byte numbers to the Bluetooth module on the car, and determines the car's operation mode based on the sent numbers.
The code implementation is as follows:
4. Final Implementation
Due to motor stall, an RZ7889 chip was burned out, and the car's movement could not be achieved. However, before it was burned out, the obstacle avoidance, line tracking, and remote control functions were successfully implemented.
5. Some Thoughts and Gains
This project has given me a comprehensive and in-depth understanding of electronic design. I encountered many difficulties and questions, but also gained a lot. I am recording them here so that experts and my future self can solve them.
Some takeaways and warnings

: When designing schematics, always refer to the chip datasheet frequently and use the pin multiplexing function correctly (I wasted a board because I didn't understand the multiplexing function correctly).
If speed is not the priority, the reduction ratio of the N20 motor should be selected as 1:200-1:300. My motor was selected as 1:97, resulting in low torque, which easily leads to stalling (in the software design, setting the motor speed below 40 will cause the motor to stall). The motor current will increase significantly when stalled, which I believe is the reason my RZ7889 burned out.
Sensors should be adapted to the usage scenario. Because my motor rotates at a high speed, the obstacle avoidance design often results in the car hitting obstacles before the ultrasonic sensor can react in time. This shows that the sensor's sensitivity, sampling rate, and software design are closely related to the product's operating environment and state .

Some questions

arise regarding the car's left front and left rear wheels, which rotate continuously during the Keil program download to the MCU, and briefly rotate upon power-on, accompanied by a flashing LED and a short buzzer sound. For the former, I believe the waveform during download might be a PWM wave, entering the motor circuit through voltage inductance, causing the motor to rotate. For the latter, I think it could be a momentary power-on; due to the motor's inductive nature, it might power on and start before the MCU officially starts, affecting the LED and buzzer, until the inductor releases energy and the motor stops rotating.
Is the remote control module design redundant? The sample program doesn't seem to include this module.

6. In summary,
this project is like a small product, requiring a significant amount of effort in circuit design, soldering, and software debugging. I hope that no matter how complicated the design process becomes, I can stay calm and complete the design step by step. I also hope that I will have the opportunity to further improve this car, including optimizing the motor and implementing the driving of the camera and LCD screen.
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2026-03-26 19:24:57
  • How's this summer going?
  • Does anyone need this kind of screen?
  • A newbie would like to ask about the CD burning software?
  • How does a newbie build a GPS positioning rescue system?
  • EEWORLD University Hall----Mentor PADS VX2 four-layer router
  • Send a crack of mdk

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号