The Design and Implementation of a Mobile Car Intelligent Toys

. The purpose of the subject is to design a car based on 51 single chip microcomputer control of nuclear intelligence toy car. Design is mainly divided into four modules respectively control module, test module, drive module, display module. Detection module by infrared receiving tube as tracking and obstacle avoidance of the detector to external environment for testing, testing mileage with hall element as the detector, test results of the test modules to control module, control module processed signal into the driver module to control the car turn left, turn right, forward, backward, at the same time control module and analysis processing state of marching into the 1602 LCD liquid crystal display status display. After many trials completed hardware design, the control core programming and sensor debug, finally realize the automatic tracking of toy cars, intelligent obstacle avoidance, mileage of display design requirements, and increase the car alarm, lights flashing remind and additional features such as voice control.


Introduction
With the rapid development of electronic technology and automatic control technology, human life is developing towards intelligent automation, and the consumer electronics industry is developing rapidly. More and more intelligent toys are appearing in people's lives, such as Aibo ERS-7M3 developed by the famous Japanese company SONY, and similar pet fish and cats are constantly appearing in the market. Of course, at present, the price is too high to be accepted by the public, but in the long run it may become an indispensable part of people's life. As a branch of intelligent robot, intelligent vehicle can take the place of human to undertake heavy and complicated work, go deep into the site that human cannot involve, carry out geological exploration and other work, and carry out rescue work in dangerous environment. Therefore, it is of far-reaching significance to study intelligent toy car.

Research content
This design takes the single chip microcomputer as the control core of the mobile car, mainly including controller, signal detection circuit, obstacle avoidance circuit, motor drive circuit, display circuit, power supply circuit and other modules. The software is programmed to realize the car's forward, backward, acceleration, deceleration, left, right turn and flashing lights, and avoid obstacles while moving. It can accurately display mileage, realize sound control, automatic tracking and obstacle avoidance and automatically adjust travel speed.
3 The overall design and hardware selection

The overall design
The design takes STC89C52 single chip microcontroller as the control core, and sends the tracking and obstacle avoidance detection module to the single-chip microcomputer for the road condition detection after power on. Based on the detection results, the single-chip microcomputer makes a judgment on the running condition, passes the processing results to the motor for corresponding driving, and also sends the running state to the status indicator light for status reminder.
In the course of the car, the mileage detection module counts the number of wheels turns behind the car, and the metal detection module detects the metal on the road. The temperature detection module uploads the detected temperature to the single-chip microcomputer, which calculates the mileage according to the compiled mileage calculation formula and sends the calculated mileage and temperature to the LCD1602 LCD screen for display [1].

The tracking module
If the ultrasonic detector is used, the ultrasonic detector has a strong detection ability and a wide range of detection, but the detection requires a high anti-interference ability, and the infrared emission receiving is used to detect the tube. In addition, if the infrared detector is used for detection, the infrared detector has prominent advantages of strong detection ability and strong anti-interference ability, but the device is expensive and the signal processing is very complicated. If infrared transmission receiving is used to detect the tube, although the infrared transmission receiving has a short acting distance and a low corresponding speed, the speed requirement of the car is not high, and the hardware implementation of infrared transmission receiving is relatively easy. Therefore, infrared transmission receiving tube detection is selected.

The obstacle-avoidance module
According to the comprehensive analysis of the track module and the track sensor, the infrared transmission receiving tube is also adopted as the obstacle-avoidance sensor. An infrared tube is installed on the right side of the car. The test found that such a scheme can avoid obstacle requirements, and it takes less resources, saves ports, and is relatively simple to program and debug.

The mileage detection module
According to the speed measurement method of bicycle stopwatch, hall sensor is used to detect the small magnet of coaxial rotation on the wheel so as to generate pulse count, which can achieve the function of recording the number of driving turns of the wheel. The mileage calculation is realized through software programming. Hall element has small volume, strong response ability, strong antiinterference ability in a certain magnetic field strength, simple hardware structure and strong stability. Good dynamic characteristics, long service life, low price and other features. And the hall circuit module can be fixed to install multiple magnets on the axle to increase the sensitivity of detection.

The driver module
LG9110 is a dual-channel push-pull power amplifier integrated device designed for control and drive motors [2]. The chip has two inputs of the TTL/CMOS compatible level and has good anti-interference ability. The two output ends can directly control the forward and reverse direction of the motor and have strong current driving ability. With a low output saturation voltage drop, the built-in clamping diode can release the reverse current of induction load, making it safe and reliable in driving relay, dc motor and stepping motor.

