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.
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's LilyPad Arduino 328 Main Board v21 schematic. The listing says 16MHz and 'compatible with Arduino', 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: 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: One input and one output pad; the buzzer is rated for 3-5 V, inside the board's 2.7-5.5 V supply range.
- Temperature indicator: 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)
- Running at 16 MHz from a low battery voltage: the chip's speed grade is 0-10 MHz at 2.7-5.5 V and 20 MHz needs 4.5-5.5 V (source: link, 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)
Not covered by the official source
- Memory sizes are not stated: the original maker'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.