Wireless track smart car school competition | How to connect the ESP32 control board to the computer?

  • Ask /Aim: How to connect the ESP32 control board to the computer?
  • Principle : The ESP32 control board is connected to the computer through USB, and communicates with Thonny software through the corresponding serial port.
  • Practice : Connect to the computer and check step by step whether it works normally.

 

01 radio track


1. Problem/goal

  This ESP32-based control board is the core of the wireless track smart car model, and it is located on the top of the car model. Only when it is connected to the Thonny software development environment in the computer, can the following program development and experiments be carried out. The following describes how to connect the ESP32 control board to the computer Thonny software.

GM1690189242_1280_720.MPG|_-4

2. Basic principles

  The ESP32 on the control board is debugged through the serial port. A CH340 USB-to-serial chip is integrated on the circuit board. It is connected to the computer through the TypeC USB interface, and the 5V power supply on the USB is introduced into the interface circuit. This chip can be automatically recognized in the operating system after Windows 10, no need to install the USB driver. The ESP32 firmware burning circuit is also designed on the circuit board, which can update the firmware in the ESP32. The following shows the process of hardware connection.

GM1690191191_1280_720.MPG|_-6

3. Application example

1. The computer recognizes the USB serial port

  Use the USB cable of the TypeC interface to connect the control board to the USB interface of the computer. After connecting it, you can see that three LED lights on the circuit board are lit. This means that the control board is powered up through the USB port. Next, use the right mouse button to click the start button in the lower left corner of Windows, find the device manager, open it and click the port, you can see that there is a CH340 (COM6) port, which means that the system has correctly identified the USB serial port on the target board. If this device is not present, there may be a faulty cable or control board interface hardware. Here you need to write down the corresponding serial port COM6 for the time being. In your computer, the corresponding serial port may be other ports.

GM1690189753_1280_720.MPG|_-5

2. Connect Thonny software

  Next, run the Thonny software, and use the menu Tools to set the MicroPython communication port. In the Tools, Options command, open the Interpreter page, and select the ESP32 interpreter in the drop-down list above. Select the interactive serial port below. It is the USB serial port COM6 observed just now. After confirmation, you can see two lines of information and a command prompt in the Shell window under the Thonny software. The three greater than signs are the input command prompt, indicating that the MicroPython on the main control board can already receive Python commands.
GM1690190251_1280_720.MPG|_-5

▲ Figure 1.3.1 Configure Thonny command interpreter and communication port

▲ 图1.3.1 配置 Thonny 命令解释器和通讯端口

  If the following prompt does not appear in the Shell window, you can click the "STOP" button on the Thonny software to start MicroPython softly. If the command prompt still does not appear, you need to download the firmware for the development board ESP32. You can enter the help() command in the Shell window to observe the information returned by ESP32. So far, it can be proved that the ESP32 control board has the ability of software debugging.

GM1690190592_1280_720.MPG|_-2

  It should be noted that if the USB cable of the control board is plugged and unplugged midway, the corresponding ESP32 will be cold-started. The Shell under the Thonny software will show that the ESP32 has been disconnected and cannot be accessed. The STOP command needs to be used again to start the connection. At this time, press the STOP button, you can see that the ESP32 is reset and the connection is normal.

GM1690190830_1280_720.MPG|_-4

Four. Summary

  This article introduces the process of connecting the ESP32-based control board to the computer under Windows. After this process is completed, the subsequent software development can be carried out.
GM1690191299_1280_720.MPG|_-2

 

02 Lecture information


1. Lecture video

How to connect ESP32 controller to computer?

2. Lecture information


■ Links to related literature:

● Links to related diagrams:

Guess you like

Origin blog.csdn.net/zhuoqingjoking97298/article/details/131900067