- Home >> News >> Blog articles >> Educational smart hardware
Smart electric toy car control panel program development
With the advancement of technology and the arrival of the intelligent age, intelligent products are ubiquitous in life. Various intelligent devices play different roles in their respective fields. In the field of toy cars, the emergence of smart cars has made children and car model lovers more popular. Smart cars are not only cheap, but can even perform tasks that are difficult for humans to perform. It has played an important role in many fields such as industry, agriculture, and social production and life. The wireless remote control car can work in dangerous environments, search personnel, and play its special role in various fields.
1. Development and design ideas of remote control car
This design uses a 9V/2A rechargeable lithium battery as the power module to supply power for the main control Arduino nano module, HC-06 master-slave integrated Bluetooth module, L298N motor drive module and two motors. The Arduino nano module and the HC-06 Bluetooth module transmit control commands to each other. The main control chip controls the L298N drive module. The drive module adjusts the speed of the motor by changing the PWM duty cycle. The drive module controls the positive and negative directions of the motor by controlling the direction of the current. Turn, and then realize the functions of forward, backward, left and right turns of the vehicle. The overall design block diagram is shown in the figure below.
2. Hardware design of remote control car
(1) Main control module: Arduino nano is equipped with an Atmel Atmega328P single-chip microcomputer. This mode is a 4.5cm×1.8cm cuboid. The specific structure diagram is shown in Figure 3-1 below. The power supply voltage of this module must be DC 7V Voltage between ~9V, output DC voltage between 5V and 3.3V. The module has 12 digital input/output ports D2~D13, 8 analog input ports A0~A7, supports the RX/TX terminals of the microcontroller, and supports 6 sets of PWM terminals. The whole module supports USB and ISP download and power supply. As shown in the figure below, the white in the middle is the reset button. Arduino nano provides an automatic reset design, which can be reset through the host. This automatic reset does not need to set a reset button.
(2) Motor drive module: The L298N motor drive chip has dual H-bridges, which can support a maximum working voltage of 46V according to the official, and can guarantee a large output current at the same time, and the peak drive current can even reach 3A. The rated power of the module used in this design is about 25W, which is enough to drive two 9V/2A DC geared motors. SMD LEDs are used to display the control signal status, which is convenient for hardware and software debugging. Since the two enable terminals of L298N ENA and ENB control the drive signal, the motor speed adjustment is realized.
(3) Communication module: The serial Bluetooth module selected in this article is specially designed for intelligent wireless data transmission, and follows the V3.0 Bluetooth specification. The BT06 Bluetooth module has the advantages of small size and high sensitivity of sending and receiving, and supports UART interface and SPP Bluetooth serial port protocol at the same time. When the Bluetooth module is waiting for pairing, the status indicator light will enter a steady and slow flashing (800 milliseconds on, 800 milliseconds off), when the module is connected, the status indicator light will enter a steady state. The communication distance of the Bluetooth module is relatively long, which can reach 30 meters in open space and 15 meters in normal environment. The baud rate of the default parameters of the Bluetooth module is 9600, and the default pairing password is 1234.
3. Program design of remote control car
The bluetooth remote control car design based on the single chip computer adopts the C language to write the program. C language is a widely used high-level programming language for developing smart chip programs. The library has rich functional resources, fast running speed, high compilation efficiency and high success rate, and can be directly controlled by object-oriented. This part of the program design is to complete the communication and feedback of the travel command, which involves the knowledge of output port initialization, baud rate setting and interrupt application. The flow chart of the main program is shown in the figure below. Initialize each module at the beginning, receive data, the single-chip computer judges that the data is to receive the data, and interrupt the serial port after receiving the data, judge whether the data is reasonable after the interruption, and if the data is reasonable, enter the control program to control the car.
Summarize
In this design, the Atmega328P on the Arduino nano development board is carefully controlled as the core controller board, and the L289N is used to drive two DC motors. The functions of the two DC motors are front wheel steering and rear wheel drive respectively, so as to control the operation of the car. Using the signal transmitted by the HC-06 Bluetooth module, the Bluetooth serial port APP receives the data. This bluetooth remote control car has a bluetooth remote control manual driving function. This kind of remote control car has a very good development prospect no matter it is used as a toy for children in life, or as a high-risk task such as reconnaissance and anti-riot in the military field. Therefore, it can be seen from the above that this product has great market value and research significance.
The above is the design example of the bluetooth remote control car based on the single chip microcomputer introduced by us Shenzhen Zuchuang Microelectronics Co., Ltd. If you have bluetooth headset design needs, you can trust us. We represent a variety of single-chip microcomputers, voice chips, dual-mode Bluetooth ICs, and wifi chips. Brands include Songhan MCU, Yingguang MCU, Jerry Bluetooth, Ankai Bluetooth, Allwinner, and Realtek. Our technical services include: PCB design, MCU development, Bluetooth solution, software and hardware custom development, APP development, small program development, WeChat official account development, etc. It can also undertake the design of intelligent electronic products, the development of living appliances, the research and development of beauty equipment, the application of Internet of things platform, the smart home control system, the development of TWS earphones, Bluetooth earphone speakers, the development of children's educational toys, the design of electronic education products, etc.
Proposal recommendation
- TOP