Getting Started With ESP32 on a Mac: Blink and LED

13,991

17

7

Introduction: Getting Started With ESP32 on a Mac: Blink and LED

The ESP32 development board is super-charged version of the popular ESP8266. It is a WiFi-compatible microcontroller, in addition to having Bluetooth low-energy (BLE4.0) and 27 I/O pins. It also has a very small form factor relative to the Arduino and is also very cheap, approximately $5, making it the ultimate prototyping micro control. Since it has both WiFi and Bluetooth it is a great device to be used for Internet of Things (IoT) devices and projects.

This project is an introductory lesson in the use of the ESP32 in a series of tutorials for a variety of use cases and projects for the ESP32 development board, ranging from simple sensor interfacing to IoT devices.

I am inspired to write this instructable since I could not find a decent guides regarding how to get started with the use of the ESP32 Development Board. It is such a powerful board for it's size and price that I believe people should be more aware of it's existence and use.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Tools and Materials

  • 2 Breadboards
  • ESP32 Development Board
  • 5mm Red LED
  • 100Ω Resistor
  • USB to micro-usb cable

Step 2: Installing the ESP32-Arduino-ACore Firmware

Natively, the Arduino IDE does not support the ESP32 Development board. Thus, the option to use the ESP32 will not be visible until the firmware is properly installed and that the Arduino IDE has been restarted.

  1. Open the Terminal and enter the following lines of code.

mkdir -p ~/Documents/Arduino/hardware/espressif && \
cd ~/Documents/Arduino/hardware/espressif && \ git clone https://github.com/espressif/arduino-esp32.git esp32 && \ cd esp32/tools/ && \ python get.py

2. Press enter and let the code run.

3. Restart the Arduino IDE and the you will see the ESP32 appear in the Tools>>Board

Step 3: Install the SiLabs Driver

The ESP32 Development board's ports will not be recognized by the Arduino IDE since there are several drivers that are missing on a Mac.

  1. Download the drivers through the SiLabs website: https://www.silabs.com/Support%20Documents/Softwar...
  2. Install the drivers onto the computer
  3. Plug in the ESP32 through the micro-usb cable to the computer, and the port will appear on the Arduino IDE under Tools>>Ports.

Step 4: Plugging in the ESP32 Development Board

The ESP32 board is larger than its predecessor the ESP8266 as such it has to fit in between two breadboard to be usable.

  1. Tape two breadboards together.
  2. Plug in the ESP32 Development board in between the two breadboards.

Step 5: Wiring the Circuit

  1. Connect the 100Ωresistor to the pin called D6 on the ESP32.
  2. Connect the Anode of the LED to the end of the 100Ωresistor.
  3. Connect the Cathode of the LED to the pin called GND on the ESP32.

Step 6: Coding

The code is relatively similar to that of the Arduino and are both written in C. However, there are differences in the baud rate as shown below.

int ledPin = 5;
void setup()
{
    pinMode(ledPin, OUTPUT);
    Serial.begin(115200);
}
void loop()
{
    Serial.println("Hello, world!");
    digitalWrite(ledPin, HIGH);
    delay(500);
    digitalWrite(ledPin, LOW);
    delay(500);
}

Step 7: LED Blinking Demonstration

The LED blinking demonstration is the same result as the Arduino, but with the use of a much smaller form factor.

Makerspace Contest 2017

Participated in the
Makerspace Contest 2017

Be the First to Share

    Recommendations

    • Backyard Contest

      Backyard Contest
    • Silly Hats Speed Challenge

      Silly Hats Speed Challenge
    • Finish It Already Speed Challenge

      Finish It Already Speed Challenge

    7 Discussions

    0
    ChrisL228
    ChrisL228

    7 months ago

    I have tried just about everything, but can NOT get a 'COM' port to appear in the menu. I am using Arduino IDE 1.8.9 on a Mac Mojave 10.14.6 (USB 3.0) and a HiLetgo ESP-WROOM-32 ESP32 ESP-32S Development Board. Everything in this instructable was run without error. Any help would be greatly appreciated.

    0
    JamesF88
    JamesF88

    8 months ago

    great tutorial. finally got me started with esp32

    0
    rhaag71
    rhaag71

    1 year ago

    What is the point of using two breadboards? It appears that a single breadboard would do, unless I'm missing something here. I bring this up for the benefit of others who may not know (beginners maybe) and have only a single breadboard available. Regardless, thanks for posting this!

    0
    TechMartian
    TechMartian

    Reply 1 year ago

    Nothing apart from demo purposes because I barely have any room for the LED, so its hard to show on camera/

    1
    rglaves
    rglaves

    Reply 1 year ago

    Thank you!!

    1
    hoiberg42
    hoiberg42

    2 years ago

    You forgot to mention to run "git submodule update --init --recursive" in /esp32/ after cloning the git repository. If you don't do this you'll get an invalid library error.

    Otherwise a good tutorial!