Before connecting sensors to the microcontroller and starting to take measurements, you should configure the microcontroller and install the necessary software.
In order to do anything with our microcontroller, it needs to be connected to the PC/laptop. ESP32 microcontroller has a USB port, so connect your microcontroller to the PC/laptop via a micro USB cable.
A COM port is essentially a serial port on a computer used for serial connection, meaning data is sent over a single wire, bit by bit. This is in contrast to parallel connection, where multiple wires are used to send data bits simultaneously. In the early days of computing, serial ports were used for connecting mice, modems, and other peripherals, but in modern contexts, they're often used for programming microcontrollers and debugging them.
When you're working on an IoT project, you typically write code on your computer that tells the microcontroller what to do. However, to transfer this code from your computer to the microcontroller, you need a communication channel, and that's where the COM port comes in. Through a USB connection, your microcontroller connects to your computer's COM port, allowing you to upload your code directly to the device.
Info
Open Device Manager: Search bar → type “Device Manager” → click on the “Device Manager” app.
Under the section Ports (COM & LPT), you should see your microcontroller. My microcontroller was under the name “Silicon Labs CP210x USB to UART Bridge (COM 5)”.
Tip
Notice that it says “(COM5)” to the right of my microcontroller’s name. This is the COM port I used to establish a serial connection between it and my computer.
Alert
To fix this problem, search for the drivers for your microcontroller on the Internet using the device name or the hardware ID of the device, and install them.
I found the drivers for my microcontroller by copying the hardware ID from Device Manager and Googleing it. The first result was this page. If you’re using an ESP32 like me, you can just do the following:
Once the microcontroller and computer are connected, let’s continue with installing required tools.