Arduino LED Button Project: Your First Build in 30 Minutes

Arduino LED Button Project: Your First Build in 30 Minutes

Your first Arduino LED button project is the best possible starting point in electronics: a push button that makes an LED blink faster with every press. No soldering, seven cheap parts, about 30 minutes of hands-on time — and by the end you will have wired a real circuit and uploaded real code.

Quick answer: Wire a push button to GPIO4 and an LED to GPIO5 of an ESP32-DEVKITC board, upload a short sketch that uses INPUT_PULLUP, and every button press makes the LED blink faster. The full parts tray costs Rs.664 (Rs.524 if you skip the optional power adapter), and nothing needs soldering.

Proof of work: we built this exact project through Soldr, Compoden's AI build assistant, on 10 August 2026 — every screenshot below is from that session. Published 10 August 2026 · Last updated 11 August 2026.

What parts do you need for a button-controlled LED?

You need seven parts: an ESP32-DEVKITC development board, a tactile push button, an LED (our session used an RGB LED), a resistor pack, a mini breadboard, jumper wires, and optionally a power adapter. The whole tray costs Rs.664 from Compoden; Rs.524 without the adapter. Everything plugs together — no soldering iron required.

Why an ESP32 board and not the classic Arduino Uno? Soldr picked the ESP32-DEVKITC Development Board for this exact session, not the Uno — it does everything an Arduino Uno does for this circuit, adds WiFi and Bluetooth for whenever you outgrow blinking an LED, and it programs through the same free Arduino IDE. As Soldr's own reasoning put it: "This controller was chosen because it is the lowest-cost listed board that meets the requirement; you can choose another board from the available options." "Arduino project" here means the software and workflow, not one specific board — this guide follows the board Soldr actually carded, because that is the tray you will get if you ask the same question.

This is the exact tray Soldr assembled for our session, verified against live catalog prices:

Parts list for the button-controlled LED project (prices checked August 2026)
Part Qty Price (Rs.) Where to buy
ESP32-DEVKITC Development Board (WiFi + Bluetooth) 1 340 ESP32-DEVKITC Development Board
Tactile Push Button Switch With Yellow Round Cap 1 14 Tactile Push Button Switch With Yellow Round Cap
5mm Common-Cathode RGB LED (pack of 5) 1 15 5mm Common-Cathode RGB LED
Resistor Variety Pack — 100 pcs, 10 values, 1/4W carbon film 1 75 Resistor Variety Pack (10 values, 1/4W)
400-Point Mini Solderless Breadboard 1 40 400-Point Mini Solderless Breadboard
Male-to-Male Breadboard Jumper Wires (20cm, pack of 20) 1 40 Male-to-Male Breadboard Jumper Wires
5V 2A Micro-USB Power Adapter (optional — see note) 1 140 5V 2A Micro-USB Power Adapter
Total 664 Cash on delivery available across India

One tray, one honest note. The 5V 2A adapter's micro-USB plug does match this ESP32 board's micro-USB power port exactly — no mismatch this time. But it is not what you program the board with: that is a micro-USB data cable from your laptop (not included in this tray — you likely already own one from a phone charger or power bank), and that same cable powers the board while you are sitting at your desk. Skip the wall adapter for this build and it costs Rs.524. Buy the adapter later when a finished project needs to run unattended, off the wall instead of a laptop.

Tools: a laptop with the free Arduino IDE installed, plus the ESP32 board package added once through the IDE's Boards Manager (a five-minute one-time download — see Step 5), and a micro-USB data cable for the board. That is all.

Step 1: Describe the project to Soldr in one sentence

Open Soldr and type what you want in plain words. Our exact prompt was: "I want to build my first project ever - a blinking LED that speeds up each time I press a button. Complete beginner, never touched electronics." Notice we never named a single part — that is the point.

Soldr parts tray for a first Arduino project: 7 parts including ESP32-DEVKITC board Rs.340, push button Rs.14, RGB LED Rs.15
Proof from our 10 August 2026 session: Soldr turned one beginner sentence into a 7-part tray with live Rs. prices, per-part explanations, and a build profile rating the project "Beginner (every part plugs in, no soldering)".

