Getting Started With ESP32 on a Mac

Introduction: Getting Started With ESP32 on a Mac

About: Control systems and robotics engineer, nurgaliyev@shakhizat.info

About ESP32

ESP32 is a low cost and low power system on a chip microcontroller with integrated Wi-Fi & dual-mode Bluetooth. ESP32 is created and developed by Espressif Systems, a Shanghai-based Chinese company, and is manufactured by TSMC using their 40nm process.

Task

ESP32 Development Board will be used to blink an embedded LED infinitely.

Supplies

  1. ESP32 Module
  2. Arduino IDE
  3. Programming cable (micro USB cable)
  4. Breadboard (optional)

Step 1: How to Connect Your ESP32 to a MacBook

  1. Install the driver in order to communicate UART through USB.
  2. Go to Preferences/Security & Privacy and allow the driver to run, and restart the Mac.
  3. Connect your Micro USB to your ESP32 Board.
  4. Run $ ls /dev/cu.* and you should now see /dev/cu.SLAB_USBtoUART.

Before starting the next step, make sure you have the latest version of the Arduino IDE installed in your computer. It can be found by the following link.

Step 2: Installing ESP32 Add-on in Arduino IDE

  1. In your Arduino IDE, go to File> Preferences
  2. Enter https://dl.espressif.com/dl/package_esp32_index.j... into the “Additional Board Manager URLs” field. Then, click the “OK” button.
  3. Go to Tools > Board > Boards Manage.
  4. Search for ESP32 and press install button for the “ESP32 by Espressif Systems“.
  5. Close a window

Step 3: Writing Code for Arduino

Plug the ESP32 board to your computer. Open Arduino IDE, follow these steps:

  1. Select your Board in Tools > Board menu (in my case it’s the ESP32 DevModule)
  2. Select the Port /dev/cu.SLAB_USBtoUART.
  3. Write down the following code

/*
* ESP32 LED Blink Example */ #define LED 2 void setup() { // Set pin mode pinMode(LED,OUTPUT); } void loop() { delay(500); // 500ms digitalWrite(LED,HIGH); // Turn on LED delay(500); // 500ms digitalWrite(LED,LOW); // Turn off LED }

Step 4: Blinking a Built-in LED on ESP32

Press the Upload button in the Arduino IDE. Wait a few seconds while the code compiles and uploads to your board. After uploading program you will find on board BLUE LED will start Blinking.

Be the First to Share

    Recommendations

    • Hour of Code Speed Challenge

      Hour of Code Speed Challenge
    • Cookie Speed Challenge

      Cookie Speed Challenge
    • 3D Printed Student Design Challenge

      3D Printed Student Design Challenge

    Comments

    0
    seamster
    seamster

    2 years ago

    Thank you for sharing : )