MakerLab
ArduinoLilyPad Arduino

MakerLab Reference: The LilyPad Arduino

A washable, sewable microcontroller board designed for wearable electronics and soft circuitry.

LilyPad Arduino

The LilyPad Arduino is a unique microcontroller board developed by Leah Buechley and the Arduino team, specifically for wearable technology and e-textiles. Unlike traditional rigid PCBs, the LilyPad features a small, round, and flexible circuit board that can be easily sewn into fabric using conductive thread. This design makes it ideal for projects where flexibility, comfort, and integration with textiles are paramount, such as interactive clothing, smart accessories, and soft robotic applications.

At its heart, the LilyPad Arduino is powered by the same microcontroller found in the original Arduino Uno: the ATmega168. This 8-bit AVR RISC microcontroller offers a good balance of processing power and low power consumption, making it suitable for a wide range of embedded tasks. It features 16KB of Flash memory for program storage, 1KB of SRAM for data, and 512 bytes of EEPROM for persistent data storage. The ATmega168 operates at a clock speed of 16 MHz, providing sufficient performance for many interactive projects.

Released around 2007, the LilyPad Arduino predates many of the more specialized microcontroller boards available today, carving out a niche for itself in the burgeoning field of e-textiles. Its design philosophy emphasizes integration with fabric, allowing makers to create truly seamless electronic garments. While it shares the ATmega168 microcontroller with the classic Arduino Uno, its physical form factor and intended applications are distinct, making it a go-to choice for anyone looking to embed intelligence into textiles without the bulk of traditional boards.

The LilyPad Arduino is best suited for makers, students, and designers interested in wearable computing, interactive art, and e-textiles. Its sewable nature simplifies the process of integrating electronics into clothing and accessories, making it accessible even to those with limited soldering experience. For beginners, it offers a gentle introduction to microcontrollers within a creative and fashion-oriented context, while experienced engineers can leverage its unique form factor for innovative product development.

Watch

Related video, embedded from YouTube.

Specifications

Microcontroller / SoCAtmel ATmega168
Architecture8-bit AVR RISC
Clock speed16 MHz
Flash / Storage16 KB (of which 2 KB used by bootloader)
RAM / SRAM1 KB
Operating voltage3.3V
Digital I/O pins14 (of which 6 can be used as PWM outputs)
Analog / ADC6 (10-bit resolution)
PWM6 pins (3, 5, 6, 9, 10, 11)
Connectivityโ€”
USBโ€” (Requires external USB-to-serial adapter for programming)
Power inputRecommended 3.7V LiPo battery, or 5V via FTDI adapter
Dimensions~50mm diameter

Pinout & pin functions

PinFunction
3.3VPower output (regulated)
GNDGround
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 (SDA)
A5Analog Input / Digital I/O (SCL)
D9Digital I/O, PWM
D10Digital I/O, PWM, SS (SPI Slave Select)
D11Digital I/O, PWM, MOSI (SPI Master Out Slave In)
D12Digital I/O, MISO (SPI Master In Slave Out)
D13Digital I/O, SCK (SPI Clock)
D8Digital I/O
D7Digital I/O
D6Digital I/O, PWM
D5Digital I/O, PWM
D4Digital I/O
D3Digital I/O, PWM
D2Digital I/O
D1Digital I/O, RX (UART Receive)
D0Digital I/O, TX (UART Transmit)
RESETReset pin (active low)
VCCPower input (unregulated, typically LiPo battery)

Wiring & circuit basics

Powering the LilyPad Arduino requires careful consideration, especially given its wearable nature. The board is designed to run at 3.3V, and its VCC pin accepts an unregulated input, typically from a single-cell LiPo battery (around 3.7V nominal). The onboard voltage regulator will then provide a stable 3.3V to the microcontroller and other components. Avoid applying more than 5V to the VCC pin, as this can damage the regulator and the board. For programming or testing without a battery, a 5V supply can be connected via an FTDI-compatible USB-to-serial adapter connected to the TX, RX, and GND pins, with the adapter's 5V output connected to the LilyPad's VCC pin.

