Shenzhen ZTRON Microelectronics Co., Ltd
Telephone
0755-8299 4126

smart toys

Toy car scheme


Smart toys have a good effect on children's intellectual development, so they are loved by the majority of parents. As the world's largest producer of toys, China has a good market prospect for electronic smart toys. As the control core of the smart toy electric car, the single-chip microcomputer can improve the intelligence level of the toy.


1. Introduction of toy car program development technology


Single-chip microcomputer (Sin~e Clip Microcomputer) is referred to as single-chip microcomputer. A complete microcomputer can be formed by integrating the central processing unit, read-only memory, timer/counter, input and output interface circuits and other components with different functions on a chip. Nowadays, newer and more powerful single-chip microcomputers have emerged one after another, and can achieve different operating requirements. Single-chip microcomputer has the advantages of fast computing speed, large storage capacity, and strong computing power. , Promoted the technological transformation of various industries, and is conducive to continuous product innovation.


The intelligent toy electric car control system is a comprehensive system, including computer control technology, sensor technology, mechanical engineering and artificial intelligence and other technologies. The control methods include single-chip microcomputer control, optical sensor control, voice control, etc. Its functions include perception of the external environment, dynamic decision-making and planning, behavior control and execution, etc.


2. The working principle of the smart toy electric car


The smart toy electric car uses the single-chip microcomputer as the core control chip, and the single-chip microcomputer, tracking, motor drive, power supply and sensor obstacle avoidance and other components are used as the hardware circuit. The design of smart toy electric vehicles mostly adopts the rear drive mode. The two rear wheels are controlled by a motor respectively, and the front wheel is a universal wheel to maintain balance. When the driving wheel speed and rotation direction are adjusted, the steering of the electric toy car can be controlled. Two infrared sensors are installed on both sides of the chassis of the toy electric car. When the sensor on one side of the electric car detects a black line, the motor on this side is controlled by the single-chip microcomputer control chip to stop power supply, and the electric car is corrected to this side. The toy electric car detects whether there are obstacles ahead through three infrared sensors at the front, and the single-chip microcomputer analyzes and judges the detected information, thereby automatically avoiding obstacles. Adding the diode and voice broadcast function to the design of the smart toy electric car, the information such as the driving status of the electric car can be displayed in the form of voice and light, and the intelligent control of the toy electric car can be realized.


深圳玩具车方案开发


3. System design of smart toy electric car


3.1 Hardware system design of electric toy car


(1) Partial design of single-chip microcomputer. The smart toy electric car uses a single-chip microcomputer as the main controller. Single-chip microcomputers are widely used in intelligent electronic products due to their advantages such as high processing efficiency, strong anti-interference ability, wide operating temperature range, small size, low power, strong control functions, and rich external buses. Now there are many kinds of single-chip microcomputers in the market, and their functions are different. Therefore, it is necessary to choose a suitable single-chip microcomputer model according to the actual system situation of the product. Smart toy electric vehicles mostly use STC89C 51 single-chip microcomputer, which is suitable for complex electronic products with multiple controls.


(2) Tracking part design. The tracking part includes 4 infrared sensors, which are mainly installed on the chassis of the smart toy electric car. When the infrared sensor senses an object in front, the output voltage will change accordingly according to different objects, and the high and low levels will be compared and collected by LM32 for signal detection. Appropriate action to realize the tracking function.


(3) Sensor obstacle avoidance part. There are two technologies for sensor obstacle avoidance: one is ultrasonic obstacle avoidance. Within a certain range, ultrasonic waves will reflect multiple times, and the sensors are likely to interfere with each other, resulting in misjudgment of the direction of obstacles; the other is infrared obstacle avoidance. Compared with ultrasonic obstacle avoidance, the sensors will not interfere with each other, and the reaction speed is sensitive when encountering obstacles at close range, and there will be no misjudgment. Therefore, compared with infrared obstacle avoidance and ultrasonic obstacle avoidance, the sensor obstacle avoidance design of smart toy electric vehicles mostly chooses the latter. The sensor obstacle avoidance is set at the front and rear ends of the smart toy electric car. There are 6 infrared sensors in total. The working principle is the same as that of tracking, and it adopts reflective reception.


(4) Motor part. A DC motor is respectively arranged beside the two rear wheels of the electric vehicle, and the same control terminal is used. There are 4 channel logic drive circuits at the control end, and the level of the control end can be changed through the I/0 input of the microcontroller to control the electric vehicle to drive forward, backward, left, and right to avoid obstacles.


(5) Power supply part. The power supply is an important part of the design of the entire smart electronic toy electric car. The power supply provides electric energy for the normal use of electric vehicles. Generally, batteries are connected in series to supply power, which is conducive to maintaining voltage stability. The voltage required for each part of the smart toy electric vehicle system is different. The voltage required for the microcontroller, tracking, and sensor obstacle avoidance is 5V, the voltage required for the motor part is 12V, and the voltage required for the voice broadcast part is 3.3V.


(6) Voice broadcast part. The function of the voice broadcast part is to show the current state of the smart toy electric car in the form of voice prompts. It adopts a permanent memory voice recording and playback circuit, which is mainly composed of a timer, an internal clock, a preamplifier, a decoder, and a transceiver. The recording time is 60 seconds, and it can be repeated for hundreds of thousands of times. After the voice recording is completed and stored in the chip, when the electric vehicle takes different actions, it can broadcast the corresponding voice information.


3.2 Intelligent toy car software system design


The software system mainly analyzes and processes the detection information through programming, and makes corresponding instructions to control and change the behavior of the toy electric car. On each module, the control process is the motor process, obstacle avoidance process, and tracking process.

