Example circuit · no uploads or API calls

A button and an LED

Hold the button to light the LED. Explore the placement, wiring, and soldering steps for a classic Arduino Nano.

Parts: classic 5 V Nano, red LED, 220 Ω resistor, two-terminal normally-open button, isolated-pad perfboard, and insulated wire.

Example: classic 5 V Nano, red LED with 220 Ω resistor, and a two-terminal normally-open button.

Use D2 with INPUT_PULLUP and D3 for the LED; power the Nano over USB.

Match the component footprints and Nano pin labels before building; this example shows only the used Nano pins.

Parts for this build

  • Arduino Nano V3

    U1 · ATmega328P, 5V

    ×1
  • 220 ohm resistor

    R1 · Axial 1/4W

    ×1
  • Red LED

    LED1 · 5mm THT

    ×1
  • Momentary pushbutton

    SW1 · SPST-NO

    ×1

Build guide

One physical action at a time

0% complete

01

Step 1 of 15

Component side

Place
ABCDEFGHIJKLMNOPQRST1234567891011121314151617181920U1 · Arduino Nano V3 · ATmega328P, 5VARDUINONANOU1.D3 · K12D3U1.D2 · K13D2U1.GND · K14GNDCOMPONENT SIDE

Instruction

Place U1 (Arduino Nano V3) in the highlighted holes at 0° orientation.

Coordinates

K12 → K14

Note: Match the component direction shown in the sketch.

Arduino sketch
const int buttonPin = 2;
const int ledPin = 3;
void setup() {
  pinMode(buttonPin, INPUT_PULLUP);
  pinMode(ledPin, OUTPUT);
}
void loop() {
  digitalWrite(ledPin, digitalRead(buttonPin) == LOW ? HIGH : LOW);
}
Start your own circuit