The design scheme of WiFi Internet of Things car uses computer host software to control the movement of the car through wireless WiFi and collect information about the car. Compared with the traditional "smart car", the main features are the use of 32-bit high-performance single-chip microcomputer control, Internet communication mechanism and computer host software control. This scheme integrates computer software, network communication, image processing, graphic display, motion control, speed acquisition and temperature acquisition technologies, and has the relevant characteristics of "Internet of Things". Traditional car control mostly uses infrared communication and remote control, which is not only limited by distance, but also far less intuitive and beautiful than computer software. Internet communication enables the car to have the ability of remote control, which is beyond the reach of infrared communication. In addition, the car control chip of this scheme uses Cortex-M3 single-chip microcomputer, which has extremely rich peripherals, which lays the foundation for the future function upgrade and expansion of the car.
1 Overall design plan
The purpose of the WiFi IoT car design is to use computer software (referred to as the host computer) to communicate with the car control terminal (referred to as the lower computer) through the Internet, so as to control the movement of the car, collect the speed, temperature and video monitoring functions of the car. The overall design is shown in Figure 1. There are two communication modes to choose from in the figure. Among them, "WiFi LAN car control" adopts the LAN method to form a LAN with the host computer, wireless router and car to achieve the purpose of the host computer controlling the car. "Internet remote car control scheme" adopts the remote Internet method to form an Internet with the host computer and the car to achieve the purpose of remote control of the car. The technologies of the two schemes are similar. Due to the limitations of experimental conditions, this design takes the LAN car control as an example for explanation.
Figure 1 Overall design
From the perspective of communication, the wireless router is the data center of the host computer and the slave computer. The host computer creates a network interface through Winsocket socket programming to connect to the router. The car uses a serial port to WiFi module to convert the serial port data into WiFi signals through the WiFi module to interact with the router. In this process, the WiFi modules of the host computer and the slave computer have an independent LAN IP address. Through this IP address, the host computer and the slave computer can achieve network communication.
From the control perspective, the host computer is the control center of the car. The host computer sends instructions to the car through "buttons". After receiving the instructions, the car returns relevant data to the host computer. The host computer receives the data returned by the car, analyzes it, and displays it.
1.1 Host computer software design
The main function of the host computer is to control the movement of the car, display the speed of the car, the surrounding temperature and the camera collected by the car. As shown in Figure 2, these functions are completed by two threads, namely "image and sound processing thread" and "car movement control, speed and temperature collection thread". The former thread is mainly responsible for receiving and processing the image information and audio information transmitted by the car's WiFi camera. This part mainly involves DirectShow related technologies. The latter thread is mainly responsible for controlling the movement of the car, including "forward, backward, left turn, right turn, stop, accelerate, decelerate, turn signal and horn" and receiving and processing the temperature and speed information sent back by the car, and displaying it with a virtual chart. The two threads of the host computer software have created an unrelated socket. The former is used to interact with the car's WiFi camera for data, and the latter is used to interact with the car's serial port to WiFi module for data.
Figure 2 Upper computer software design scheme
1.2 Lower computer software design
The lower computer software design, namely the program design of the Cortex-M3 core processor, is shown in Figure 3. The design mainly includes: camera control, control of the four motors of the car, acquisition of DS18B20 temperature data, acquisition of infrared tube speed module data, and data processing, packaging and sending after acquisition. The camera control, motor control, and temperature and speed acquisition are all obtained in the form of functions. When the lower computer receives the relevant command from the upper computer, it calls the corresponding function to obtain the result and sends it to the upper computer in a fixed format.
Figure 3 Lower computer software solution
The core of the lower computer to realize WiFi communication with the wireless router is the serial port to WiFi module, through which the serial port data sent by the lower computer can be directly converted into WiFi signals for transmission. Before using this module, it can be configured in a variety of ways. Once configured, it can communicate with the designated WiFi access point.
2 Design features and extended description
2.1 Features
This solution is designed based on the concept of combining computer software, Internet communication and single-chip microcomputer technology. The selection of single-chip microcomputer, determination of communication scheme and design of host computer software are very different from traditional "smart cars". The following are the three major features of this design:
① The control chip of the car adopts the powerful Cortex-M3 32-bit high-performance, low-power processor. The chip has rich peripherals and supports the RLTx real-time operating system provided by ARM, which is very convenient to use;
② The communication method uses TCP/IP communication protocol and wireless WiFi technology to realize the control of the car. This communication solution (as shown in Figure 1) can connect to the remote network with a private IP, and can remotely control the car through the remote network, which will have good use value in the fields of "smart home" and "telemedicine";
③ Use computer host management software to effectively combine single-chip microcomputer control, network communication and computer software. This solution designs the host software to manage the car, which conforms to the design concept of simplifying complex control and making it interface-oriented. [page]
2.2 Extended description
The powerful and rich peripheral resources of the Cortex-M3 microcontroller lay a solid foundation for the expansion of this design. In addition to the functions that have been implemented, the microcontroller still has 2 unused serial ports, which allows the car to add the following functions: GPS navigation, voice, and GSM/GPRS text messaging, calling, and wireless Internet access.
3 Difficulties of the Solution and Key Technologies
The difficulties of the plan are:
① The host computer controls the movement of the car, which has a high requirement for real-time performance. The speed of the car is collected and displayed on the dial, which puts forward requirements for the stability of communication. This is even more difficult for TCP/IP communication, which already has delays.
② Image processing mainly refers to the technology provided in the DirectShow development guide on the Internet. Many internal processing mechanisms and the use of signal filters are difficult;
③ The speed displayed on the speed dial of the host computer is inconsistent and occasionally "stuck".
The key technologies are: ① formulation of communication protocol; ② method for lower computer to collect and process information; ③ upper computer socket programming, speedometer dynamically displays speed; ④ upper computer displays monitoring video of the car; ⑤ the car accesses the network as a WiFi access point.
4 Analysis of system simulation results
4.1 Overall appearance of the WiFi IoT car
The overall appearance of the car is shown in Figure 4 and Figure 5. The system consists of a host computer and a car, and the car control circuit is placed on the car. The car controller mainly includes: motor control, speed measurement, temperature measurement, communication, image acquisition and wireless routing.
Figure 4 WiFi IoT Car
Figure 5 Top view of the car
4.2 Overall system debugging
The host computer interface of the WiFi IoT car control system mainly includes: network settings, function settings, video monitoring area, motion control area, speed display area, temperature display area and debugging window. Network settings are used to connect the host computer to the car. Enter the car's IP address and click "Connect". The video monitoring function requires a WiFi camera to be installed on the car. By clicking the "Call" button below the video display box, you can connect to the IP address of the WiFi camera. After the connection is successful, you can get the image collected by the camera. The motion control area is used to control the movement of the car and display the car's turn signal, horn, etc. The speed display area is a speedometer that displays the real-time speed of the car. The temperature display area is a graphical interface of a thermometer that can display the temperature value of the DS18B20 sensor on the car. The communication debugging window is used when debugging the program.
4.2.1 Network Connection
Network connection debugging uses the TCP network debugging assistant downloaded from the Internet. First, set the TCP debugging assistant to server mode, set the server listening IP to 192.168.16.110, and the port to 345, and connect to the network. This IP address and port number are the IP address and port number of the UART to WiFi module, which are set by the MCU using AT commands. After the network connection is successful, the car host will continuously send "014, SR1, TE1, 029.6", indicating that the current temperature of the car is 29.6 ℃.
4.2.2 Car Movement
The debugging of the motion control part of the car is also carried out using the host computer and the TCP network debugging assistant. After connecting to the network, click "↑", "↓", "←", "→", "█", "Accelerate", and "Decelerate" on the host computer respectively. In the receiving window of the debugging assistant, ":014,SG1,UP1,;", ":014,SG1,DO1,;", ":014,SG1, LE1,;", ": 014, SG1, RI1,;", ": 014, SG1,ST1,;", ": 014, SG1, AD1,;" and ": 014, SG1,SU1,;" are received in turn, representing "forward", "backward", "turn left", "turn right", "stop", "accelerate" and "decelerate".
4.2.3 Display of temperature and speed
The temperature and speed tests are conducted directly during the actual movement of the car. Turn on the car, connect it to the host computer, cover the DS18B20 on the car with your hand, observe the changes in the degree of the analog thermometer in the temperature display area of the host computer, then turn the wheel of the car by hand to observe the changes in the speed dial pointer in the speed display area of the host computer, change the temperature and speed, and find that the speed dial pointer and temperature indication change accordingly, so it can be judged that there is no problem in the transmission of temperature and speed.
5 Conclusion
By repeatedly debugging and modifying the code, the expected functions can be realized. The communication is stable, the control of the car is reliable, and the accuracy and sensitivity of data collection meet the requirements. Without involving remote network control, the stability and reliability of the system have far exceeded ordinary infrared remote control cars and wireless radio frequency remote control cars. The significance of the solution lies in the effective combination of computer software technology, network technology and single-chip microcomputer technology, which highlights and deepens the meaning of "Internet of Things" and will be widely used in social life and production in the future. The application areas of the solution mainly include unmanned driving, remote monitoring and smart home.
Previous article:The "Soul" of the Microcontroller - The Use of Data Memory
Next article:Multifunctional lighting switch automatic control system based on ATmege128
Recommended ReadingLatest update time:2024-11-17 01:49
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- GaN Power HEMT > 650 V: Parametric Analysis and Comparison with SiC MOSFET
- Voltage controlled current source composed of opa547
- [GUIX①, one of threadX components] guix text button
- Qorvo Technology Video: GaN Solutions for Sub-6 GHz 5G Base Station Applications
- [Jihai M3 core APM32E103VET6S MINI development board] 02. USART online interaction function
- PCB design of RF devices
- [TI star products limited time purchase] TI's latest shopping experience
- Huawei employees complain: After working for 16 years, I only earned a house worth 14 million yuan
- Switching Power Supply Interest Group 10th Task
- Design of traffic light controller based on single chip microcomputer