The LilyPad USB Plus is a sewable electronics microcontroller that you can use with Arduino. In this tutorial, we'll introduce the features of the USB Plus and set up the free Arduino software you'll need to upload code to it.
Lilypad USB Plus DEV-14631This is the LilyPad USB Plus, a sewable electronics microcontroller board controlled by an ATmega32U4 with the Arduino bootlo…
RetiredThe USB Plus is available as a standalone board or as part of the LilyPad ProtoSnap Plus board.
LilyPad ProtoSnap Plus DEV-14346The LilyPad ProtoSnap Plus is a sewable electronics prototyping board that you can use to explore circuits and programming, t…
Warning: There are known driver issues on older versions of Windows (7 and 8 specifically). We are actively working on the issue and expect to have a resolution soon.
Required MaterialsTo reprogram and recharge the board, you'll need a micro-B USB cable. This is a common cable used by many devices, so you may already have one. Double check that it is not labeled ‘Power Only’ as these type of cables will not transmit the programming data needed by the LilyPad USB Plus board. If you don't have one you can get one from SparkFun:
USB Micro-B Cable - 6 Foot CAB-10215USB 2.0 type A to Micro-B 5-pin. This is a new, smaller connector for USB devices. Micro-B connectors are about half the heig…
USB Micro-B Cable - 6" CAB-13244This is a USB 2.0 type A to Micro-B 5-pin black cable. You know, the mini-B connector that usually comes with cell phones, Ca…
Suggested ReadingIf 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 IDEA step-by-step guide to installing and testing the Arduino software on Windows, Mac, and Linux.
Note: For a better look at any of the pictures in this tutorial, click on the image to enlarge them!
Hardware Overview and FeaturesThe LilyPad USB Plus is an Arduino-compatible microcontroller. It has fourteen sew tabs for connecting components with conductive thread. Four of these tabs are reserved for connecting power and ground of LilyPad sensors and accessory boards, and ten are input/output (I/O). For reference, each sew tab has a nearby label with its name and the pin number it is connected to on the ATmega32U4 chip at its center.
Features:
The "A" in front of analog sew tab numbers in your code is optional. However, do not include the "~" symbol for PWM outputs. It is only provided to make it easy for you to check which pins can produce PWM (analog) output and is not used in programming.
Powering the LilyPad USB PlusThe LilyPad USB Plus 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.
Once sewn into a project, you can easily attach a rechargable Lithium-polymer battery to the board. See Technical Notes section for more information on batteries and charging.
To power up the USB Plus, connect it to your computer using a micro-B USB cable or attach an E-Textiles Battery. Then slide the switch on the right side of the LilyPad USB Plus to the ON position.
Setting Up ArduinoWARNING: There are known driver issues on older versions of Windows (7 and 8 specifically). We are actively working on the issue and expect to have a resolution soon.
Note:The LilyPad USB Plus requires
Arduino version 1.8 or higher. If this is your first time using Arduino, you can install it by following our
Installing the Arduino IDEtutorial. Otherwise, please make sure to install (or update to) the latest version of Arduino and verify that you are connected to the internet to download the LilyPad USB Plus software add-ons.
When you first install Arduino, it knows how to program a number of "standard" Arduino-compatible boards. Since the LilyPad USB Plus is a newer LilyPad microcontroller, you will need to manually add it to this list by following the steps below. You'll only have to do this once to add the board to Arduino.
Add SparkFun Boards to Arduino's PreferencesStart the Arduino IDE software (version 1.8 or higher) and open the Preferences window by choosing File > Preferences from the menu.
Now copy the below text and paste it into the "Additional Boards Manager URLs" text box:
https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json
No room? If there is already a URL in the box, click the button to the right of the box. This will open a window allowing you to paste the URL onto a new line.
When you're done, click the "OK" button.
Install SparkFun AVR BoardsNext, you'll add the LilyPad USB Plus through Arduino's Boards Manager Menu. Open the Boards Manager by choosing Tools > Board > Boards Manager... (The Boards Manager option is at the very top of the list of boards; you may need to scroll up to see it.)
When the Boards Manager window opens, it will present a long list of options. Type "SparkFun" (without quotes) into the "Filter your search" box at the top of the window. This will shrink the list down to SparkFun's options.
You should see several entries. Look for the one labeled SparkFun AVR Boards by SparkFun Electronics.
Troubleshooting: If you don't see a SparkFun entry, it may mean that the URL you pasted into the Additional Boards Manager section of Arduino's preferences did not load correctly in Step #1, or you're not connected to the internet. Double check that the entire link was copied into the Additional Boards Manager URLs, and that you're connected to the internet. You might also try closing and restarting the Arduino software to refresh the preferences.
Click anywhere in the SparkFun AVR Boards box. A version number and an "Install" button will appear. Click the install button. This will download and install the extension. If you have already installed the SparkFun AVR Boards support, update to the latest version (LilyPad USB Plus is included in 1.1.8 and higher).
If everything worked, a blue "INSTALLED" note should appear next to the SparkFun AVR Boards title. You're ready to start programming.
Uploading CodeOnce you've installed the LilyPad USB Plus extensions to Arduino, you're ready to start programming the board!
Note that you won't have to install the extensions again, but 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 USB Plus to your computer using a USB cable
2. Select "LilyPad USB Plus" from Arduino's "Board" menu
3. Select "LilyPad USB Plus" from Arduino's "Port" menu
Let's go over the three steps in detail:
1. Connect the LilyPad USB Plus to Your ComputerPlace the LilyPad USB Plus on a clean, non-metal work surface. Connect the LilyPad USB Plus to a USB port on your computer using a micro-B USB cable. The cable can only be inserted one way, and should snap in securely.
Tip: Both the micro-B USB cable and the connector on the LilyPad have a subtle "D" shape to them. Match this shape to plug it in properly.
Slide the switch on the LilyPad USB Plus to the ON position. You will not be able to upload code to the board if it is set to the OFF position.
2. Select LilyPad USB Plus from the Board MenuIf the Arduino board support was installed correctly, "LilyPad USB Plus" option will be available in the Tools > Board list under the SparkFun AVR Boards group. Open the menu and select LilyPad USB Plus. Depending on how many boards are already in the list, you may need to scroll down a bit to get to it. 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.
IMPORTANT: You'll see some LilyPad entries higher in the Arduino menu, but the LilyPad USB Plus is not one of them. You'll need to scroll down to the SparkFun section at the bottom of the list to find it. We're working on getting the LilyPad USB Plus added to the LilyPad group in the future.
Troubleshooting:If you don't see "LilyPad USB Plus" in the board list, go back to
Setting Up Arduinoand double check that you performed all the steps. You might try restarting Arduino as well.
3. Select LilyPad USB Plus from the Port MenuArduino needs to know which port your LilyPad USB Plus 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. This used to be difficult to determine, but this board has a handy feature that identifies itself. Go to the Tools > Port menu, and select the port that has "LilyPad USB Plus" next 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, but all should show LilyPad USB Plus next to the port address.
Troubleshooting: If you don't see a port with "LilyPad USB Plus" next to it, 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. Some micro-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.
Uploading CodeTo review, once you've:
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. This is a very simple example program; it just blinks a LED on and off once per second.
Click the "Upload" button (the large round button with the right arrow in it).
Arduino will compile the code, then send it to the LilyPad USB Plus 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 RGB 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 USB Plus.
Troubleshooting: Error Messages on Upload?If you are using a Mac and get an error message like the following:
Board LilyPad USB Plus (platform avr, package SparkFun) is unknown
It is possible that old Arduino versions left over after updates are interfering with the LilyPad USB Plus support installation. If you want to clear out this old information, follow these steps:
WARNING: The following instructions will delete any extensions you've previously applied to Arduino, returning it to its factory-default state. It should not delete any sketches that you've created.
If you still have problems uploading code to the LilyPad USB Plus and they are not outlined here, try checking out the troubleshooting section of our activity guide:
Stitching Into a ProjectAs you plan your project and prototype your code, you can use alligator clips to connect individual LilyPad pieces to the USB Plus and test them before building into a project.
The connections you've planned using alligator clips or a sketch of your circuit can then be recreated with conductive thread by stitching the components in your project once you are finished prototyping. If you'd like to continue to refine your code after sewing into your project, make sure to leave the USB connector accessible.
These tutorials will give you some tips and tricks for project construction and insulation:
Technical NotesIf you are already familiar with programming Arduino for a while, read on for some additional notes about the LilyPad USB Plus. It's similar to other Arduinos, but has some special features and limitations you'll want to know about.
Using a Battery and Battery ChargingSparkFun 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 RateTo 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.
Location of the "CHG" LED
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 ProjectsLilyPad projects are hand-washable, but always remove the battery before washing your project and air-dry your project for several days before replacing the battery.
Removing the LiPo BatteryThe 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.
Tip: There are two small "nubs" on the top of the plastic battery connector that can be shaved off with a hobby knife to make the battery easier to remove.
Always turn the LilyPad off before inserting or removing a battery.
Pin NumberingBelow is a list of the LilyPad USB Plus I/O pins and each function.
Legend:
Now that you've successfully got your LilyPad USB Plus up and running, it's time to incorporate it into your own project!
For more information about the LilyPad USB Plus, check out the resources below:
Looking to reuse old Lilypad Development Board examples and projects with the new LilyPad ProtoSnap Plus? Check out the guide linked below for more information.
Check out these projects using LilyPad Arduino:
Dungeons and Dragons Dice GauntletA playful, geeky tutorial for a leather bracer that uses a LilyPad Arduino, LilyPad accelerometer, and seven segment display to roll virtual 4, 6, 8, 10, 12, 20, and 100 side dice for gaming.
LilyPad Safety ScarfThis scarf is embedded with a ribbon of LEDs that illuminate when it gets dark out, making yourself more visible to vehicle and other pedestrians.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4