Supplier photo of an assembled radio kit with a purple circuit board, telescopic antenna and clear case.
Supplier photo
Temu affiliate offer ยท Project idea

Build a radio

Soldering required. Check the supplied parts and board revision.

View kit on Temu

Tricky Circuit may earn a commission through these links. Product ideas have not been bench-tested by Tricky Circuit and are not verified lesson parts lists.

๐ŸŽฎ Experimenting with Buttons and Arduino

Exploring buttons with Arduino opens up many fun and educational opportunities. Hereโ€™s a step-by-step guide on setting up a basic project to control an LED using a button.

๐Ÿ”ง Components Needed

  • Arduino Uno ๐Ÿ› ๏ธ
  • Breadboard ๐Ÿงฐ
  • LED ๐Ÿ’ก
  • 220-ohm Resistor โšก
  • Pushbutton ๐Ÿ”˜
  • Jumper Wires ๐Ÿš€

๐Ÿ”จ Circuit Setup

  1. LED Connection:
    • Anode (longer leg) โžก๏ธ Connected to Arduino pin 13.
    • Cathode (shorter leg) โžก๏ธ Connected through a 220-ohm resistor to GND.
  2. Button Setup:
    • One Terminal โžก๏ธ Connected to Arduino pin 2.
    • Other Terminal โžก๏ธ Connected to GND.
    • Use the internal pull-up resistor in your Arduino setup for simplicity.

๐Ÿ“ Sample Code

int ledPin = 13;             // LED connected to digital pin 13
int buttonPin = 2;           // Button connected to digital pin 2
int buttonState = 0;         // Variable to store the button status

void setup() {
  pinMode(ledPin, OUTPUT);             // Set the LED pin as output
  pinMode(buttonPin, INPUT_PULLUP);    // Set the button pin as input with pull-up resistor
}

void loop() {
  buttonState = digitalRead(buttonPin);  // Read the state of the button
  if (buttonState == LOW) {             // Check if the button is pressed
    digitalWrite(ledPin, HIGH);         // Turn LED on
  } else {
    digitalWrite(ledPin, LOW);          // Turn LED off
  }
}

๐Ÿ’ก Expanding Your Project

  • Menu Navigation: Use multiple buttons to navigate through an LCD menu system. ๐Ÿ“ฒ
  • Game Controls: Create simple games using buttons for actions like jumping or moving. ๐ŸŽฒ
  • Music Player: Use buttons to control the playback of sounds or music. ๐ŸŽต

Temu affiliate offer

Optional accessory for this article

For the button and current-limited indicator in this experiment, a small solderless board keeps the connections easy to change. The Temu listing is a four-pack of 400-point boards; one board can support this small signal circuit after its contact groups are checked.

Some links below are Temu affiliate links. Tricky Circuit may earn a commission if you buy through them.

YIDI 400-point solderless breadboards, 4-pack โ€” view Temu offer

๐Ÿ“กBroadcast the signal โ€” amplify the connection.

Leave a Reply

Temu affiliate offers

Find your next electronics project

Explore these do-it-yourself project kits. Check the selected option, included parts and instructions on each offer.

Tricky Circuit may earn a commission if you buy through these Temu affiliate links. These are product ideas; they have not been bench-tested by Tricky Circuit and are not verified lesson parts lists.

Supplier photo of an assembled infinity mirror light cube illuminated on a dark background.

Supplier product photo

Build an infinity light cube

Listing specifies 5-volt direct current. Soldering required; battery and glue not included.

View kit on Temu

Supplier photo of a breadboard, jumper wires and assorted electronic components in a plastic storage case.

Supplier product photo

Try breadboard experiments

Breadboard, wires and assorted parts. Arduino controller board not included.

View kit on Temu

Supplier photo of an assembled blue surface-mount soldering practice board with a circular ring of small lights.

Supplier product photo

Solder a chasing-light board

Surface-mount soldering practice. Battery and battery holder not included.

View kit on Temu