LilyPad Development Board Hookup Guide

Pages
Contributors: jimblom, Gella
Favorited Favorite 3

Introduction

Note to Users:

This resource is for users who are using the LilyPad Development Board.

For users with the LilyPad ProtoSnap Plus, please refer to the LilyPad ProtoSnap Plus Hookup Guide.

Interested in getting into LilyPad? Or maybe it's Arduino that tickles your fancy? Both? Well, whatever it is, the ProtoSnap LilyPad Development Board is a great tool to start with!

LilyPad ProtoSnap Development Board

DEV-11262
5 Retired

LilyPad Lab Pack

LAB-11762
Retired

The ProtoSnap LilyPad Development Board features a conglomerate of some of our favorite LilyPad boards. At the center of this mish-mash is our LilyPad Arduino Simple Board -- a small, LilyPad version of the popular Arduino development platform. Using the included FTDI Basic Breakout, you can program this board to work with a whole mess of inputs and outputs:

All of these are already wired up to the LilyPad Arduino Simple. Then, once you feel comfortable programming the Arduino to talk to all those boards, you can break each piece off individually and implement them into your project however you see fit. But...

Required Materials

To reprogram and recharge the board, you'll need to connect a mini-B USB cable. Double check that it is not labeled ‘Power Only’ as these type of cables will not transmit the programming data needed by the LilyPad Arduino Simple Board. If you don't have one you can get one from SparkFun:

SparkFun USB Mini-B Cable - 6 Foot

SparkFun USB Mini-B Cable - 6 Foot

CAB-11301
$4.50
3

Suggested Reading

If you aren't familiar with the following concepts, we recommend checking out these tutorials before continuing.

What is an Arduino?

What is this 'Arduino' thing anyway? This tutorials dives into what an Arduino is and along with Arduino projects and widgets.

Installing Arduino IDE

A step-by-step guide to installing and testing the Arduino software on Windows, Mac, and Linux.

Planning a Wearable Electronics Project

Tips and tricks for brainstorming and creating a wearables project.

Hardware Overview and Features

The LilyPad Development Board features twelve LilyPad components connected to a LilyPad Arduino Simple microcontroller by conductive pathways called traces. Many of these traces are hidden, but for reference, each component on the ProtoSnap has a nearby label printed in white silkscreen with the number of the LilyPad Arduino Simple sew tab it is connected to.

If you've used an Arduino before, you're probably familiar with its pins -- both digital and analog. An Arduino has 14 digital pins, and six to eight analog pins, all of which can be used to interface with other components; for instance, those surrounding the Arduino on the ProtoSnap LilyPad Development Board.

It's important to know which pin on the Arduino is tied to which component. Should you ever need a reminder of what pin connects to what, all you really need to do is look down.

LilyPad Development Board Pin Labels Annotated

But, in case your eyes aren't up to reading that tiny text, here's a list of the components that are connected to the LilyPad Arduino Simple:

LilyPad Component Arduino Pin Connected to LilyPad Arduino Simple Sew Tab Description
LilyPad Vibe Board ~3 Haptic feedback is provided with the motor's vibration and is controlled by the LilyPad Arduino Simple.
LilyPad Tri-Color (RGB) LED - Red ~9 The tri-color LED's red is controlled by the LilyPad Arduino Simple.
LilyPad Tri-Color (RGB) LED - Blue ~10 The tri-color LED's blue is controlled by the LilyPad Arduino Simple.
LilyPad Tri-Color (RGB) LED - Green ~11 The tri-color LED's green is controlled by the LilyPad Arduino Simple.
LilyPad Button A5 LilyPad Arduino Simple receives button presses as an input.
LilyPad Slide Switch 2 LilyPad Arduino Simple receives switch state (on/off) input.
LilyPad White LEDs ~5, ~6, A2, A3, A4 ✓ (all 5 LEDs) A set of white LEDs controlled by the LilyPad Arduino Simple.
LilyPad Buzzer (+) 7 A buzzer that create tones controlled by the LilyPad Arduino Simple.
LilyPad Buzzer (-) 12 A buzzer that create tones controlled by the LilyPad Arduino Simple. While normally connected to GND, it can be connected to an Arduino pin.
LilyPad Light Sensor A6 LilyPad Arduino Simple receives ambient light level input from light sensor.
LilyPad Temperature Sensor A1 LilyPad Arduino Simple receives temperature from a physical touch based on body heat and ambient conditions with the analog sensor.

