MakerLab
ArduinoLilyPad Arduino USB

LilyPad Arduino USB: Wearable and Flexible Microcontroller

A compact, sewable microcontroller board designed for wearable electronics and flexible circuits, featuring USB connectivity for easy programming.

LilyPad Arduino USB

The LilyPad Arduino USB is a unique microcontroller board designed by Leah Buechley and further developed by SparkFun Electronics. It's part of the Arduino family, specifically engineered for integration into textiles and wearable projects. Unlike traditional rigid PCBs, the LilyPad features a small, round form factor with large, sewable copper pads instead of pins, making it ideal for embedding directly into fabric. This allows makers to create interactive clothing, accessories, and art installations that are both functional and aesthetically integrated.

At its core, the LilyPad Arduino USB is powered by the ATmega32U4 microcontroller. This chip is notable for its integrated USB controller, which eliminates the need for a separate USB-to-serial converter chip (like the FTDI chip found on many other Arduinos). This integration simplifies the board's design, reduces its size, and allows for direct USB programming and communication, a significant advantage for wearable projects where space and complexity are critical concerns.

The LilyPad Arduino USB sits in a niche within the Arduino ecosystem, focusing on flexibility and wearability. While it shares the ATmega32U4 with boards like the Arduino Leonardo and Micro, its physical design is distinctly different. Its sewable nature makes it a favorite among fashion technologists, artists, and hobbyists looking to add electronic interactivity to physical objects. The board is designed to withstand the rigors of being sewn into garments, though care should still be taken to protect sensitive components from excessive moisture or physical stress.

Released around 2012, the LilyPad Arduino USB was a significant step forward for wearable electronics, offering a more robust and user-friendly solution than previous attempts. It democratized the creation of interactive textiles by providing a platform that was both easy to program using the familiar Arduino IDE and simple to physically integrate into projects. This board is particularly suited for makers who want to experiment with e-textiles, interactive art, and small, flexible electronic devices where traditional boards might be too bulky or rigid.

Watch

Related video, embedded from YouTube.

Specifications

Microcontroller / SoCATmega32U4
ArchitectureAVR
Clock speed16 MHz
Flash / Storage32 KB (4 KB used by bootloader)
RAM / SRAM2.5 KB
Operating voltage3.3V
Digital I/O pins14
Analog / ADC6 (from 12-bit ADC)
PWM5 pins (digital pins 3, 5, 6, 9, 10, 11)
Connectivityโ€”
USBIntegrated ATmega32U4 (native USB)
Power input3.7V LiPo battery or 5V via USB
Dimensions~50mm diameter (round PCB)

Pinout & pin functions

PinFunction
GNDGround
VCCPower output (regulated 3.3V)
3V3Internal 3.3V regulator output (use with caution, typically not connected)
A0Analog Input / Digital I/O
A1Analog Input / Digital I/O
A2Analog Input / Digital I/O
A3Analog Input / Digital I/O
A4Analog Input / Digital I/O (I2C SDA)
A5Analog Input / Digital I/O (I2C SCL)
D0Digital I/O (RX for Serial)
D1Digital I/O (TX for Serial)
D2Digital I/O
D3Digital I/O / PWM
D4Digital I/O
D5Digital I/O / PWM
D6Digital I/O / PWM
D7Digital I/O
D8Digital I/O
D9Digital I/O / PWM
D10Digital I/O / PWM (SPI MOSI)
D11Digital I/O / PWM (SPI SCK)
D12Digital I/O (SPI MISO)
D13Digital I/O (Onboard LED)
RESETReset pin
USB D-USB Data -
USB D+USB Data +
BATBattery input (connect 3.7V LiPo here)

Wiring & circuit basics

Powering the LilyPad Arduino USB requires careful consideration of its operating voltage and power sources. The board is designed to run at 3.3V logic levels. It can be powered via its USB port, which will supply approximately 5V. Alternatively, a single-cell 3.7V LiPo battery can be connected directly to the BAT pad. The onboard 3.3V regulator will then supply power to the ATmega32U4 and other components. When connecting external components, ensure they are compatible with 3.3V logic. Connecting 5V devices directly to 3.3V pins can cause damage.