The display module
The digital tube is actually made up of seven luminescent tubes in a figure 8 pattern, with 8 points added. There are static and dynamic drivers. The advantage of static drive is simple programming, high display brightness, and the disadvantage is that it occupies many I/O ports. In practical application, the decoding driver must be added to drive, which increases the complexity of hardware circuit. 1602 liquid crystal is a kind of dot matrix liquid crystal module specially used to display letters, Numbers, symbols, etc. It is composed of a number of bitmap character bits like 5X7 or 5X11. Each bitmap character bit can display one character. There is a point interval between each character. The liquid crystal display has strong anti-interference ability, rich display content, and the connection circuit of the liquid crystal display is simple, occupying less I/O port. Based on the above analysis, LCD1602 was finally adopted for display.

Infrared detection circuit design
The tracking obstacle avoidance detection is equivalent to the eye of the car. The infrared transmission and receiving results are used to judge the road condition and report to the "driver" of the single-chip computer to control the car. All the tracking and obstacle avoidance adopt the infrared transmission receiving pair as the detector. The infrared transmission is the transmission of infrared light through V1, V6 and V3, and the reflected signal received by V2, V5 and V4. The signal reaches the transmitter tube V1 through resistance 220, and the resistance in the circuit provides the working voltage and working current to the

Display circuit design
LCD1602 displays the driving status and mileage, showing that the port occupies port P2, enabling RS to occupy port 1.1 and E to occupy port 1.3. The original circuit board P2 port is displayed by the control digital tube. P1.1 port is S1 button status indicator light, and P1.3 port is infrared remote receiving indicator light. These ports are modified and occupied, and the display content of the digital tube is transferred to the LCD screen, so the display effect is more obvious.

Drive circuit design
The motor drive chip is controlled by standard TTL logic level signals with two control ends, which allow or forbid the device to work without the influence of input signals. There is a logic power input end, which enables the internal logic circuit part to work under low voltage. The resistance can be externally detected and the variation can be fed back to the control circuit. The motor is powered by the chip LG9110, and the motor drive chip is internally integrated with four DMOS tubes, forming a standard h-type drive bridge. The motor is directly connected to both ends of the chip output, and pins 1 and 4 are used for controlling the motor direction. Different levels of 1 and 4 indicate different operating directions of the motor, mainly including positive turn and reverse, to drive the car forward, backward, left and right turn.

Mileage detection circuit design
The signal acquisition circuit is designed by hall sensor 3144 and count pulse output is realized by voltage comparator. To attach the module to the car shaft, to attach the magnets to the wheels and to do the circle count, by calculating the formula miles is equal to the wheel circumference times the number of the wheel, and the length of the programming.

Function debugging 6.1 Tracking test
On the ground, the black tape is used to stick a trolley test track with both straight and curved lanes, so as to track the trolley. After the trolley detects the black line in the infrared tube of the curved track, the trolley can make turn adjustment, and then resume straight driving for route detection. When encountering the cliff, the car can make backward turn adjustment, which basically meets the design requirements. The car's detection ability is poor. After encountering the black line, the car's reaction speed is too slow. If the car speeds up, the car has already used the track before responding. It is recommended to use sensors with high detection sensitivity as detectors. There are still some deficiencies in the software programming. The car cannot adapt to various angles of the curve for intelligent turn, and the smart turn according to the set fixed mode. It is recommended to use sensors with high detection sensitivity as detectors.

Obstacle avoidance test
The trolley can make turn adjustment to the obvious obstacles in front when driving on the road with obstacles. It can't produce effective response to small or complex obstacles and make corresponding adjustment. The car has poor detection ability for obstacles, and sometimes it only makes backward reflection after hitting the obstacle for a period of time. The car can be equipped with a obstacle avoidance detector to achieve the purpose of accurate detection, but the programming difficulty has also increased a lot, and it's easy to cause system processing confusion. It can also replace sensitive sensors.

Mileage display test
The car can carry out more accurate mileage display, the display distance can reach more than 100 meters, fully meet the design requirements. However, the distance measurement design of the car is relatively simple, and the test results are not accurate enough. It is better to test at both ends of the driving wheel separately to take the average value.

Conclusion
This design is an intelligent toy car, with tracking, obstacle avoidance, mileage display as the main function, on the basis of the original intelligent toy car modification to add functions.
Many problems have been encountered in the refitting process of the car, which need to be constantly corrected and improved. In the debugging process, theoretical and implementation inconsistencies have occurred for many times. In the experimental process, the circuit board and the sentence-by-sentence inspection procedure need to be comprehensively tested. Finally, the car realized automatic tracking, intelligent obstacle avoidance, mileage display