Design of Intelligent Car Based on STC89C52 Single Chip Microcomputer

0 Preface

This article refers to the address: http://

Since the birth of the first industrial robot, the development of robots has spread throughout the fields of machinery, electronics, metallurgy, transportation, aerospace, defense, and exploration. In recent years, the level of intelligence of robots has continuously increased and has rapidly changed people's lifestyles. In the process of constantly exploring, transforming, and recognizing nature, it is always a human dream to create robots that can replace human labor. Smart cars, or wheeled robots, are best suited for work in environments where humans can't work. The technology can be applied to unmanned motor vehicles, unmanned production lines, warehouses, and more. The car can also be used as a toy development object to make up for the lack of technical content in the Chinese toy market, to achieve economic benefits and to form commercial value.

The design is completed by a hardware module consisting of a minimum system of the single-chip microcomputer, infrared remote control, intelligent tracing, automatic obstacle avoidance and liquid crystal display, combined with software design to form a multi-functional smart car to jointly realize the forward, backward and steering of the car, according to the ground black Intelligent tracking of lines, detection of obstacles and other functions to achieve intelligent control.

1 Intelligent car hardware system design

The hardware system of the car is mainly composed of a control system, a drive system, a remote control system, a tracing system, an obstacle avoidance system, a display system, and a power supply system.

1.1 Control system

The macro crystal series STC89C52RC MCU with internal watchdog is selected as the core control device. The minimum system includes single chip microcomputer, MAX232 serial communication circuit, reset circuit, pull-up resistor and crystal oscillator circuit (crystal oscillator is 12MHz).

1.2 drive system

This car adopts four-wheel drive, and the control of the drive motor is realized by L298N. The L298N contains a 4-channel logic driver circuit that can drive two motors up to 46V and below 2A. The PWM power amplifier composed of L298N operates in a unipolar reversible mode, and the lower side bridge transistor emitters of the two H bridges are connected together. According to the input and output relationship of L298N, when the control terminal ENA is connected to the high level, the PWM signal input terminals IN1 and IN2 can control the forward and reverse rotation of the motor (the input terminal IN1 is the PWM signal, the input terminal IN2 is the low level, and the motor is rotating forward). The input terminal IN2 is the PWM signal, the input terminal IN1 is low level, the motor is reversed); when the control terminal ENA is low level, all the four transistors on the drive bridge are turned off, so that the running motor armature current is reversed. The motor stops.

The speed of the motor is realized by the microcontroller adjusting the duty cycle of the PWM signal. PWM is pulse width modulation, which refers to a method of fixing the basic period of an output signal and controlling the output power by adjusting the size of the duty cycle in the basic period. The duty cycle is the percentage of the high level duration in one cycle time. When controlling the speed of the motor, the duty ratio is larger and the speed is faster. If it is all high level, the duty ratio is 100% and the speed is the fastest.