LilyPad Tri-Color LED

Inside an RGB LED are three smaller LEDs - a red, green, and blue. Each of these LEDs is connected to a sew tab on the Tri-Color LED, and they are all connected through a common anode (positive) pin. Unlike other RGB LEDs, this configuration means that to light up the LED you need to ground the individual red, green, and blue LEDs instead of sending them power.

LilyPad Tri-Color LED Common Anode

LilyPad Arduino Simple Board

Most of the individual boards on the ProtoSnap LilyPad Development Board are relatively simple; they've got one big component, and maybe a few small supporting components, like resistors. But there are a few complexities to the LilyPad Arduino Simple we should overview.

LilyPad Arduino Simple Board

Features:

  • 5 Digital I/O pins
  • 4 Analog pins
  • ATmega328P
  • Built-in LED on pin 13
  • Built-in ON/OFF switch
  • Built-in power supply socket (JST connector) for a 3.7V LiPo battery and charging circuit (no additional battery charger needed)
  • Simplified layout with less pins, giving more space for sewing or less complex projects

Central to the Simple board is the ATmega328 -- the big black square in the middle of the board. This is the microprocessor, the "brains of the operation." This is what stores and executes your Arduino sketch. Surrounding the ATmega328 are a few passive supporting components, nothing all that important to you.

LilyPad Arduino Simple Atmega328P

To the right of the ATmega328 (though it'll be hard to see unless it's lit) is a tiny little LED. This could be classified as the most important component on the Arduino. The LED is tied to Arduino pin 13, and can be used for all your blinking needs. At the top left, there's a momentary push button, used to reset the ATmega328. This will make whatever sketch the Arduino is running start from the very top again.

LilyPad Arduino Simple Built-In LED

There's an On/Off slide switch under the ATmega328. The functionality of that is pretty obvious, but it can be a little misleading. There are a few ways to power the ProtoSnap LilyPad Development Board, and in most cases, you'll probably use the included FTDI board to power it using your computer's USB. If the board is powered by the FTDI board, the On/Off switch will do absolutely nothing. The switch only controls power to the Arduino if you're powering it via that little white connector to the left of the ATmega.

LilyPad Arduino Simple Battery Power Switch

The white connector on the Simple board is a somewhat common power connector, hailing from the JST family of connectors. It's mainly geared towards connecting one of our Lithium Polymer batteries. LiPo's are rechargable batteries, so we've also included a battery charger on the LilyPad Arduino Simple. So if you have the battery plugged in, and an FTDI Basic Breakout connected, you can charge the battery from your computer.

LilyPad Arduino Simple JST Connector

Oh, and where do you connect the FTDI board? Well, spiking up at the top of the Arduino Simple is a right-angle six-pin male header. The female header on the FTDI board should slide smoothly onto that connector.

LilyPad Arduino Simple FTDI Programming Header

Powering the LilyPad Development Board

The LilyPad LilyPad Development Board can be powered in two ways:

  • If you have a USB power source available (a computer, 5V USB wall adapter, USB battery pack, etc.), you can run the board from a USB cable and FTDI.

  • If you'd like your project to be more portable, you can easily attach a rechargable Lithium-polymer battery to the board. See Technical Notes section for more information on batteries and charging.

Exploring the Sample Circuit

The LilyPad Development Board ships with pre-loaded code that showcases all of the LilyPad pieces connected to it. To power up the LilyPad Development Board, connect it to your computer using a FTDI and mini-B USB cable, or attach an E-Textiles Battery. Then slide the switch on the right side of the LilyPad Arduino Simple to the ON position.

