**1. Introduction**
A smart car is an advanced system that integrates automatic control, environmental monitoring, and wireless remote control. It is commonly referred to as a mobile wheeled robot. Currently, mobile robots that use a single-chip microcontroller as their core still face limitations in data processing and unstable control performance. As a result, the domestic market has not yet seen a truly reliable smart carrier trolley. This design combines a single-chip smart car ranging module, an infrared remote control module, and a trolley intelligent control module. Through hardware and software development and debugging, the system achieves automatic following functionality. The ultrasonic ranging module is used for real-time distance detection between the car and its target. When the distance becomes short, the car will slow down and follow. Once the distance increases, it will accelerate until it catches up with the target. Additionally, the car can turn around when necessary and avoid continuous following.
**2. Hardware Design**
**2.1 Overall System Design**
To achieve intelligent following, this system incorporates modules such as ultrasonic ranging, motor drive, and infrared remote control. By measuring the distance using ultrasonic waves, the car determines whether to move forward quickly or slowly. The STM32 microcontroller serves as the main control unit. After calculating the distance from two ultrasonic sensors, it outputs PWM signals to regulate the speed of the two motors. The power supply provides electricity to both the control and motor driver sections. In addition, the STM32 is connected to an LCD display module and an infrared receiver to show motion status and receive remote control signals. The overall system design is illustrated in Figure 1.
Figure 1: System Overview
**2.2 Ultrasonic Ranging Module** Ultrasonic waves are sound waves with frequencies above 20kHz. They reflect, diffract, and refract when they encounter different interfaces, making them widely used in various industries. The HC-SR04 ultrasonic module is used in this design. It has a measuring range of 3 to 400 cm and a precision of up to 3mm. The module consists of a transmitting probe, a control circuit, and a drive circuit. It has four external pins: VCC, GND, TRIG, and ECHO. To perform ranging, the TRIG pin must be triggered with a high-level signal of at least 10μs. The module then sends out 8 pulses of 40kHz square waves and detects if there is a return signal at the ECHO pin. The duration of the high level at ECHO represents the time the ultrasonic wave traveled. Using this, the distance can be calculated as (high time × speed of sound) / 2. Therefore, the VCC and GND pins are connected to the system power supply, while TRIG and ECHO are connected to the microcontroller’s general-purpose I/O ports for distance measurement. **2.3 Motor Drive Module** The L298N motor driver module controls the movement of the trolley by driving the left and right motors. The motor speed is regulated using PWM, which adjusts the duty cycle of the DC motor's armature voltage to change the average voltage, thereby controlling the motor speed. In addition to the PWM signals for each motor, the module also requires four logic inputs to control the direction of motor M1 and M2. The connections are shown in Figure 2. The PWM signal input is connected to the microcontroller’s timer output, while the logic input is connected to the I/O port in output mode to control the module.Figure 2: Motor Driver Module Connection
Dell latitude 3310,dell 3310,dell latitude 3310 keyboard,dell latitude 3310 LCD
S-yuan Electronic Technology Limited , https://www.syuanelectronic.com