Built-in project · Freenove ESP32-WROVER

Freenove WROVER on its extension board

The Freenove ESP32-WROVER plugged into its GPIO extension board on a breadboard, blinking an LED from GPIO 2 through a resistor. The whole build, a Freenove ESP32-WROVER and 3 more parts, runs here in your browser on the firmware below; open it in the editor to change the wiring or the code and run it again.

Teaching? Assign it to your class in one click.

About 15 minutes to build and run. Runs in your browser. Free, and no account needed.

The parts retail for about $28. On Mokxi they're free.

The circuit runs here once the page has loaded.

What you'll learn

  • Choosing and reading a resistor
  • How an LED lights and why it needs a resistor
  • Using the Freenove ESP32 GPIO extension board
  • Time: About 15 minutes
  • Board: Freenove ESP32-WROVER
  • Parts: 5

How it works

The Freenove ESP32-WROVER plugged into its GPIO extension board on a breadboard, blinking an LED from GPIO 2 through a resistor.

Freenove ESP32-WROVER runs the sketch below. The circuit around it: Freenove ESP32 GPIO extension board, Resistor, 220 Ω, LED, red. pinMode sets kLed as an output. digitalWrite drives kLed HIGH. delay waits 500 milliseconds.

Parts list

5 parts, plus the jumper wires. They retail for about $28; on Mokxi they're free.

Wiring table

Every connection, pin by pin, read from the circuit itself. Each row joins the pin on the left to the pin on the right, by a jumper wire or a breadboard strip.

Part and pinConnects to
Resistor, 220 Ω pin 1Freenove ESP32 GPIO extension board pin 2
LED, red pin CFreenove ESP32 GPIO extension board pin RGND1
LED, red pin AResistor, 220 Ω pin 2

The code

The firmware exactly as the editor opens it. Change a line there and press Run: it compiles in the browser.

sketch.ino · Freenove ESP32-WROVER
// Blink: the DevKit's own blue LED on GPIO2, and an LED you wire yourself.
//
// GPIO2 is the LED on an ESP32 DevKit V1, and it is also a strapping pin, so
// it is high at boot on some boards and low on others. It settles as soon as
// pinMode runs.

const int kLed = LED_BUILTIN; // GPIO2, on the board
const int kWired = 4;         // an LED and a resistor to ground

void setup()
{
    pinMode(kLed, OUTPUT);
    pinMode(kWired, OUTPUT);
}

void loop()
{
    digitalWrite(kLed, HIGH);
    digitalWrite(kWired, LOW);
    delay(500);
    digitalWrite(kLed, LOW);
    digitalWrite(kWired, HIGH);
    delay(500);
}

Code walkthrough

The key functions of the sketch, and what each one does.

setup sketch.ino

Runs once when the board starts. It gets the pins and libraries ready.

void setup()
{
    pinMode(kLed, OUTPUT);
    pinMode(kWired, OUTPUT);
}

loop sketch.ino

Runs over and over for as long as the board has power. This is where the project does its work.

void loop()
{
    digitalWrite(kLed, HIGH);
    digitalWrite(kWired, LOW);
    delay(500);
    digitalWrite(kLed, LOW);
    digitalWrite(kWired, HIGH);
    delay(500);
}

Troubleshooting

The usual mistakes with this circuit, and the fix for each.

  • The LED is dim, burns out, or the pin reads wrong because the resistor value is off. Resistor
    Read the color bands again. A 220 ohm to 330 ohm resistor suits a typical LED on 5 V. 10k is a common pull-up or pull-down value. Check with a multimeter if unsure.
  • A pull-up or pull-down resistor is missing, so the input floats and reads random values. Resistor
    Tie the input to 5 V or ground through about 10k. Or use INPUT_PULLUP and wire the switch to ground.
  • The LED does not light, or it lights once and then dies. LED
    LEDs have polarity. The longer leg (anode) goes toward the positive side. Always add a series resistor, about 220 ohms to 1 k ohm on a 5 V pin.
  • A blue or white LED stays dark on 3.3 V. LED
    Blue and white LEDs drop about 3 V, so 3.3 V leaves almost nothing for the resistor. Use a 5 V supply, or a smaller resistor and a red or green LED.

Change it and keep it

Open it in the editor, change the circuit or the code, and keep your version in a free account.