First the white LEDs turn on individually one at a time. Then the RGB LED will blink each color. Once the sequence completes, the LilyPad Development Board will be ready to take inputs! Try placing your finger over the temperature sensor. Once the sensor reads a certain threshold, the red LED will light up. Placing your finger over the light sensor will turn on the white LEDs. Pressing on the momentary push button will cause the buzzer to make some noise. Flipping the LilyPad slide switch (located on the bottom left side of the board) to the ON position will cause the vibe motor to begin vibrating for haptic feedback.

LilyPad Development Board Demo

Setting Up Arduino

Note: This guide assumes you are using the latest version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE.

Installing Arduino IDE

March 26, 2013

A step-by-step guide to installing and testing the Arduino software on Windows, Mac, and Linux.

Install FTDI Drivers

If you've never used a LilyPad Arduino before, you will need to install FTDI drivers. Depending on your computer’s operating system, you will need to follow specific instructions. Please go to How to Install FTDI Drivers, for specific instructions on how to install the FTDI drivers onto your computer.


USB Serial Driver Quick Install

August 31, 2017

How to install USB serial drivers on Windows, MacOS , and Linux.

Note that you won't have to install the FTDI drivers again.

Uploading Code

You will need to perform the below three steps every time you want to program the board. These three steps are:

1. Connect the LilyPad Development Board to your computer using the FTDI board and a USB cable.
2. Select "LilyPad Arduino" from Arduino's "Board" menu.
3. Select "ATmega328" from Arduino's "Processor" menu.
4. Select the serial port the LilyPad is connected to from Arduino's "Port" menu.

Let's go over the three steps in detail:

1. Connect the LilyPad Development Board to Your Computer

Place the LilyPad Development Board on a clean, non-metal work surface. Connect the LilyPad FTDI Board to the headers on the LilyPad Arduino Simple at the center of the Development Board.

Attach FTDI to LilyPad Development Board

Connect the other side of the FTDI board to a mini-B USB cable.The cable can only be inserted one way, and should snap in securely.

Attach USB Cable to LilyPad Development Board

Then connect the other end of the USB cable to a USB port on your computer.

Connect LilyPad Development Board to Computer

Slide the switch on the LilyPad Arduino to the ON position. You will not be able to upload code to the board if it is set to the OFF position.

Turn LilyPad Development Board's Switch to ON Position

2. Select LilyPad Arduino from the Board Menu

To program the LilyPad Arduino Simple at the center of the LilyPad Development Board, open the Tools > Board list and select LilyPad Arduino. A dot (Windows) or check mark (Mac) will show next to the board in the menu when it is selected, and it will show next to Board in the Tools menu.

Select LilyPad Development Board in Arduino IDE

3. Select ATmega328 from the Processor Menu

After selecting the LilyPad Arduino, there will be two options available in the next menu down labeled Processor. Select ATmega328 for your LilyPad Arduino.

Select ATmega328 for LilyPad Development Board in Arduino IDE

4. Select Port from the Port Menu

Arduino needs to know which port your LilyPad Arduino is attached to so it can program it. Whenever you plug a USB device into your computer, your computer will assign it a port number. Go to the Tools > Port menu, and select the port that has the LilyPad Arduino attached to it.

On Windows ports are listed as COM##; on a Mac or Linux machine they will be "/dev/cu.usbmodem####". Your screen may look different than the image below, depending on what operating system you are using.

Select LilyPad Development Board's COM Port

Troubleshooting: If you don't see a port in the menu, ensure that the board is powered up (switch in the ON position), and that the USB cable is securely connected to both the board and your computer and that you have installed the FTDI drivers. Some USB cables are only meant for charging and don't pass data - they'll power the board, but it won't show up in the port menu. If needed, try a different cable.

Upload Blink

In the world of embedded electronics, every good development platform has to have an LED, and the first test program to be run on any development platform is almost always the blinking of an LED. So let's blink that little LED on the LilyPad Simple Arduino board.

To review, once you've:

  1. Connected the LilyPad Development Board to your computer using the FTDI and USB cable.
  2. Selected the board type ("LilyPad Arduino" as the board and ATmega328 as the processor).
  3. Selected the COM port from the "Port" menu.

You are ready to upload code! Let's upload some code to try it out.

Load the "Blink" example from the menu File > Examples > 01.Basics > Blink, and click the "Upload" button (the large round button with the right arrow in it). This is a very simple example program; it just blinks a LED on and off once per second.

Blink Example

Arduino will compile the code, then send it to the LilyPad Arduino Simple via the USB cable. While the code is uploading, the built-in LED will blink to signal the code is transferring. When the code finally runs, the LED at the center of the board will slowly blink green. Success!

If this all works, congratulations! You're all set up and ready to prototype with the LilyPad Development Board.

Default Example Code

If you are interested in re-uploading the default example code that you explored earlier, it is available in the product GitHub repository and in the download button shown below.

Beyond the Blinking

Well, we've just opened an enormous can of worms, and you've taken your first step into the life-consuming world of Arduino. From here, you may want to explore some of Arduino's other example sketches. There's one for the button (File > Examples > 2.Digital > Button), or you could fade those RGB LEDs (File > Examples > 1.Basics > Fade), or you could play a song on the buzzer (File > Examples > 2.Digital > toneMelody), or maybe try adapting the AnalogInOutSerial sketch (File > Examples > 3.Analog > AnalogInOutSerial) to the temperature and light sensors. Just make sure you change the pins to their proper mapping on the LilyPad Development Board!

Uploading to the LilyPad Development Board

You can also check out the LilyPad Development Board Activity Guide:

LilyPad Development Board Activity Guide

December 7, 2017

Learn how to program in Arduino with the LilyPad Development Board. This guide includes 11 example activities that use the pre-wired LilyPad boards on the LilyPad Development Board.

Stitching Into A Project

Once you feel comfortable with the Arduino programming, maybe you'll start to feel constrained by the current configuration of the ProtoSnap LilyPad Development Board. At that point, feel free to snap each individual part off, and turn them into the next great creation! You'll have a solid foundation in Arduino programming, so you can put all your focus into getting the hardware just right.

For ideas, check out the example project used in the smaller LilyPad Development Simple board in order to snap the components and sew to fabric.

ProtoSnap LilyPad Development Simple Hookup Guide

September 5, 2013

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.

These tutorials will give you some tips and tricks for project construction and insulation:

Insulation Techniques for e-Textiles

Learn a few different ways to protect your conductive thread and LilyPad components in your next wearables project.

LilyPad Basics: E-Sewing

Learn how to use conductive thread with LilyPad components.

Technical Notes

If you’ve already programmed Arduino for a while, read on for some additional notes about the LilyPad Development Board. It’s very similar to other Arduinos, but has some special features and limitations you’ll want to know about.

Pin Numbering

Below is a list of the LilyPad Arduino Simple I/O pins and each function.

Legend:

  • n = digital pin
  • ~n = PWM-capable pin
  • n, serial = hardware serial pin for either UART, I2C, or SPI
  • An = analog-capable pin
  • (n) = internal pin (not connected to sew tab)
  • [n] = internal pin (available on an exposed via)
  • {n} = internal pin (available on male header pin)
Function Digital Analog
Rx-I {0}, RX
Tx-O {1}, TX
Slide Switch (2)
Vibe Board (~3)
White LED ~5
White LED ~6
Buzzer (7)
RGB LED - Red ~9
RGB LED - Blue ~10, SS
RGB LED - Green 11, MOSI
[12], MISO
Built-in Green LED [13], SCK
Temperature Sensor (15) (A1)
White LED 16 A2
White LED 17 A3
White LED 18 A4, SDA
Momentary Push Button 19 A5, SCL
Light Sensor (A6)

Using a LiPo Battery and Battery Charging

SparkFun sells a number of LiPo batteries compatible with this board. If you are new to the LilyPad system, we recommend the E-Textiles Battery. If you're supplying your own battery, use a single-cell (3.7V) LiPo battery with a JST connector.

Batteries with larger capacities (measured as amp-hours or Ah) will run the board longer before needing recharging. How long will depend on how many LEDs your program turns on, etc. If you're just running a few LEDs, you can expect the board to run about 5 hours for every 100mAh of battery capacity.

Charge Rate

