LilyPad Buttons and Switches

Pages
Contributors: Gella
Favorited Favorite 3

Introduction

Buttons, slide switches, and reed switches are electronic components you can use to control a project, turn it on or off, or trigger behaviors in the code of a program. This guide will provide an overview of the options available in the LilyPad sewable electronics line and some examples of using them in a project.

LilyPad Button Board

LilyPad Button Board

DEV-08776
$2.10
10
LilyPad Slide Switch

LilyPad Slide Switch

DEV-09350
$1.99
2
LilyPad Reed Switch

LilyPad Reed Switch

DEV-13343
$4.50
1

You can also explore buttons and switches in a pre-wired circuit using the E-Sewing ProtoSnap or with Arduino in the LilyPad ProtoSnap Plus.

LilyPad E-Sewing ProtoSnap

LilyPad E-Sewing ProtoSnap

DEV-14546
$6.95
4
LilyPad ProtoSnap Plus

LilyPad ProtoSnap Plus

DEV-14346
$42.95

Suggested Reading

Here are some additional resources to check out before you begin:

Button and Switch Basics

A tutorial on electronics' most overlooked and underappreciated component: the switch! Here we explain the difference between momentary and maintained switches and what all those acronyms (NO, NC, SPDT, SPST, ...) stand for.

LilyPad Basics: E-Sewing

Learn how to use conductive thread with LilyPad components.

Getting Started with LilyPad

An introduction to the LilyPad ecosystem - a set of sewable electronic pieces designed to help you build soft, sewable, interactive e-textile projects.

What are Buttons and Switches?

Buttons and switches are electronic components that control the flow of current in a circuit. They can act as a simple gateway to light up an LED or as inputs for a microcontroller. Buttons are considered a type of switch, often with a momentary push actuation. We'll refer to both as switches in this section.

Switch States

To change a switch from one state to another requires a physical action, often a flip, slide, or push. This is called actuating the switch. Different types of switches have different actuation methods. In the LilyPad line you can activate switches by sliding, pushing, and even using a magnet to trigger.

Maintained vs Momentary Switches

Switches that stay in one state until changed are called maintained switches. Examples of some common maintained switches are light switches, on/off switches on devices, and toggle switches. The LilyPad Slide Switch is an example of a maintained switch.

A momentary switch is only active when being actuated. Push buttons are a common example of a momentary switch. Other momentary switches you may find around you are the keys on your keyboard - a letter is only typed when the key is pressed. The LilyPad Button is an example of a momentary switch.

LilyPad Slide Switch

The LilyPad Slide Switch has a small switch labeled ON/OFF. When moved to the OFF position, parts inside the switch move away from each other and open the circuit (disconnecting it). No current will flow through the switch to the components connected to its sew tabs. When the toggle switch is moved to the ON position, the two sew tabs on the switch are connected, allowing current to flow through and close the circuit.

Detail of using LilyPad Switch

Using a LilyPad Slide Switch on the LilyPad ProtoSnap Plus

Examples

Slide switches can be used to control individual LEDs in an e-sewing project. Here's an example of using three slide switches connnected with conductive thread to control each color channel on a LilyPad TriColor LED.

Tri-Color LED stitched with conductive thread to three LilyPad Switches and a LilyPad Battery Holder

Simple color mixing circuit using LilyPad Switches connected to each color tab of the tri-color LED.

A slide switch can also be used to turn off an element in a project, such as a buzzer or indicator while debugging or when you want a bit of peace and quiet. The example below shows a slide switch sewn in a LilyPad Buzzer. This allows the other features of the project to still function while disconnecting power to the buzzer.

Piezo buzzer sewn into a circuit with a slide switch

You can also connect the slide switch to a LilyPad Arduino and read its state in your programs. Here's an example of using a LilyPad Button and LilyPad Switch in a project on the LilyPad ProtoSnap Plus to control LEDs.

This wearable dice project tutorial utilizes seven slide switches to select from a 4, 6, 8, 10, 12, 20, and 100 side virtual dice for gaming.

Dungeons and Dragons Dice Gauntlet

August 13, 2013

A playful, geeky tutorial for a leather bracer that uses a LilyPad Arduino, LilyPad accelerometer, and seven segment display to roll virtual 4, 6, 8, 10, 12, 20, and 100 side dice for gaming.

LilyPad Reed Switch

The LilyPad Reed Switch is another kind of switch available in the LilyPad line. Unlike the other LilyPad switch offerings, the reed switch does not require you to touch the board to activate it. Inside the reed switch are two thin pieces of metal that are pulled in contact with each other when exposed to a magnetic field.

Read more about how to use it in the full hookup guide.

LilyPad Reed Switch Hookup Guide

November 5, 2015

A guide to using the LilyPad Reed Switch breakout in your projects.

Examples

In this episode of Electricute, Dia and Nick build an interactive Krampus stocking using the LilyPad Reed Switch and a magnet.

LilyPad Button

The LilyPad Button Board is also a type of switch. When you press the button in the middle of the board, it connects the two sew tabs and allows current to flow through. When you let go of the button, the connection is opened again, and the button springs back into place. This button is an example of a momentary switch.

Pressing LilyPad button on E-Sewing ProtoSnap

Pressing the LilyPad Button on the E-Sewing ProtoSnap

Examples

This stuffed creature uses both a slide switch and button to control LEDs embedded in it.

Light-Up Plush

December 16, 2016

Craft a light-up plush with LilyPad LEDs controlled by pressing a button and sliding a switch in the creature's hands.

Here's an example of a button being used as an input connected to the LilyMini microcontroller to switch LED modes.

Resources and Going Further

In addition to using LilyPad pieces to add interactivity to your projects, you can also create your own custom buttons and switches. Check out these blog posts for more:

Ready to add some interactivity to a project using LilyPad Arduino? Check out the ProtoSnap Plus Activity Guide for code examples to follow along with.

LilyPad ProtoSnap Plus Activity Guide

December 7, 2017

Learn how to program in Arduino with the LilyPad ProtoSnap Plus. This guide includes 10 example activities that use the pre-wired LilyPad boards on the LilyPad ProtoSnap Plus.

For inspiration, have a look at some of the following projects!

Soft Circuits: LED Feelings Pizza

Here we will learn how to say how you feel with pizza. Electric pizza.

ProtoSnap LilyPad Development Simple Hookup Guide

Interested in getting into LilyPad? Or maybe it's Arduino that tickles your fancy? Just want to add a little white-blinky-LED zest to your vest? All of the above? The ProtoSnap LilyPad Simple is a great tool to explore any of these subjects.

Getting Started with Electroluminescent (EL) Wire

This guide will help you get started with electroluminescent (EL) wire, tape, panel, chasing wire, and bendable wire to let your project glow!

Pokémon Go Patches with EL Panels

Add a cloth stencil over EL panels to create glowing logos and designs.