Soldr replied with a plain-English explanation of every part — why the button changes the blink speed, why the resistor pack protects the LED, why the breadboard means no soldering — plus a specifications block and a warning about the classic beginner traps: an unsuitable resistor value, wiring the common-cathode RGB LED backwards, and treating button contact bounce as multiple presses. It also flagged the one rule that matters most on this board: "the controller uses 3.3V logic while the adapter outputs 5V, so the stated power-input path must be used rather than applying 5V to a 3.3V pin" — the adapter's 5V goes into the board's power input, never straight onto a GPIO pin. Soldr's own estimate: the active parts draw roughly 610mA in total.

Checkpoint: your parts tray shows 7 parts, all marked in stock, with a total around Rs.664.

Step 2: Get the parts on your table

Order the tray (every part above was in stock during our session, and cash on delivery is available) or raid a kit you already own. Before wiring anything, lay the seven parts out and identify them: the board, the button with its yellow cap, the RGB LED with four legs of different lengths, the resistor pack, the small breadboard, and the jumper wires.

From the resistor pack, pull out one 220-ohm resistor — the bands read red-red-brown. Getting this value right matters: Soldr's session notes flagged "choosing an unsuitable resistor value" as one of the most common failures in this build.

Checkpoint: all seven parts identified, one 220-ohm resistor separated from the pack.

Step 3: Wire the button and the LED

We asked Soldr: "how do I wire everything? show me the wiring" — and 2.6 seconds later it mapped the whole build: power to the 3.3V/5V rail, grounds to GND, and each signal line to a GPIO pin, with a schematic drawn from the exact parts in the tray.

Soldr wiring answer for the ESP32-DEVKITC build: power to the rail, ground to GND, signal lines to GPIO4 and GPIO5
Proof from the session: asked for wiring, Soldr answered in 2.6 seconds — every connection mapped around the ESP32-DEVKITC board with the parts kept exactly as carded.

Here is the connection table, filled in with the exact pins from Soldr's build log. Note: verify against the schematic in your own Soldr session before powering up.

