ProtoSnap - LilyPad Development Board Quickstart 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!

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...

DON'T BREAK THE PROTOSNAP APART YET!

You'll probably have a pretty major sad if you can't program the ProtoSnap's LilyPad Arduino Simple to control each of its neighbors. Once you have a solid understanding of the Arduino language, and feel there's nothing left to be learned with the ProtoSnap in its current shape, then feel free to snap each piece off and use them as you see fit.


Understanding the Hardware

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. On the LilyPad Development Board, the pin number of each component is printed in white silkscreen on the inside board. Should you ever need a reminder of what pin connects to what, all you really need to do is look down. But, in case your eyes aren't up to reading that tiny text, here's what's what:

Component Arduino Pin
Motor 3
RGB LED - Red 9
RGB LED - Blue 10
RGB LED - Green 11
Button A5
Slide Switch 2
White LED's 5, 6, A2, A3, A4
Buzzer (+) 7
Buzzer (-) 12
Light Sensor A6
Temp Sensor A1

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.

Central to the Simple board is the ATmega328 -- the big black square in the middle of the board. This is the microcprocessor, 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.

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. 

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.

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.

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.


Installing Arduino

Now for a quick Arduino tutorial. In just a few steps you'll have a full operation development platform and environment. If you're a seasoned Arduino vet, you can most likely skip this step, but you may want to skim over the FTDI Driver Installation section just to make sure that goes smoothly.

If you've never used Arduino before, you'll most definitely need to download and install it. Releases are available for just about all operating systems. Head over to Arduino's software page to download them.

Note: Arduino's become official! Arduino 1.0 was released about a month ago. So now, if you download the most recent version, it'll come in a folder labeled "arduino-1.0." Other than that, installation should follow the same steps below. The UI is a bit different (new color, different toolbar layout), but all of the example code should still work.  

"Installing" Arduino is pretty simple. If you're a Windows user, you should have downloaded a ZIP file. Simply unzip that file into any directory you prefer; I have mine installed to C:/Program Files/Arduino/arduino-0022/. Once unzipped, you might want to create a shortcut to Arduino.exe on your desktop.

For you Macs, simply open up the .dmg file you downloaded (if it didn't automagically), and copy the Arduino application into the applications folder.

Now, you can plug the FTDI Board in, and we'll jump into the next step...great fun!


Installing the FTDI Drivers

The FTDI Basic Breakout board is used to program the LilyPad Arduino Simple. This board can also be used to power the Development Board, or to charge a LiPo battery connected to the Arduino's white JST connector.

But before you can use it, you'll have to install some drivers. Drivers are available for just about every operating system -- Windows (7, Vista, XP, 98), Mac, and Linux -- but getting the drivers installed can sometimes be a hurdle (I'm looking at you, Windows).

Because there are so many OS options out there, I'm not going to go over driver installation here, but FTDI (the manufacturers of the chip on that little board) has compiled a great amount of documentation for each variant. Head on over to their website, and download the VCP Drivers that match your operating system. Follow along with the Installation Guide.

If you have any trouble installing the drivers, email our tech support team. They'll get you straightened out.


Uploading 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.

First, you'll need to open up Arduino. Double click the Arduino program, whether it be a shortcut or the Arduino.ex file in the arduino-0022 folder. That should bring up the world-famous Arduino IDE (short for Integrated Development Environment), and a completely blank sketch. Sketch, by the way, is the Arduino term for program or code. From here we can open up one of the many examples included with Arduino. Go to File > Examples > 1.Basics > Blink, which should open up something like this:

Before we can upload Blink to the ProtoSnap Pro Mini, we've got to tell Arduino exactly what our board is and where it is. If you go up to the Tools > Board menu, you should see a pretty exhaustive list of all of the possible Arduino boards. You're gonna want to have one of the middle options selected: LilyPad Arduino w/ ATmega328.

Next we need to tell Arduino how to talk to the ProtoSnap. Go up to the Tools > Serial Port menu. For Windows users, there should be one or two COM# ports listed. COM1 is usually installed on all computers as the fabled, ancient, hard-wired serial port. If there's another COM port in addition to COM1, select that one. On my computer, the ProtoSnap is COM5, it may be COM2, COM3, COM256, etc. on your computer.

