LED, pushbutton and EagLED

Build a simple circuit with an LED, pushbutton and EagLED

Written By: Cherie Tan

Dash icon
Difficulty
Easy
Steps icon
Steps
7
The EagLED is an e-textile development kit which includes a push button and several LEDs. Previously, you might have already learned to use a pushbutton with the EagLED. 

In this guide, learn to connect an LED and a pushbutton with the EagLED by using conductive thread. You will create a simple circuit that will be powered with a coin cell battery.

Complete this guide to master the basics and go on with incorporating buttons and LEDs in your wearable electronic projects.

Step 1 Overview

In this guide, we'll learn to use the EagLED with a pushbutton and LED.
For this guide, you'll need the EagLED's main board, one of its eye-shaped LEDs, a coin cell battery holder, a CR2032 coin cell battery, alligator clips for the prototyping process, conductive thread and sewing needle, fabric of your choice and some fabric scissors.

Step 2 Prototype with alligator clips

First, let's start with the prototype. Get out the alligator clips and connect the LED to the EagLED. Connect '+' on the LED to '#3' on the EagLED.
Then, connect '-' on LED to 'GND' on EagLED.
Now connect the button to the EagLED. First, connect a yellow alligator clip from the button to '#6'.
Next, connect a red alligator clip from the button to '3.3V' on the EagLED.
Then connect a black alligator clip from the button to 'GND' on the EagLED.

Step 3 Arduino sketch

const unsigned int buttonPin = 6;
const unsigned int ledPin = 3;

int buttonState = 0;
int oldButtonState = LOW;
int ledState = LOW;

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(buttonPin, INPUT_PULLUP);
}

void loop() {
  buttonState = digitalRead(buttonPin);

  if (buttonState != oldButtonState &&
      buttonState == HIGH)
  {
    ledState = (ledState == LOW ? HIGH : LOW);
    digitalWrite(ledPin, ledState);
    delay(50);
  }
  oldButtonState = buttonState;
}
Upload this code to the EagLED and test out the prototype.

Step 4 Connect the LED to EagLED

In this guide, a rectangular cut out from a sheet of felt fabric is used to create the wearable. The EagLED is then sewn onto the inner side, and the LED is sewn onto the outer side.

First, create three loops around each sew tab on the EagLED. 
Then poke the sewing needle through to the outer side to meet the LED.
Connect '#3' on EagLED to '+' on the LED.
Connect 'GND' on EagLED to '-' on LED.

Step 5 Connect button to EagLED

Next, connect the EagLED to the button. The button is sewn on the outer side:

'#6' 

''3.3V'

'GND'

Step 6 Connect coin cell battery holder to EagLED

Connect '+' of coin cell battery holder to '3.3V' on the EagLED.
Then connect '-' of the coin cell battery holder to 'GND' on the EagLED.

Step 7 Conclusion

Insert the CR2032 battery into the coin cell battery holder. 
Flick the switch to 'ON' on the EagLED and battery holder. The LED should light up on button press!