WiFi Internet of Things car design, using computer hosting software through wireless WiFi control trucks, collect information of trains. Compared with traditional "smart cars", mainly in the use of 32-bit high-performance microcontroller control, Internet communication mechanism, and computer hosting software control. This scheme combines computer software, network communication, image processing, graphic display, motion control, speed acquisition, and temperature acquisition, with "Internet" related features. Traditional trolley control mostly uses infrared communication, using the remote control, not only being limited, but there is no computer software intuitive and beautiful. Internet communication makes the car have the ability to remotely control, which is the infrared communication. In addition, this program trolley control chip uses a Cortex-M3 single-chip microcomputer, which has a very rich peripheral, which lays a foundation after the truck is upgraded and extension.
1 overall design plan
The purpose of WiFi Internet of Things trolley design needs to use computer software (referred to as the upper computer) to communicate with the trolley control terminal (referred to machine) through the Internet, thereby controlling the movement of the car, the speed, temperature, and video surveillance of the trains. . The overall design is shown in Figure 1. There are two kinds of communication modes in the figure, in which "WiFi LAN Train Control" is a local area network, the upper machine, wireless router, and the truck are used to form a local area network, and the purpose of controlling the host control car. "Internet Remote Trains Control Plan" is a remote internet, which makes the host computer and the trolley into an internet, thereby achieving the purpose of remote control trucks. The technique of 2 programs is similar, and the design is explained as an example in which the local area network truck control is taken as an example due to the limitations of experimental conditions.
Figure 1 Overall scheme design
From the perspective of communication, the wireless router is the data center of the host computer and the lower computer. The host computer creates a network interface with the router via the Winsocket socket, and the small end passes the serial port data via WiFi. The module is converted into a WiFi signal interact with the router. In this process, both the host computer and the lower machine WiFi module have a separate LAN IP address. Network communication can be implemented by this IP address uplink machine and the lower computer.
From the perspective of the control, the host computer is the control center of the truck. The host machine will pass the "button" to give the car. The car receives the instruction to return the relevant data to the host computer, the host computer receives the data of the car back. Analysis and display it.
1.1 host machine software design
The main function of the host computer is to control the truck movement, show the speed of the trolley, the surrounding temperature, and the captain of the car collection. As shown in Figure 2, these functions are completed by 2 threads, respectively, "image, sound processing thread", and "cart motion control, speed, temperature acquisition thread", and the like. The previous thread is mainly responsible for receiving and handling image information and audio information from the car WiFi camera, which mainly involves DirectShow related technologies. The latter thread is mainly responsible for the control of the truck, including "advancement, retreat, left rotation, right turn, stop, acceleration, deceleration, turning light and speaker" and the temperature and speed information of the receiving trolley return, and display with virtual chart Come out. The upper computer software 2 threads created a socket that mutually discharging, the former is used to interact with the cars WiFi camera, which is used to interact with the carrier serial port WiFi module.
Figure 2 Lockestinal software design
1.2 lower machine software design
The lower computer software design, the program design of the Cortex-M3 core processor, as shown in Figure 3. The design is mainly included: the control of the camera, the control of the cars, the acquisition of DS18B20 temperature data, the acquisition of infrared to the tube speed module data, and the processing package transmission of data after data. The acquisition of the image of the image is acquired in the form of a function. When the lower computer receives the relevant command of the host computer, the corresponding function is called to obtain the resulting machine with a fixed format.
Figure 3 Next Machine Software Solution
The core of the next machine implements the core of WiFi and wireless router is a serial port WiFi module. The serial data transmitted by the lower machine can be directly converted into the WiFi signal through this module. The configuration can be configured in a variety of ways before using this module, as long as it is configured, network communication is performed with the established WiFi access point.
2 Design plan characteristics and expansion description
2.1 Features
This solution is based on the idea of intending to combine computer software, Internet communication, and microcontroller technology. From the selection of single chip microcomputers, the determination of the communication scheme, and the design of the host computer software is very special. The following is 3 features of this design:
1 The control chip of the train uses a powerful Cortex-M332 high performance, low-power processor, which has a rich peripheral, and the chip also supports the RLTX real-time operating system provided by ARM, which is very convenient to use;
2 The communication mode uses the TCP / IP communication protocol to use wireless WiFi technology to implement control of the car. This communication scheme (as shown in Figure 1), in the case of private IP, you can connect the remote network, you can pass the remote network remote control, which will have a good value of use in "smart home" and "remote medical".
3 Use computer host machine management software to effectively combine microcontroller control, network communication, and computer software. This program is designed to manage the car, which is in line with the design concept of simplifying complicated control, interface.
2.2 Expansion Description
The strong peripheral resource of Cortex-M3 single-chip microcomputer has laid a strong basis for the extension of this design. In addition to the implemented function, the single-chip has no 2 serial ports, which makes the car can also add the following functions: GPS navigation function, voice function, and GSM / GPRS texting, call and wireless Internet feature.
3 program difficulties and key technologies
The difficulty of the program is:
1 The movement of the host computer control trolley is high, and the speed of collecting the trains is displayed with the dial, which requires the stability of the communication, and for TCP / IP communication, there is a delayed TCP / IP communication It is even more difficult to increase;
2 Image processing is mainly the technique provided in the online DirectShow Development Guide, and many internal processing mechanisms and signal filters are difficult;
3 The upper machine speed dial display speed is not coherent, and occasionally there is "card death" phenomenon.
Key technologies are: 1 formulation of communication protocols; 2 method of acquiring and processing information; 3 upper machine cover text programming, speed dial dynamic display speed; 4 host machine Show car monitoring video; 5 car as WiFi access point Enter the network.
4 Analysis of System Simulation Results
4.1 WiFi Internet of Things car overall appearance
The overall appearance of the car is shown in Figures 4 and 5, and the system is composed of a host computer and a trail, and the car control circuit is placed on the caus. The trolley controller mainly includes: motor control, speed measurement, temperature measurement, communication, image acquisition, and wireless routing.
Figure 4 WiFi Internet of Things
Figure 5 Trolley top view
4.2 System overall debugging
The upper machine interface of WiFi Internet of Things trolley mainly includes: network settings, functional settings, video monitoring areas, motion control areas, speed display areas, temperature display areas, and debug windows. Network settings are used for network connections with the carriage and the car, enter the car IP address, click "Connect". Video monitoring features require a small end to install a WiFi camera, by clicking the "Call" button under the video display, you can connect the image captured image. The motion control area is used to control the movement of the truck and the steering lamp, a speaker, etc. of the car. The speed display area is a speed dial for displaying the real-time speed of the truck. The temperature display area is a thermometer graphical interface that shows the temperature value of the DS18B20 sensor on the cart. The communication debug window is used when debugging the program.
4.2.1 Network connection
Network connection debugging Using the online download TCP network debug assistant, first set the TCP debug assistant to server mode, set the server monitor IP 192.168.16.110, port set to 345, connect the network, this IP address and port number are UART to WiFi module The IP address and port number are set by the AT command through the single chip microcomputer. After the network connection is successful, the host has continuously transmits "014, SR1, TE1, 029.6", indicating that the current temperature of the small end is 29.6 ° C.
4.2.2 Car movement
The commissioning of the trolley movement control part also uses the host computer and the TCP network debug assistant for debugging. After connecting the network, click "↑", "↓", "←", "→", "█", "acceleration", "deceleration" on the upper computer. Receive ": 014, SG1, UP1 ,;", ": 014, SG1, DO1 ,;", ": 014, SG1, LE1 ,;", ": 014, SG1, RI1, in the debug assistant receiving window. ",": 014, SG1, ST1 ,; ",": 014, SG1, AD1 ,; "and": 014, SG1, SU1, "", "forward", "back", "left turn" , "Right Turn", "Stop", "Acceleration" and "Deceleration".
4.2.3 Display of temperature and speed
Temperature and speed tests are tested during the actual movement of the trolley. Open the train, connect the upper machine, and hold the DS18B20 on the cart with your hand, observe the change in the degree of temperature meter on the upper temperature display area, then use the hand rotation of the car to observe the speed display area speed dial pointer change, change the temperature and The speed of the speed is found that the speed dial pointer and temperature indicate the corresponding changes, so it can be judged that there is no problem with the transmission of the temperature and speed.
5 Conclusion
The expected functionality can be achieved by repeated debugging and modifying the code. Communication is stable, the control of the car is reliable, the accuracy and sensitivity of data acquisition meet the requirements. In the absence of remote networking control, the stability and reliability of the system have far more than ordinary infrared remote trains and wireless radio frequency remote control cars. The significance of the program is to effectively combine computer software technology, network technology, and single-chip technology, highlight and deepen the meaning of "Internet of Things", will be widely used in social life and production in the future. The application field of the program mainly has no driving, remote monitoring and smart home.
Be
Source: Wiku Electronic Market Network
Our other product: