WiFi IoT car designed with Cortex-M3 MCU

Publisher:Enchanted2021Latest update time:2014-12-05 Source: dzscKeywords:Cortex-M3 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  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.

Keywords:Cortex-M3 Reference address:WiFi IoT car designed with Cortex-M3 MCU

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

Design of measuring light curtain for object classification equipment based on C51 series single chip microcomputer
1. Introduction Light curtain is a kind of equipment that is widely used in electronic measurement system. It can measure a series of data such as height, length or width of objects on constant speed conveyor belt, so as to provide corresponding parameters for the subsequent electronic system. This paper
[Microcontroller]
Design of measuring light curtain for object classification equipment based on C51 series single chip microcomputer
The structure and principle of 8051 microcontroller
The basic structure of the microcontroller includes six parts: central processing unit (CPU), memory, timer/counter, input and output interface, interrupt control system and clock circuit. 1. Basic composition Central processing unit (CPU) Including the arithmetic unit and the controller, it is the core of the micr
[Microcontroller]
The structure and principle of 8051 microcontroller
51 MCU serial port--synchronous shift register
The serial port of the MCS-51 microcontroller has two independent data lines - the transmitting end TXD and the receiving end RXD, which allows data to be transmitted in two opposite directions at the same time. In general, during communication, the sending data is output from the TXD end and the receiving data is inpu
[Microcontroller]
51 MCU serial port--synchronous shift register
Design of LED aquarium lighting device based on single chip microcomputer control
  1 Introduction   The protagonists of ecological aquarium are fish and aquatic plants, and visual appreciation is its main function. Lighting is one of the three major technical issues that need to be solved first.   Commonly used aquarium lighting sources include fluorescent lamps, mercury lamps, halogen tungste
[Microcontroller]
Design of LED aquarium lighting device based on single chip microcomputer control
#Single-chip microcomputer#A small single-chip microcomputer control system - intelligent curtain control system
introduce Modules involved: 1. LCD1602 LCD screen 2.DS18B20 temperature sensor 3.ADC0832 digital-to-analog conversion chip 4.TORCH_LDR illumination control 5. Stepper Motor Functionality: 1. Display real-time temperature and curtain status on LCD. 2. Open the curtains when the temperature is within the
[Microcontroller]
#Single-chip microcomputer#A small single-chip microcomputer control system - intelligent curtain control system
Optimizing power efficiency and density in renewable energy and industrial systems with real-time microcontrollers
Power electronics designers work to improve power efficiency and power density in industrial and automotive systems, including multi-axis drives, solar energy, energy storage, electric vehicle charging stations and electric vehicle on-board chargers. One of the main design challenges for these systems is to achieve
[Industrial Control]
Optimizing power efficiency and density in renewable energy and industrial systems with real-time microcontrollers
The source program of 2 buttons of the single chip control 4 light switches flashing
I learned programming by myself and created a simple program to control 4 indicator lights with 2 buttons. I hope you can give me more suggestions. Thank you! /**************** One-touch multi-function program ****************/ #include reg51.h    unsigned char ID; sbit led=P2^0; sbit led1=P2^1; sbit led2=P2^2; sbi
[Microcontroller]
PIC microcontroller application design experience and skills
The PIC series 8-bit single-chip microcomputer (RISC microcontroller) developed by Microchip Technology Inc. of the United States, especially the microcontroller with built-in second-generation FLASH memory (40-year storage life), is unique in terms of rapid application. Due to its ease of use and high reliability,
[Microcontroller]
PIC microcontroller application design experience and skills
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号