To recharge an attached battery, plug the board into a USB power source. While the battery is charging, the "CHG" LED will illuminate. When the battery is fully charged the LED will turn off. The default charge current is set to 100mA, so a 100mAh battery will recharge in one hour, a 1000mAh battery in 10 hours, etc. Since the board is set to charge at a rate of 100mA, we do not recommend connecting a lower capacity LiPo battery (i.e. 40mAh LiPo battery) to charge.

Connecting a LiPo  Battery to the LilyPad ProtoSnap Plus

An example of inserting a LiPo battery into a JST connector on a different LilyPad board.

It is safe to leave a LiPo battery attached to the board permanently, even with USB power applied. The battery will not be overcharged.

Notes on Washing LilyPad Projects

Removing the LiPo Battery

The battery connector can be tight; to remove a battery never pull on the wires. Use a pair of needle nose pliers or cutters to gently hold pull the plug out of the connector.

Below is an image of the a LiPo battery being removed from a different LilyPad with needle nose pliers.

Removing a LiPo Battery from a LilyPad Board

An example of how to remove a LiPo battery from the JST connector on a different LilyPad board.

Troubleshooting

Common Arduino Compile Error Message

Not working as expected? Don't worry, it happens to us all. Sometimes things do not go as planned even though you followed the guide. This section highlights a few possible errors that you may encounter when trying to upload code to the LilyPad Development Board.


Error 1: avrdude: stk500_getsync(): not in sync

If you get an error message at the bottom of the Arduino IDE like the following:

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

or

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x8c

The error output that you are seeing can be due to a number of reasons.

The value of the "sync resp" is different and not always the same, so it’s hard to say. Here are a few common reasons for the error and possible solutions that are known in our knowledge base:

  • You don't have the Board and Processor correctly set.
    • The Tools > Board menu should be set to LilyPad Arduino for the board and ATmega328 as the processor. It should only be set to LilyPad Arduino w/ ATmega328.
  • Serial Port may not be set correctly.
    • If you've got more than one Serial Port listed in the menu, try selecting some of the others.
  • Or the drivers didn't install properly.

* Try unplugging and re-plugging the ProtoSnap in. If it prompts you to install the drivers, try doing so again. If that still fails, I'd recommend shooting an email over to our technical support team.

Error 2: avrdude: ser_open(): can't open device

If you get an error message like the following:

avrdude: ser_open(): can't open device "\\.\COM15": Access is denied.
  • It's possible that the wrong COM port was selected.
    • Ensure that the COM port is the same as the FTDI connected to your computer. If not, select the correct COM port.
  • It could also mean that there is a bad connection between the LilyPad Arduino Simple and your computer.
    • In this case, the correct COM port was selected on COM15 but the Lilypad Arduino Simple was not connected physically to the FTDI.

More Problems Uploading?

If you still have problems uploading code to the LilyPad Arduino Simple and it is not outlined here, try checking out the troubleshooting section of our activity guide:

Or you can also try following the link provided at the end of the upload error:

Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

The link heads over to Arduino.cc's general troubleshooting page with a few possible solutions that are not outlined in our guides.

Resources and Going Further

For more information about the LilyPad Development Board, check out the resources below:

Here are some additional LilyPad boards that can be combined with the LilyPad Development Board and project ideas:

LilyPad Pixel Board Hookup Guide

Add changing colors to your wearable projects using LilyPad Pixel Boards.

LilyPad Reed Switch Hookup Guide

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

LilyPad Safety Scarf

This scarf is embedded with a ribbon of LEDs that illuminate when it gets dark out, making yourself more visible to vehicle and other pedestrians.

Here are some resources to help you plan a project with the LilyPad Development Board:

Insulation Techniques for e-Textiles

Learn a few different ways to protect your conductive thread and LilyPad components in your next wearables project.

Planning a Wearable Electronics Project

Tips and tricks for brainstorming and creating a wearables project.

Powering LilyPad LED Projects

Learn how to calculate how many LEDs your LilyPad project can power and how long it will last.

LilyPad Basics: E-Sewing

Learn how to use conductive thread with LilyPad components.