0 Introduction Since the birth of the first industrial robot, the development of robots has been in the fields of machinery, electronics, metallurgy, transportation, aerospace, defense, and exploration. In recent years, the level of intelligence of robots has continuously increased and has rapidly changed people's lifestyles. In the process of constantly exploring, transforming, and recognizing nature, it is always a human dream to create robots that can replace human labor. Smart cars, or wheeled robots, are best suited for work in environments where humans can't work. The technology can be applied to unmanned motor vehicles, unmanned production lines, warehouses, and more. The car can also be used as a toy development object to make up for the lack of technical content in the Chinese toy market, to achieve economic benefits and to form commercial value. The design is completed by a hardware module consisting of a minimum system of the single-chip microcomputer, infrared remote control, intelligent tracing, automatic obstacle avoidance and liquid crystal display, combined with software design to form a multi-functional smart car to jointly realize the forward, backward and steering of the car, according to the ground black Intelligent tracking of lines, detection of obstacles and other functions to achieve intelligent control. 1 Intelligent car hardware system design The car's hardware system is mainly composed of control system, drive system, remote control system, tracing system, obstacle avoidance system, display system and power supply system. 1.1 Control System The macro crystal series STC89C52RC MCU with internal watchdog is selected as the core control device. The minimum system includes single chip microcomputer, MAX232 serial communication circuit, reset circuit, pull-up resistor and crystal oscillator circuit (crystal oscillator is 12MHz). 1.2 Drive system This car adopts four-wheel drive, and the control of the drive motor is realized by L298N. The L298N contains a 4-channel logic driver circuit that can drive two motors up to 46V and below 2A. The PWM power amplifier composed of L298N operates in a unipolar reversible mode, and the lower side bridge transistor emitters of the two H bridges are connected together. According to the input and output relationship of L298N, when the control terminal ENA is connected to the high level, the PWM signal input terminals IN1 and IN2 can control the forward and reverse rotation of the motor (the input terminal IN1 is the PWM signal, the input terminal IN2 is the low level, and the motor is rotating forward). The input terminal IN2 is the PWM signal, the input terminal IN1 is low level, the motor is reversed); when the control terminal ENA is low level, all the four transistors on the drive bridge are turned off, so that the running motor armature current is reversed. The motor stops. The speed of the motor is realized by the microcontroller adjusting the duty cycle of the PWM signal. PWM is pulse width modulation, which refers to a method of fixing the basic period of an output signal and controlling the output power by adjusting the size of the duty cycle in the basic period. The duty cycle is the percentage of the high level duration in one cycle time. When controlling the speed of the motor, the duty ratio is larger and the speed is faster. If it is all high level, the duty ratio is 100% and the speed is the fastest. 1.3 Remote control system The infrared remote control system is mainly composed of two parts: remote control transmitter and infrared receiver. The infrared remote control generates a remote control code pulse, drives the infrared launch tube to output an infrared remote control signal, and the remote control receiver receives the infrared signal emitted by the transmitter, and completes amplification, detection, shaping, demodulation of the signal, and input to the single chip microcomputer. Complete the decoding of the remote command and perform the corresponding remote control function. As shown in Figure 3, the receiver selects VS1838B, and out is the demodulated signal output terminal, which is directly connected to the single chip microcomputer. The infrared remote control can be used instead of the manual switch to control the start, stop, left turn, right turn, forward, and reverse functions of the car. 1.4 Tracking system In the smart car system, the infrared emitting tube emits infrared rays. When the infrared rays are irradiated to the white ground, there will be a large reflection. The intensity of the infrared light received by the infrared receiving tube is larger; if the infrared light is irradiated to the black mark The line, the black mark line will absorb most of the infrared light, and the infrared received by the infrared receiving tube will be weak. In this way, the intelligent tracking of the smart car can be realized by detecting the black marking line on the road of the smart car by using the infrared photoelectric sensor. The sensor detected by this smart car uses TCRT5000 reflective infrared sensor, which is packaged in shape and easy to install. As shown in Fig. 4, when using an emission current of about 40 mA, there is no strong sunlight interference (in a room with fluorescent lamps) and the detection distance can reach 8 cm, which fully meets the detection distance requirement. This is a device with a light-emitting diode and a phototransistor. When a black line is detected, the triode is turned off and outputs a high level because the reflectance is not high. When the white ground is detected, since the reflectance is high, the triode is saturated and outputs a low level, thereby realizing the detection of the black line. 1.5 Obstacle Avoidance System This design uses ultrasonic ranging. The ultrasonic frequency is high, the wavelength is short, the orientation is good, and the energy is concentrated. It is suitable for distance measurement and is not easily interfered by light, which improves the reliability of the system. In addition, the position of the obstacle can be positioned. The ultrasonic wave is emitted by the ultrasonic transmitting device, and the timing starts at the same time as the transmitting time. When the ultrasonic wave hits the obstacle during the propagation, it immediately returns. The ultrasonic receiver receives the reflected wave and stops the timing immediately. The distance can be known according to the time difference. This is the time measurement. The distance method (the ultrasonic wave propagation speed in the air is 340 m/s. According to the time t recorded by the timer, the distance s of the emission point from the obstacle can be calculated, that is, s=340t/2). The ultrasonic sensor is a non-contact sensor. The HC-SR04 sensor measures a distance of 2 to 400 cm and has a measurement accuracy of 3 mm. The obstacle avoidance system includes: an ultrasonic transmitter, a receiver, and a control circuit. 1.6 Display System This design adopts 1602 liquid crystal display, also called 1602 character liquid crystal. It is a dot matrix liquid crystal module specially used to display letters, numbers, symbols, etc. It has several 5×7 or 5×11 points. It consists of matrix characters, and each dot character can display one character. It has the characteristics of low power consumption, long life and many display contents, and can be directly connected to the data end of the single chip microcomputer. 1.7 trolley power supply system trolley power supply system has two ways: one is VSS DC geared motor power supply, two 3.7V voltage 1200mAh capacity mobile phone lithium battery connected in series, the voltage is about 7.4V; the other is VCC circuit board power supply The VSS power supply outputs 5V voltage through the voltage regulator chip 7805 to supply power to the sensor and the control board. 2 Intelligent car software system design The application software in the design includes: hardware circuit design software, programming software and service software. This design uses Protel 99SE software, draws the schematic diagram, and generates the PCB circuit board to complete the hardware circuit software design; adopts the mixed programming method, that is, the high-level language C writes the main program, compiles the hardware-related program with the assembly, writes the source program, and Generate hex format file, complete the program software design, program flow chart shown in Figure 6; also use STC-ISP-V4.83 program burning software and USB to serial port driver software and other service software. 3 Conclusions Smart cars are not the trajectory of solidification, but the idea of ​​flowing. The so-called intelligence is to give ideas to the machine to complete the established tasks. This design smart car realizes the following functions: smart car presses the power switch, 1602 liquid crystal display "zhineng che" and stops in place, then can advance, retreat, turn left, turn right, stop, etc. under the control of remote control It is operated and can switch between the tracking mode and the obstacle avoidance mode. In the tracing mode, the trolley can sense a 1.5cm wide black guide line along the infrared sensor on the completed runway, advance along the line and turn, and stop at the finish line. In the obstacle avoidance mode, the trolley can measure the obstacle distance through the ultrasonic sensor and react at 10cm, and turn left to avoid obstacles.

1.3 remote control system

The infrared remote control system is mainly composed of a remote control transmitter and an infrared receiver. The infrared remote control generates a remote control code pulse, drives the infrared launch tube to output an infrared remote control signal, and the remote control receiver receives the infrared signal emitted by the transmitter, and completes amplification, detection, shaping, demodulation of the signal, and input to the single chip microcomputer. Complete the decoding of the remote command and perform the corresponding remote control function. As shown in Figure 3, the receiver selects VS1838B, and out is the demodulated signal output terminal, which is directly connected to the single chip microcomputer. The infrared remote control can be used instead of the manual switch to control the start, stop, left turn, right turn, forward, and reverse functions of the car.

1.4 tracing system

In the smart car system, the infrared emission tube emits infrared rays, and when the infrared rays are irradiated to the white ground, there is a large reflection, and the intensity of the infrared light received by the infrared receiving tube is large; if the infrared rays are irradiated to the black mark line, the black mark The line absorbs most of the infrared light, and the intensity of the infrared light received by the infrared receiving tube is very weak. In this way, the intelligent tracking of the smart car can be realized by detecting the black marking line on the road of the smart car by using the infrared photoelectric sensor. The sensor detected by this smart car uses TCRT5000 reflective infrared sensor, which is packaged in shape and easy to install. As shown in Fig. 4, when using an emission current of about 40 mA, there is no strong sunlight interference (in a room with fluorescent lamps) and the detection distance can reach 8 cm, which fully meets the detection distance requirement. This is a device with a light-emitting diode and a phototransistor. When a black line is detected, the triode is turned off and outputs a high level because the reflectance is not high. When the white ground is detected, since the reflectance is high, the triode is saturated and outputs a low level, thereby realizing the detection of the black line.

Design of Intelligent Car Based on STC89C52 Single Chip Microcomputer

1.5 obstacle avoidance system

This design uses ultrasonic ranging. The ultrasonic frequency is high, the wavelength is short, the orientation is good, and the energy is concentrated. It is suitable for distance measurement and is not easily interfered by light, which improves the reliability of the system. In addition, the position of the obstacle can be positioned. The ultrasonic wave is emitted by the ultrasonic transmitting device, and the timing starts at the same time as the transmitting time. When the ultrasonic wave hits the obstacle during the propagation, it immediately returns. The ultrasonic receiver receives the reflected wave and stops the timing immediately. The distance can be known according to the time difference. This is the time measurement. The distance method (the ultrasonic wave propagation speed in the air is 340 m/s. According to the time t recorded by the timer, the distance s of the emission point from the obstacle can be calculated, that is, s=340t/2). The ultrasonic sensor is a non-contact sensor. The HC-SR04 sensor measures a distance of 2 to 400 cm and has a measurement accuracy of 3 mm. The obstacle avoidance system includes: an ultrasonic transmitter, a receiver, and a control circuit.