深圳玩具车PCBA价格


4. Programming application of DC servo motor in intelligent toy car


With the rapid development of computer technology, digital intelligent control systems based on single-chip computer technology have been widely used, and DC servo motors have always played an important role in the power drive system of intelligent control devices. According to a smart toy car control The hardware and software design of the power drive part of the motor is introduced, and a programming application method of continuous rotation servo motor in intelligent toys is introduced.


4.1 Smart toy car hardware design


The overall system design scheme of the intelligent toy controller adopts the framework of "MCU + perception system + actuator". Since this article mainly introduces the power drive design in the actuator, it does not involve the design of the external data information acquisition system in the perception system.


4.2 Intelligent toy car software design


The control program of the DC servo motor is realized by programming in C language. The basic principle of the control program is to program the single-chip microcomputer according to the control sequence of the specific motor, so that it can output the control waveform that conforms to the operation law of the motor. The DC servo motor used in this system adopts It is a continuous rotation servo motor produced by PARALLAX Company. It has three control lines, namely: power supply, ground line and control line. The power line and ground line are used to provide the energy required by the internal motor and control lines. The control signal requirements are A periodic positive pulse signal, the high level time of this periodic pulse signal is usually between 1ms-2ms, and the low level time should be between 5ms and 20ms. The timing sequence of the control signal is: the low level time is fixed at 20ms, and the high level is between 1.3ms-1.7ms. The control signal requirements of the servo motor are described as follows with specific signal waveforms.


The control signal waveforms of the three rotation states of the servo motor at stop, forward rotation at full speed and reverse rotation at full speed are given above. Change the pulse width within the time range of 1.3ms-1.5ms-1.7ms, and you can also control the different rotation directions of the servo motor. And the various waveforms of the speed, according to the above timing requirements, determine the programming flow chart of the basic control function of the motor.


With the basic control function flow chart, combined with the actual movement rules of the toy car, it is not difficult to compile the control sub-functions that control the smart toy car to achieve forward, backward, left turn, right turn, and acceleration and deceleration.


4.3 Smart toy car system operation and debugging


(1) Running program: According to the design requirements of the hardware circuit, connect the servo motor to the controller of the smart toy car, compile the program, burn the generated executable file to the single-chip program memory on the controller, and then turn it on and run it. The specific operation steps as follows:


Step 1: Start Keil uVision2IDE, finish editing, compiling and debugging the control program, and generate an executable HEX file.


Step 2: Connect one end of the ISP download cable to the parallel interface of the PC, and the other end (small end) to the program download port of the smart toy car controller, open the ISP download software to download the HEX file obtained in step 1 to the smart toy car The internal program memory of the MCU of the toy car controller, turn on the power of the controller, and run the program.


Observe the operation of the servo motor and measure the pins of the single-chip microcomputer output control signal with an oscilloscope to measure the signal waveforms corresponding to different control programs of the servo motor.


(2) Zero-point calibration of the servo motor: During the operation of the above system, it may be found that the actual operation of the servo motor is not completely consistent with the control program, because the zero-point calibration of the DC servo motor has not yet been performed.


The so-called servo motor zero point calibration refers to the process of keeping the motor stationary when sending a control signal that makes the servo motor speed zero to the servo motor. The servo motor is not pre-calibrated at the factory, so it needs to be adjusted. The specific method is: load the control program that makes the motor speed to zero into the program memory of the single-chip computer, start the operation, if the motor rotates, it means that it is not calibrated, adjust the potentiometer on the servo motor with a screwdriver, and observe the rotation of the motor at the same time, until the motor rotates. Stop turning, indicating that it has been calibrated.


After the motor is calibrated, use various servo motor control signals to test the rotation direction and speed of the motor, observe the operation of the motor, and realize the control of different rotation directions and speeds of the motor.

智能玩具小车设计公司


Summarize


In the actual debugging, under the control of the software, the DC servo motor can basically drive the toy car to complete the action requirements, but there are two issues that need to be further discussed.


First of all, in the hardware connection, because the orientation of the servo motors installed on the frame is just opposite, if one of the motors rotates forward, it will become reversed after the orientation is reversed, so the two motors should drive the two wheels towards Rotate in the same direction, so in the cooperation of software control, the rotation direction of the two servo motors must be one forward and one reverse.


Secondly, due to the programming limitation of the single-chip microcomputer, the control pulses of the two motors are not kept absolutely synchronized in time, so it seems that one motor is going to move first, while the other motor is slightly lagging behind, and the resulting low battery The average duration is no longer the 20ms stipulated in the timing diagram, but the influence of this small error in the actual operation of the system can be ignored.


To sum up, intelligent toys with high-tech content is an important development project of my country's toy industry. As an intelligent core controller, single-chip microcomputer has a great role in promoting the technological transformation of the toy industry and improving the intelligence level of toys.


The above are the details of the smart toy car solution introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. for you. If you have the development needs of electric toy cars, you can rest assured to entrust them to us. We have rich experience in customized development of electronic products, and can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are a number of chip agents at home and abroad: Songhan, Yingguang, Jieli, Ankai, Quanzhi, realtek, with MCU, voice IC, Bluetooth IC and module, wifi module. Our development capabilities cover PCB design, single-chip microcomputer development, Bluetooth technology development, software customization development, APP customization development, WeChat official account development and other hardware and software design. It can also undertake the research and development of smart electronic products, the design of household appliances, the development of beauty equipment, the development of Internet of Things applications, the design of smart home solutions, the development of TWS earphones, the development of Bluetooth earphone speakers, the development of children's toys, and the development of electronic education products.

  • TOP