Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

ESP32-Controlled Dual LED Blinker

View and Edit Project In Cirkit DesignerImage of ESP32-Controlled Dual LED Blinker

Circuit Documentation

Summary of the Circuit

This circuit consists of an ESP32 microcontroller that is used to control two LEDs: one red and one blue. The ESP32 has several GPIO pins, of which two are used to control the LEDs. The red LED is connected to pin D4, and the blue LED is connected to pin D14. Both LEDs share a common ground connection with the ESP32. The microcontroller runs a program that blinks the red LED with a delay of 5 seconds between turning on and off. The code for the blue LED is not provided, but it is assumed to be similar to the red LED's code.

Component List

ESP32 Microcontroller

LED: Two Pin (red)

LED: Two Pin (blue)

Wiring Details

ESP32 Microcontroller

LED: Two Pin (red)

LED: Two Pin (blue)

Documented Code

Code for the Red LED on ESP32

/*
 * This Arduino Sketch controls an LED connected to an ESP32 microcontroller.
 * The LED is connected to pin D4 and GND. The LED will blink with a delay of
 * 5000 ms (5 seconds) between turning on and off.
 */

void setup() {
  // Initialize the digital pin D4 as an output.
  pinMode(4, OUTPUT);
}

void loop() {
  // Turn the LED on (HIGH is the voltage level)
  digitalWrite(4, HIGH);
  // Wait for 5000 milliseconds (5 seconds)
  delay(5000);
  // Turn the LED off by making the voltage LOW
  digitalWrite(4, LOW);
  // Wait for 5000 milliseconds (5 seconds)
  delay(5000);
}

Note: The code for the blue LED is not provided, but it is expected to be similar to the red LED's code, with the appropriate pin number (D14) used in place of D4.