1.6 display system

This design uses 1602 liquid crystal display, also known as 1602 character liquid crystal, which is a dot matrix liquid crystal module specially used to display letters, numbers, symbols, etc. It has several dot matrix characters such as 5×7 or 5×11. Composition, each dot character can display one character. It has the characteristics of low power consumption, long life and many display contents, and can be directly connected to the data end of the single chip microcomputer.

1.7 trolley power supply system

There are two ways for the car power supply system: one is the VSS DC gear motor power supply, which is made up of two 3.7V voltage 1200mAh mobile phone lithium batteries connected in series, the voltage is about 7.4V; the other is the VCC circuit board power supply, by VSS power supply The voltage of the voltage regulator chip 7805 outputs 5V to supply power to the sensor and the control board.

2 Intelligent car software system design

The application software in the design includes: hardware circuit design software, programming software and service software.

This design uses Protel 99SE software, draws the schematic diagram, and generates the PCB circuit board to complete the hardware circuit software design; adopts the mixed programming method, that is, the high-level language C writes the main program, compiles the hardware-related program with the assembly, writes the source program, and Generate hex format file, complete the program software design, program flow chart shown in Figure 6; also use STC-ISP-V4.83 program burning software and USB to serial port driver software and other service software.

Design of Intelligent Car Based on STC89C52 Single Chip Microcomputer

3 Conclusion

The smart car is not the trajectory of solidification, but the idea of ​​flowing. The so-called intelligence is to give ideas to the machine to complete the established tasks. This design smart car realizes the following functions: smart car presses the power switch, 1602 liquid crystal display "zhineng che" and stops in place, then can advance, retreat, turn left, turn right, stop, etc. under the control of remote control It is operated and can switch between the tracking mode and the obstacle avoidance mode. In the tracing mode, the trolley can sense a 1.5cm wide black guide line along the infrared sensor on the completed runway, advance along the line and turn, and stop at the finish line. In the obstacle avoidance mode, the trolley can measure the obstacle distance through the ultrasonic sensor and react at 10cm, and turn left to avoid obstacles.

Xbox 360 Controller

Both wired and Wireless Controller for Microsoft Xbox 360 PC Windows 7 8 10 gaming systems. Great improvements on grips and contours, make it closer to ergonomics and fit your hands more comfortably. Bring you a consistent and maximum comfort gaming experience.

High sensitivity Wired and wireless Controller features of two vibration feedback motors, two pressure-point triggers, and an 8-way arrow button help players complete control of the gaming world, providing them immersive feeling just like on the battlefield. The guide button in the middle of the gamepad brings quick access to your game libraries, music, and digital movies.

This have Xbox 360 wired and wirelss gaming controller for Xbox 360 console, both wired and wireless are compectitive price and high qualtiy,all controller we got CE,FCC, RoHS , we also can do others certificates for you. and we customize your logo ,package , carton ect.we accept OEM/ODM,welcome your inquiry.

we are good partner you can trust.

Both Xbox 360 wired and wireless we can do transparent for you !


Product Name
Hot wireless controller for Xbox 360
Feature 2.4G connect
Material
ABS
Working current 10-30mA
Working voltage DC 2.6-3.0V
Advatage For Xbox one, compatible with PC Windows7/8/10
OEM/ODM
warmly welcome
Advatage 100 QC test before shipping
samples time 1-2day
warranty 1 year


Xbox 360 wireless controllerXbox 360 gamepad Xbox 360 wired controller

Xbox 360 Controller, Xbox 36t0 Gaming Controller, Xbox 360 wireless controller , Xbox 360 wired joystick, Xbox 360 gamepad , Xbox 360 wireles joystick

Shenzhen GEME electronics Co,.Ltd , https://www.gemeelectparts.com