When connecting peripherals, always use the VCC pad for 3.3V power output. For digital outputs, ensure they are rated for 3.3V or use a level shifter if connecting to 5V devices. For analog inputs, the ATmega32U4 has a 10-bit ADC, but the LilyPad Arduino USB's analog pins (A0-A5) are connected to its internal 12-bit ADC, providing higher resolution. Remember that the board's sewable pads are delicate; use conductive thread or wire for connections and avoid excessive tension or sharp bends.

A simple example circuit involves lighting an LED. Connect the anode (longer leg) of an LED to a digital pin (e.g., D13, which also has an onboard LED for testing) through a current-limiting resistor (typically 220-330 ohms for a 3.3V system). Connect the cathode (shorter leg) of the LED to a GND pad. For an I2C sensor, connect its VCC to the LilyPad's VCC (3.3V), its GND to GND, its SDA pin to A4, and its SCL pin to A5. Ensure the sensor is also a 3.3V device.

Programming & getting started

The LilyPad Arduino USB is programmed using the Arduino IDE, just like most other Arduino boards. Since it features the ATmega32U4 with native USB, it enumerates as a standard USB Human Interface Device (HID) or serial port when connected to a computer. This means you don't need a separate USB-to-serial converter. To upload your first sketch, select 'Arduino Leonardo' or 'Arduino Micro' from the 'Tools > Board' menu in the Arduino IDE (as the LilyPad USB is not explicitly listed but shares the same microcontroller and bootloader). Connect the LilyPad via its USB port, select the correct COM port, and upload your code.

For more advanced users, the ATmega32U4 can also be programmed using other toolchains like PlatformIO, which offers a more integrated development environment and advanced project management features. CircuitPython and MicroPython are generally not directly supported on the ATmega32U4 due to its architecture and typical bootloader setup, which is optimized for C/C++ via the Arduino framework. Ensure you have the correct board drivers installed on your computer for the ATmega32U4 to be recognized.

Project ideas

Interactive LED ScarfCreate a scarf that changes LED patterns based on ambient light or sound. Uses digital pins for LEDs, analog pins for sensors, and the sewable nature of the LilyPad for integration into fabric.
Conductive Thread Heartbeat MonitorDesign a garment that displays a pulsing LED synchronized with a simulated heartbeat. Utilizes digital pins for LEDs and could incorporate simple button inputs, teaching basic sensor integration and output control.
Sewable E-Textile Game ControllerBuild a flexible game controller for simple games by incorporating conductive thread buttons. This project explores digital input handling and custom user interfaces on fabric.
Smart Fabric Gesture SensorDevelop a wearable sensor that detects hand gestures using conductive fabric and thread. This project delves into analog input, signal processing, and mapping sensor data to actions.
Light-Up Art InstallationIntegrate multiple LilyPads into a textile art piece, with each board controlling a set of LEDs or small motors. This project focuses on distributed control and creative application of wearable electronics.
Environmental Sensing TextileSew a patch that monitors temperature and humidity, displaying readings via small LEDs or a connected e-paper display. This project combines analog sensor readings with output display and data interpretation.

Buying tips & gotchas

When purchasing a LilyPad Arduino USB, be aware of potential clones, which may vary in quality and component specifications. Always opt for boards from reputable manufacturers like SparkFun or official Arduino distributors. Ensure you have a 3.7V LiPo battery and a compatible charger if you plan to use battery power. Conductive thread, needles, and basic fabric are essential accessories. Protect the board from moisture and sharp objects, as the sewable pads and exposed components can be fragile. For projects requiring more processing power or different peripheral sets, consider other Arduino boards or microcontrollers, but for wearable and flexible applications, the LilyPad USB remains a strong choice.