# LilyPad (ATmega328P): specs and pinout

> Round sewable-style Arduino-compatible board with an ATmega328P, 14 digital I/O pads and 6 analog pads, programmed through a 6-pin FTDI header.

[HTML version](https://soldr.ai/docs/boards/lilypad-atmega328p)

[Docs](https://soldr.ai/docs) / [Boards](https://soldr.ai/docs/boards)

Round sewable-style Arduino-compatible board with an ATmega328P, 14 digital I/O pads and 6 analog pads, programmed through a 6-pin FTDI header.

Every value cites its sourceOfficial pinout

[Buy on Compoden](https://compoden.com/products/lilypad-atmega328p-16mhz-dev-board-compatible-with-arduino)

## Specs

| Spec | Value | Source |
|---|---|---|
| Microcontroller | ATmega328P (schematic U1 ATMEGA328P_TQFP) | source Schematic v21, U1 |
| Operating voltage | 2.7 V to 5.5 V | source Schematic v21 note; https://www.sparkfun.com/products/13342 Features & Specs |
| Clock (official design) | 8 MHz crystal (Y1) | source Schematic v21, Y1 8MHZ |
| Digital I/O / analog | 14 digital I/O pins; 6 analog input pins | source Features & Specs |
| DC current per I/O pin | 40 mA | source Features & Specs; Microchip DS40002061B section 29.1, p.308 (maximum rating) |
| Programming interface | FTDI header (6 pins) | source Features & Specs; schematic JP1 |
| Chip speed grade | 0-4 MHz at 1.8-5.5 V; 0-10 MHz at 2.7-5.5 V; 0-20 MHz at 4.5-5.5 V | source Features, p.2; section 29.3 Speed Grades, p.312 |
| Chip operating temperature | -40 C to 85 C | source Features, p.2 |

## Power

| | Value | Source |
|---|---|---|
| Supply | 2.7 V to 5.5 V | source Schematic v21 note |

## Pinout

Pad names are from the original maker&#x27;s LilyPad Arduino 328 Main Board v21 schematic. The listing says 16MHz and &#x27;compatible with Arduino&#x27;, so it may be a third-party board; its crystal, power pads and layout are not covered by an official document. The schematic does not label the power sew-pads, so none are listed.

| Pin | Function | Voltage | Notes | Source |
|---|---|---|---|---|
| Pad A0 | A0 (PC0, ADC0) | VCC level | | source Schematic v21 (12/17/2015), sheet 1 |
| Pad A1 | A1 (PC1, ADC1) | VCC level | | source Schematic v21 (12/17/2015), sheet 1 |
| Pad A2 | A2 (PC2, ADC2) | VCC level | | source Schematic v21 (12/17/2015), sheet 1 |
| Pad A3 | A3 (PC3, ADC3) | VCC level | | source Schematic v21 (12/17/2015), sheet 1 |
| Pad A4 | A4 (PC4, ADC4/SDA) | VCC level | | source Schematic v21 (12/17/2015), sheet 1 |
| Pad A5 | A5 (PC5, ADC5/SCL) | VCC level | | source Schematic v21 (12/17/2015), sheet 1 |
| Pad RXI | RXI (PD0, RXD) | VCC level | Serial | source Schematic v21 (12/17/2015), sheet 1 |
| Pad TXO | TXO (PD1, TXD) | VCC level | Serial | source Schematic v21 (12/17/2015), sheet 1 |
| Pad D2 | D2 (PD2, INT0) | VCC level | | source Schematic v21 (12/17/2015), sheet 1 |
| Pad D3 | D3 (PD3, INT1) | VCC level | | source Schematic v21 (12/17/2015), sheet 1 |
| Pad D4 | D4 (PD4) | VCC level | | source Schematic v21 (12/17/2015), sheet 1 |
| Pad D5 | D5 (PD5) | VCC level | | source Schematic v21 (12/17/2015), sheet 1 |
| Pad D6 | D6 (PD6) | VCC level | | source Schematic v21 (12/17/2015), sheet 1 |
| Pad D7 | D7 (PD7) | VCC level | | source Schematic v21 (12/17/2015), sheet 1 |
| Pad D8 | D8 (PB0) | VCC level | | source Schematic v21 (12/17/2015), sheet 1 |
| Pad D9 | D9 (PB1) | VCC level | | source Schematic v21 (12/17/2015), sheet 1 |
| Pad D10 | D10 (PB2, SS) | VCC level | | source Schematic v21 (12/17/2015), sheet 1 |
| Pad D11 | D11 (PB3, MOSI) | VCC level | | source Schematic v21 (12/17/2015), sheet 1 |
| Pad D12 | D12 (PB4, MISO) | VCC level | | source Schematic v21 (12/17/2015), sheet 1 |
| Pad D13 | D13 (PB5, SCK) | VCC level | Drives the on-board blue LED through a 330 ohm resistor | source Schematic v21 (12/17/2015), sheet 1 |
| JP1 1 | DTR | | FTDI header; the schematic says it is compatible with 3.3 V or 5 V FTDI (the LilyPad FTDI is 5 V) | source Schematic v21 (12/17/2015), sheet 1, header JP1 |
| JP1 2 | RXI | | | source Schematic v21 (12/17/2015), sheet 1, header JP1 |
| JP1 3 | TXO | | | source Schematic v21 (12/17/2015), sheet 1, header JP1 |
| JP1 4 | VCC | VCC | | source Schematic v21 (12/17/2015), sheet 1, header JP1 |
| JP1 5 | CTS | | | source Schematic v21 (12/17/2015), sheet 1, header JP1 |
| JP1 6 | GND | | | source Schematic v21 (12/17/2015), sheet 1, header JP1 |

## Build with it
Project ideas for the LilyPad (ATmega328P). Each link opens Soldr with the prompt filled in; Soldr assigns the pins, checks power and shows how to wire every part.

- [Light-sensing night marker](https://app.soldr.ai/?prompt=I%20want%20to%20build%20a%20light-sensing%20night%20marker%20with%20a%20LilyPad%20board%2C%20an%20LDR%20and%20a%205mm%20LED): The LDR needs a fixed resistor to form a divider into an analog pad; the LED needs a series resistor. Supply stays inside 2.7-5.5 V.
- [Button beeper](https://app.soldr.ai/?prompt=I%20want%20to%20build%20a%20button-triggered%20beeper%20with%20a%20LilyPad%20board%2C%20a%20push%20button%20and%20an%20active%20buzzer): One input and one output pad; the buzzer is rated for 3-5 V, inside the board&#x27;s 2.7-5.5 V supply range.
- [Temperature indicator](https://app.soldr.ai/?prompt=I%20want%20to%20build%20a%20temperature%20indicator%20that%20blinks%20an%20LED%20with%20a%20LilyPad%20board%20and%20a%20DS18B20%20sensor): The DS18B20 is a digital 1-Wire part, so it needs only one pad. Learning project; not a medical thermometer.

## Common mistakes

- Plugging in an FTDI board while a battery is connected: the schematic says to disconnect the battery before plugging in the FTDI board ([source](https://cdn.sparkfun.com/datasheets/E-Textiles/Lilypad/LilyPad_Main_Board_v21.pdf))
- Running at 16 MHz from a low battery voltage: the chip&#x27;s speed grade is 0-10 MHz at 2.7-5.5 V and 20 MHz needs 4.5-5.5 V (source: [link](https://cdn.sparkfun.com/assets/9/d/0/c/e/ATmega48A-PA-88A-PA-168A-PA-328-P-DS-DS40002061B.pdf), p.2)
- Assuming a 16 MHz clock: the official LilyPad design uses an 8 MHz crystal, so timing code set for 16 MHz runs at half speed on such a board ([source](https://cdn.sparkfun.com/datasheets/E-Textiles/Lilypad/LilyPad_Main_Board_v21.pdf))

## Not covered by the official source

- Memory sizes are not stated: the original maker&#x27;s page lists 16KB flash and 1KB SRAM, which conflicts with the 328P datasheet (32 KB flash, 2 KB SRAM).
- Typical current is not given.

## Sources

- [link](https://cdn.sparkfun.com/datasheets/E-Textiles/Lilypad/LilyPad_Main_Board_v21.pdf) (the original maker&#x27;s LilyPad Main Board v21 schematic, 12/17/2015; maker&#x27;s reference design)
- [link](https://www.sparkfun.com/products/13342) (the original maker&#x27;s LilyPad Arduino 328 Main Board product page)
- [link](https://cdn.sparkfun.com/assets/9/d/0/c/e/ATmega48A-PA-88A-PA-168A-PA-328-P-DS-DS40002061B.pdf) (Microchip ATmega328P datasheet DS40002061B, a hosted copy)