When connecting external components, always respect the LilyPad's 3.3V logic level. Connecting 5V logic devices directly to the LilyPad's input pins might damage the ATmega168. Conversely, connecting 3.3V outputs from the LilyPad to 5V-tolerant inputs of other devices is generally safe, but it's good practice to use level shifters if unsure. For example, to light an LED, connect a digital output pin (e.g., D5) through a current-limiting resistor (typically 220-470 ohms for standard LEDs) to the LED's anode, with the LED's cathode connected to a GND pin on the LilyPad. Ensure the resistor value is appropriate for 3.3V operation.

For more complex sensors, like an I2C device (e.g., an MPU-6050 accelerometer/gyroscope), you would connect the sensor's VCC to the LilyPad's 3.3V pin, GND to GND, SDA to A4, and SCL to A5. Remember to check the sensor's datasheet for its operating voltage and logic levels; if it's a 5V device, a level shifter will be necessary between the LilyPad and the sensor's data lines.

Programming & getting started

The LilyPad Arduino is programmed using the Arduino IDE, the same familiar environment used for most Arduino boards. Connect the LilyPad to your computer using an FTDI-compatible USB-to-serial adapter (e.g., FTDI232RL or similar). Connect the adapter's TX pin to the LilyPad's RX (D1), the adapter's RX pin to the LilyPad's TX (D0), and the adapter's GND to the LilyPad's GND. Power the LilyPad by connecting the adapter's 5V output to the LilyPad's VCC pin. Select 'LilyPad Arduino USB' or 'Arduino Uno' as the board in the Arduino IDE, choose the correct serial port, and upload your sketch. For automatic reset, you may need to manually press the LilyPad's reset button when the IDE indicates it's compiling.

For your first program, you can upload the classic 'Blink' sketch. Modify the pin number in the `pinMode()` and `digitalWrite()` functions to one of the digital pins, such as D13 (which is often connected to an onboard LED on many Arduino variants, though not explicitly on the LilyPad itself, so you'd connect an external LED here). Ensure the LED is wired correctly with a current-limiting resistor. Once uploaded, the LED should blink, confirming your setup and programming workflow are functional.

Project ideas

Interactive LED ScarfCreate a scarf that changes LED patterns based on ambient light or sound. Uses analog input pins for sensors and digital PWM pins to control LED brightness and color, teaching sensor integration and dynamic output.
Conductive Thread Game ControllerBuild a wearable game controller sewn into gloves or sleeves. Utilizes digital input pins to detect button presses (conductive pads) and potentially vibration motors for feedback, exploring soft circuitry and input handling.
Smart Plant Watering MonitorIntegrate a soil moisture sensor and a small buzzer into a plant pot. Uses an analog input for the sensor and a digital output for the buzzer, demonstrating basic environmental monitoring and alert systems.
E-Textile Heartbeat MonitorCreate a simple garment that displays a pulsing LED synchronized with a detected heartbeat using a pulse sensor. Leverages analog input for the sensor and PWM output for LED control, teaching bio-feedback and signal processing.
Wearable Navigation AssistantDevelop a vest with haptic feedback motors that vibrate to indicate direction. Uses digital output pins to control motors based on input from a compass module (via I2C or SPI), teaching directional control and user interface design.
Sewable Sound VisualizerDesign a piece of clothing where LEDs react to music or sound input. Employs analog input for audio signals (via an amplifier circuit) and multiple PWM pins for controlling LED patterns, exploring audio processing and visual output.

Buying tips & gotchas

When purchasing a LilyPad Arduino, be aware of the numerous clones and variants available. While many function similarly, quality can vary. Look for boards explicitly stating they use the ATmega168 or ATmega328 microcontroller for compatibility. Ensure you have an FTDI-compatible USB-to-serial adapter, as the LilyPad lacks onboard USB. Essential accessories include conductive thread, sewable LEDs, small tactile switches, and LiPo batteries. Common pitfalls include incorrect wiring (especially polarity for batteries and LEDs), using 5V logic with 3.3V components, and breaking delicate traces when sewing. Always use a current-limiting resistor with LEDs.