Wiring connections (from the 10 August 2026 session's build log)
From To Why
Button leg (one side) ESP32 GPIO4 GPIO4 reads the press with its internal pull-up enabled — no external resistor needed
Button leg (diagonally opposite) ESP32 GND Pressing connects GPIO4 to ground; INPUT_PULLUP reads that as LOW
RGB LED red leg 220-ohm resistor → ESP32 GPIO5 GPIO5 drives the LED; the resistor limits current at this board's 3.3V logic level
RGB LED longest leg (common cathode) ESP32 GND Shared return path for all three colours

Build the button and LED circuit on the mini breadboard first, then run jumper wires from those breadboard rows to the ESP32 board's GPIO4, GPIO5, and GND header pins — the board sits beside the breadboard rather than plugged into it. Two practical tips for this 400-point board: it does have power rails along the edges, but the catalog listing notes they can break in the middle on some units, so if a rail-fed row goes dead, wire straight to a numbered row instead of trusting the rail end to end; and straddle the button across the board's centre gap so its four legs — two internally-joined pairs — cannot short each other. Using two diagonal legs guarantees you are across the switch, not across a joined pair.

Checkpoint: four connections made, resistor in line with the LED's red leg, button straddling the centre gap. Nothing lights up yet — that is correct, there is no code on the board.

Step 4: Ask Soldr for the full code

Our second prompt was three words: "give me the full code." Soldr's build log ran 82 seconds and returned the firmware plus flash instructions: "red anode of RGB LED to GPIO5 via 220Ω resistor, common cathode to GND; button between GPIO4 and GND, internal pull-up enabled."

Soldr flash instructions: Arduino IDE, Board ESP32 Dev Module, Serial Monitor at 115200 baud, GPIO4 button GPIO5 LED
Proof from the session: Soldr's 82-second build log with flash instructions — select Board: ESP32 Dev Module, upload, open the Serial Monitor at 115200 baud, then press the button to speed up the blink.

Checkpoint: you can see flash instructions and a "full code is in the Firmware tab" link in your session.

Step 5: Upload the sketch with the Arduino IDE

If this is your first ESP32 board, the Arduino IDE does not know about it yet — the classic Arduino Uno's chip ships built in, but ESP32 support is a one-time add-on. Open Tools > Board > Boards Manager, search "esp32", and install the "esp32 by Espressif Systems" package (a few minutes on a normal connection). Once it finishes, connect the board to your laptop over a micro-USB cable, select Board: ESP32 Dev Module exactly as Soldr's flash instructions specify, pick the port that appears when you plug in, and click Upload. Then open the Serial Monitor at 115200 baud — the sketch reports every speed change there, which is your window into what the board is thinking.

If no port appears, or the upload stalls partway through, jump to the troubleshooting section below.

Checkpoint: the IDE says "Done uploading" and the Serial Monitor prints the startup line.

Step 6: Press the button — the proof

The moment the upload finishes, the LED starts blinking at a relaxed twice-per-second. Press the button: the blink visibly speeds up. Keep pressing and it gets frantic, then wraps back to slow — and every press logs the new interval to the Serial Monitor, so you can see the software and the hardware agree.

Checkpoint (success state): LED blinking, each press makes it faster, Serial Monitor printing a shrinking interval number. That is your first working embedded system — input, logic, output.

The full code

This is a reference sketch for exactly the wiring above, matching our session's flash instructions (GPIO4 button, GPIO5 LED, Serial at 115200) — the code itself lives in your session's Firmware tab, so treat this as the reference copy and verify against yours. No external libraries needed; everything here is standard Arduino ESP32 core functions, current Arduino IDE 2.x.

// Button-controlled blink: every press makes the LED blink faster.
// Board: ESP32-DEVKITC (ESP32-WROOM-32) - Arduino ESP32 core, no external libraries.

const int BUTTON_PIN = 4;   // one button leg -> GPIO4, diagonal leg -> GND
const int LED_PIN    = 5;   // RGB LED red leg -> 220 ohm -> GPIO5

unsigned long blinkInterval = 500;  // start at 500 ms per toggle
unsigned long lastBlink = 0;
unsigned long lastPress = 0;
bool ledState = false;
bool lastReading = HIGH;            // HIGH = not pressed (INPUT_PULLUP)

void setup() {
  pinMode(BUTTON_PIN, INPUT_PULLUP);  // internal pull-up: no external resistor
  pinMode(LED_PIN, OUTPUT);
  Serial.begin(115200);               // matches the session's flash instructions
  Serial.println("Button blink ready: press to speed up");
}

void loop() {
  // Blink using millis(), not delay(), so a press is never missed
  if (millis() - lastBlink >= blinkInterval) {
    lastBlink = millis();
    ledState = !ledState;
    digitalWrite(LED_PIN, ledState);
  }

  // Read the button with a 50 ms debounce window.
  // Soldr's session notes warned about switch bounce: one physical
  // press can electrically look like several - this filters it.
  bool reading = digitalRead(BUTTON_PIN);
  if (reading == LOW && lastReading == HIGH && millis() - lastPress > 50) {
    lastPress = millis();
    if (blinkInterval > 60) {
      blinkInterval -= 60;            // speed up each press
    } else {
      blinkInterval = 500;            // wrap back to slow
    }
    Serial.print("Interval now: ");
    Serial.println(blinkInterval);
  }
  lastReading = reading;
}

How does this circuit actually work?

Three ideas power this whole project. First, INPUT_PULLUP: the ESP32 has a built-in resistor that holds GPIO4 at 3.3V until the button connects it to ground, so "LOW means pressed" and you save an external resistor. Second, current limiting — and this is the one number that changes from a classic Arduino Uno tutorial: an ESP32's GPIO pins switch at 3.3V, not 5V. The red LED drops about 2.0V, so the 220-ohm resistor here passes (3.3 − 2.0) ÷ 220 ≈ 5.9mA — noticeably dimmer than the ~14mA the same resistor would pass on a 5V board, but still comfortably safe and visible. Third, non-blocking timing: the sketch checks millis() instead of sleeping in delay(), which is why it can blink and watch the button at the same time. Those three patterns reappear in almost every project you will ever build, on any board.

What if it doesn't work? Real troubleshooting

These are the failure modes Soldr's session notes called out, plus the classics we see from first-time builders and the ones specific to running this circuit at 3.3V instead of 5V. Work through them in order.

Why is the LED dim, or not lighting at all?

First check it is not simply supposed to be dim: at this board's 3.3V logic level, the red channel through a 220-ohm resistor only draws about 5.9mA — visible in a normal room, but noticeably fainter than the same circuit on a 5V Arduino Uno. If you see nothing at all, it is usually a resistor or orientation problem: confirm the resistor is really 220 ohm (red-red-brown) — the variety pack's 10k resistors look similar at a glance and drop the current to a barely-visible fraction of a milliamp. Then check the LED legs: the longest leg is the common cathode and must go to GND. If you swapped legs, the LED simply stays dark — nothing is damaged, just re-seat it.

Why does one press register as two or three jumps?

That is switch bounce — Soldr's session notes flagged it in advance: a pressed button electrically "bounces" for a few milliseconds and the program must account for it. The sketch above filters it with a 50ms debounce window. If you still see double-jumps, check the button is straddling the breadboard's centre gap and you are using diagonal legs — two legs on the same internally-joined pair act like a button that is always pressed.

Why doesn't "ESP32 Dev Module" appear in the Board menu, or the upload fails?

Most often the ESP32 board package has not been installed yet — go back to Tools > Board > Boards Manager, search "esp32", and install it; the board will not appear in the menu without it. If the package is installed but the upload still fails partway through ("Connecting..." with no response), some ESP32 boards need you to hold the onboard BOOT button while the upload starts if the automatic reset circuit does not trigger — release it once you see "Writing at..." in the console. Also try another USB cable; charge-only cables with no data lines are a notorious time thief.

Why does the board reset or the LED flicker when I press the button?

Soldr's own estimate puts this build's active parts at roughly 610mA total, which is close to the 500mA a strict USB 2.0 port is rated for — though in practice almost every modern laptop port, and any USB 3.0 or USB-C port, supplies comfortably more than that, which is exactly what powers ESP32 boards on desks worldwide every day. If you do see resets or flicker on a press, try a different USB port (prefer USB 3.0/blue-tabbed ports or a powered hub) before assuming a wiring fault — and if you plan to leave the build running unattended, that is precisely what the optional 5V 2A adapter is for.

Why do red, green, and blue look different when I try the other colours?

By more than just brightness at this voltage. The session's spec sheet lists the RGB LED's forward voltages as roughly 2.0V for red and 3.3V for green and blue. On a 5V board that still leaves headroom for all three colours — but on this ESP32's 3.3V logic, driving green or blue through the same setup leaves almost no voltage across the resistor at all, so those channels will glow very faintly or stay dark even though the circuit is wired correctly. If you want to light green or blue later, you will likely need to drive them from a 5V-tolerant path or accept the dimmer 3.3V result — this is a genuine limit of pairing a 3.3V controller with a 5V-rated RGB LED, not a wiring mistake.

What should you build next?

You now own the three skills every project reuses: reading an input, timing without delay(), and driving an output — on a board that already has WiFi and Bluetooth built in for when you are ready to use them. The next rung on the ladder is our soil moisture monitor with OLED display build — a real sensor, a real display, same Soldr workflow. After that, our ESP32 temperature and humidity dashboard build puts this exact board's WiFi to work for the first time.

Or start your own build right now: open Soldr, Compoden's AI build assistant, describe what you want in one sentence — like we did — and it specs the kit, maps the wiring, and writes the code for your exact parts.

Frequently asked questions

Arduino button LED project ke liye kaunse parts chahiye?

You need seven parts: an ESP32-DEVKITC development board (Rs.340), a tactile push button (Rs.14), a 5mm LED — we used an RGB LED (Rs.15), a 220-ohm resistor from a variety pack (Rs.75), a 400-point mini breadboard (Rs.40), jumper wires (Rs.40), and optionally a 5V 2A power adapter (Rs.140). Total: Rs.664 from Compoden, cash on delivery available.

How much does this Arduino project cost in India?

Rs.664 for the full seven-part tray from Compoden, or Rs.524 if you skip the optional power adapter and power the board from your laptop's USB port — which is all a first build needs. Prices checked August 2026; cash on delivery is available across India.

Can I use a normal single-colour LED instead of the RGB LED?

Yes — the circuit and code stay identical. Connect the single-colour LED's long leg through the 220-ohm resistor to GPIO5 and its short leg to GND. Our session's tray carried the RGB LED because it costs almost the same (Rs.15 for five) and grows with you into colour-mixing projects later, even if only the red channel lights brightly at this board's 3.3V logic.

Do I need to install any Arduino libraries for this project?

No extra libraries — only the one-time ESP32 board package (see Step 5), which is not a library but board support inside the Arduino IDE itself. Once that is installed, pinMode, digitalRead, digitalWrite, and millis() all ship with the standard Arduino ESP32 core, exactly as they do for any other board.

Back to blog