Skip to main content
Chemistry LibreTexts

1: Introduction

  • Page ID
    290329
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    ESP Development Boards Overview

    .

    .

    .

    .

    .

    .

    clipboard_eb84e7994766e522b200bb7ac696a05c5.png
    Figure \(\PageIndex{1}\): ESP32 DevKitC (Elena Lisitsyna)

     

     

    clipboard_e0c06fea7888ac39d85bd06b03b534429.png
    Figure \(\PageIndex{2}\): ESP8266 NodeMCU (Elena Lisitsyna)

     

    Download & Install VCP Drivers

    Most of the ESP development boards require VCP Drivers to be installed on your computer, otherwise the system will not recognize that there is a microcontroller connected via USB. VCP Drivers allow device to operate as a virtual COM Port and initiate USB to UART bridge.

    1. Download VCP Drivers from here.

    2. Install the Driver on your computer.

    3. Connect ESP8266 NodeMCU to your computer via USB. You should hear a sound indicating that a new device was connected. 

    4. Open the Device manager on your computer (You can start typing "Device Manager" in the search box). 

    5. Look for Ports (COM & LPT). You should see something like the image below:

    clipboard_e755f2e0cdff42885d2eeb5613c8044cf.png
    Figure \(\PageIndex{3}\): If you did everything right you should see a device connected to one of the COM ports

    You will need to use the number of the COM port later in this tutorial. 

    Note: If you don't see "Ports (COM & LPT)" or if there are no devices connected try different USB ports. 

    Note: Not all cables are going to work! You need a cable that supports both: charging and data transfer. It has to be relatively short (3' and under, the shorter the better).

    Download & Install Arduino IDE

    Arduino IDE is used to develop code for microcontrollers like ESP32 DevKitC and ESP8266 NodeMCU. You can download the latest version of Arduino IDE for Windows, Linux or MacOS X from this website. Arduino code is called Sketch.

    All sketches must be compiled before they are uploaded to the microcontroller. Compilation is a process of converting the code from human-readable to machine-executable. Only after a scketch is compiled and only if there are no errors detected in the code it is possible to upload it to a microcontroller.

    clipboard_ec151fd5fef9d086abc01c4fc5810e384.png
    Figure \(\PageIndex{4}\): Arduino IDE. (Elena Lisitsyna)

    New - open a new sketch. Keep in mind that it is also possible to add a new sketch as a tab to the same window. It is convenient if you are testing a new version of the same code.

    Open/Save - can also be done from the "File" menu, which includes a shortcut "Open Recent".

    Upload - Compile and upload to a microcontroller.  

    Verify - Compile your code to see if there are any errors. Mostly used for troubleshooting.

    Prefilled Functions - Both of these must be present in any Arduino code, otherwise it will not compile.

    Status area - After you click "Verify" or "Upload" you can see updates in this section. The Example shown in the image above is a message displayed after the sketch was compiled correctly.

    Serial monitor - can also be accessed from Tools --> Serial Monitor. Shows Serial output once the code is uploaded to a microcontroller. We can think of it as an equivalent to Thonny IDE shell.

     

    Install Libraries for Arduino IDE

    Just like you need libraries to code in Python you will need to install libraries while working with Sketches (which are essentially C++).

    1. Open Arduino IDE and navigate to Tools → Manage Libraries.

    clipboard_ee9fd98374efc1c070f812a1533b6ed40.png
    Figure \(\PageIndex{5}\): Open Libraries Manager

    2. Search for and install the following:

    • ESP8266 by Adafruit
    • ESP32 by Espressif Systems

    3. In Arduino IDE and add your board. File → Preferences. Paste the following in the “Additional Boards Manager URL’s:” line*:

    http://arduino.esp8266.com/stable/package_esp8266com_index.json

    Click OK

    *Tip: If you are working with different development boards you can add several URL's to this line separating them by a comma:

     

    https://dl.espressif.com/dl/package_esp32_index.json, http://arduino.esp8266.com/stable/package_esp8266com_index.json

     

    4. Tools → Board → select the board you are currently working with. Be careful because there can be different versions of the same development board and if you select the wrong one you won't be able to upload your code. Arduino IDE will return an error saying that the selected board was not found. The easiest way to find the right name is to view your order (if you ordered it online), the correct name should be included in the name of the product.

    Figure \(\PageIndex{6}\): The correct name of the development board name can be found in the listing

    5. Tools → Port → COM*. You need to select the COM port you found in the beginning of this tutorial.

     

    Contributors and Attributions

    Robert E. Belford (University of Arkansas Little Rock; Department of Chemistry). The breadth, depth and veracity of this work is the responsibility of Robert E. Belford, rebelford@ualr.edu. You should contact him if you have any concerns. This material has both original contributions, and content built upon prior contributions of the LibreTexts Community and other resources, including but not limited to:

    • Elena Lisitsyna 

    1: Introduction is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.

    • Was this article helpful?