For Mac people you should be see something like /dev/tty.usbserial-########. There should only be one (as long as you only have one FTDI board plugged in). Select that.

Now we're ready to upload. Your toolbar menu should look something like this:

Compile takes your sketch and turns it into code that the LilyPad Arduino can understand. Open and Save are pretty self-explanatory. The last two are the buttons you'll be hitting most often. We'll explain Serial Monitor later, but for now, hit the Upload button. Upload both compiles your sketch and sends it to the LilyPad Development Board.

After hitting Upload, quickly glance over to the FTDI Breakout board on your ProtoSnap. You should see the red and green RX and TX LEDs blink like crazy for a few seconds, and then finally, you can bask in the glorious green blink of the ProtoSnap LilyPad Development Board.

Not blinking? Did the RX and TX LEDs on the FTDI board not flash like crazy? Did you get an error that looked like below?

If so, the problem could lie in a few different spots:

  • You don't have the Board correctly set
    The Tools > Board menu should be set to LilyPad Arduino w/ ATmega328 and only 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 tech support team.

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!

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.

Comments 12 comments

  • How do I access the pins after I snap the components apart? For instance, once I snap off the slide switch, how do I re-connect it to pin 2? I don’t see pin 2 as one of the “sewable” connectors on the main Lilypad board.

    • To answer my own question: I didn’t catch that this was a Lilypad Arduino Simple, so doesn’t have all the pins externalized. I don’t think I’m good enough at soldering to access all the “hidden” ones.

      • I’m really confused about the “hidden” pins. Is there any documentation on how to access the other pins the components are connected to once you break them off? I have searched to no avail. Thank you!

  • Loving these ProtoSnap boards! It’s making teaching Arduino programming so much easier.

    For anyone interested, I’m slowly updating relevant Arduino sample code (from File>Examples) to better match the pins of this dev board to make it even easier to get up and started.

    For example, the push button example doesn’t work out of the box because the button is actually on an analog pin and it needs the pull-up resistor enabled on that pin. (Member #241429: that’s why the button gets triggered when the board flexes!)

    Code will be maintained on github for downloading as a zip file or for forking to your own github repo, here:

    https://github.com/pchen/ArduinoLilyPadProtoSnap

    • Pearlchen, thanks so much for posting your code. Now that I have it downloaded,it will be so much easier to demonstrate everything to the kids I’ll be working with. I was wondering the same thing about the push button – it was acting like it was a capsense thing!

  • Do I need to switch on the slide switch to charge the battery or it doesn’t matter to be on or off?

  • The list of ports in this article has errors:
    RGBLED Red is port 9
    RGBLED Green is port 11
    .. the schematic on the product page is right.
    I would love to see the source of the program that’s installed on these - it would help sort out several problems.

  • I also have no clue as to how to get the buzzer to do anyhting. Is there sample code available? Everything else works great (other than LED A3 and A4 being switched on the board and the snap Buttons and Switches triggering on board flex). Both should be non issues when snapped apart.

  • I’m unclear on how to adapt the toneMelody example to the protosnap buzzer. do you have any examples available?

    • To make sound, see Leah’s original buzzer code on her site, and change / add lines marked with a ‘//\/\/'
      int speakerPin = 7 // on ProtoSnap, buzzer is pin 7 //\/\/
      int speakerPin2 = 12; // .. and 12. //\/\/
      void setup()
      {
      pinMode(ledPin, OUTPUT); // sets the ledPin to be an output
      pinMode(speakerPin, OUTPUT); // sets the speakerPin to be an output
      pinMode(speakerPin2, OUTPUT); // we’ll use this one as ground - neither //\/\/
      digitalWrite(speakerPin2,LOW); // pin does PWM, so it doesn’t matter which //\/\/
      }
      .. and it will happily play a scale.

    • Ahh, didn’t think of that. Both buzzer pins on the Protosnap are attached to Arduino pins (rather than one tied to ground in the examples). So you’ve got to pull one of the buzzer pins to ground.
      For example, in the toneMelody sketch try adding this to the setup:
      pinMode(7, OUTPUT);
      digitalWrite(7, LOW);
      as well as changing the 8’s in tone() and noTone() to 12’s.
      You can get more volume out of the buzzer by using both pins (rather than pulling one low). An example of this can be found in the LilyPad Dev board example code I just posted.
      Cheers!