Introduction to Arduino LilyPad

Hi Friends! Hope you are doing well. Today, I'll give you a detailed Introduction to Arduino LilyPad. It is an Arduino Microcontroller Board, based on ATmega168/ATmega328 and is introduced by Leah Buechley and SparkFun Electronics.

This board is mainly developed for e-textiles and wearables projects. As per the designed purpose, it can be attached to fabric, sensors, power supplies, and actuators. You may need a conductive thread for joining this board with the required object.

In this post, I'll try to cover each and everything related to Arduino LilyPad, what is this about and how it is used for the development of desired projects. Let's jump right in and get down to the nitty-gritty of this board.

Where To Buy?
No.ComponentsDistributorLink To Buy
1Arduino LilypadAmazonBuy Now

Introduction to Arduino LilyPad

  • Arduino LilyPad is an Arduino Main Board that is mainly designed for e-textiles and wearables projects and is based on the Atmega168/Atmega328 microcontroller.
  • LilyPad is nothing but an Arduino-programmed microcontroller and works similar to other Arduino boards available.
  • It comes in a round shape unlike other Arduino boards so that it could fit easily in wearables.
  • However, the ability of this board to be sewn down with the fabric or sensor through conductive thread puts it ahead and stands out of the boards available in the Arduino community.
  • There are 22 wide open pin-holes, appear around the edge of the whole rounded shape that is mainly used for the connection with the fabric and sensor through a conductive thread.
  • Out of these 22 pinholes, one is reserved for +5V, and one for ground.
  • The LilyPad Arduino incorporates 6 analog inputs that can also be used as digital I/O. They are marked as A0 through A5 on the board, providing 10 bits of resolution. It is important to note that, the analog inputs measure from ground to 5 volts, however, the upper end of their range can be modified using the analogReference() function.
  • The board contains 14 digital pins that can be employed as an input or output, using pinMode(), digitalWrite(), and digitalRead() functions.
  • Like other boards in the Arduino, this Pad is programmed by Arduino IDE - an official software mainly used for programming the Arduino Boards, that is developed by Arduino.cc
  • The board comes with a wide voltage range and operates anywhere between 2.7 V to 5.5 V. The pins on the board come with the ability to control and handle the input or output of the attached device.
  • There are two ways to keep your Pad null and void: increase the operating voltage above 5.5 V or plug the power in reverse order.
  • As I mentioned earlier bootloader is used for storing the code and burning it on the board, however, you can also bypass the bootloader and program the ATmega328 using ICSP (In-Circuit Serial Programming) header.

Arduino LilyPad Features

Following are the main features of the Arduino LilyPad.
Microcontroller ATmega168 or ATmega328V
Digital I/O Pins 14
Analog Input Channels 6
PWM Channels 6
Crystal Oscillator 8 MHz
Flash Memory 16 KB (of which 2 KB used by bootloader)
Bootloader Memory Out of 16KB in the Flash Memory, 2KB is reserved for Bootloader
SRAM1 KB 1 KB
EEPROM 512 bytes
Operating Voltage 2 to 5 V
DC Current per I/O Pin 40 mA
Internal pull-up resistor 20 kO

Arduino LilyPad Pinout

  • Arduino Lilypad Pinout is shown in the below figure:
  • There is a candid difference between external interrupt pins and PCINT pins. Former is the dedicated hardware pin used for generating the interrupt while later is the interrupt that can be created on any digital I/O pin.
  • There are 6 PWM tabs on the board, shown by the dashed lines on the pinout image above. These PWM pins can also be used as digital I/O pins.

How to program Arduino LilyPad?

You can layout the LilyPad connection by following the given steps.
  • Be careful while connecting the power and ground pins of the board. The +5V power must be connected to the positive tab on the board and the ground tab of the board should be connected to the ground of the power source. The reverse connection can cause severe damage to the board and in a worst-case scenario, your board may stop working all at once.
  • There are two ways to generate a regulated +5V power source: Using a +5V pin of the Mini USB Adapter or employing another 2.7-5.5V power source using a Lithium rechargeable battery.
The following figure shows the LilyPad connection with Mini USB Adapter:
  • You can see the two circular tabs on the board marked as TX and RX that are mainly used in two ways: For uploading new sketches to the board and establishing a serial communication with other devices.
  • Apart from using your own power supply, you can also use Mini USB Adapter or Arduino NG board for connecting the Pad with the computer.

The following figure shows the connection of the Arduino UNO with LilyPad:

Note: Don't forget to remove the ATmega8 or ATmega168 from the NG before connecting it with the LilyPad. You can use alligator clips and jumper wires for connecting the +, -, TX and RX tabs on the LilyPad with the corresponding pins on the NG board.

Applications

  • LilyPad is really very handy for e-textile and wearable products, because of its small size.
  • Arduino Lilypad is used in IoT products and embedded projects as well.
  • The circular tabs covering the whole Pad at the edge are mainly used for the connection between Pad and wearable products.

That's all for today. I hope this read has succeeded in grappling your attention and resonated with your field of interest. If you are feeling dubious in any area of the information related to the Pad that I have left unfolded, you can approach me in the comment section below. I'd love to help you according to the best of my expertise. Keep visiting us for valuable information related to engineering and technology. Thanks for reading the article.

Arduino Lilypad Simulation in Proteus

Yesterday, I have posted a new Arduino Lilypad / Nano Library for Proteus in which we have seen how to add that library into Proteus so that you could be able to use these boards in Proteus. That was quite easy. Today I am gonna post a small project in which we will see how to use that library and produce an Arduino Lilypad simulation in Proteus. In this Arduino Lilypad simulation in Proteus, I am gonna use obviously he Arduino Lilypad board along with few LED lightsand will make them blink. Its also quite easy and you can also download the simulation and the hex file at the end of this project but I would suggest you to do it yourself so that you learn something out of it.

Before starting this project, you must have first integrated the Arduino Lilypad Library as without it you wont be abe to do this project. So, if you haven't downloaded it yet then you should read the previous post Arduino Lilypad / Nano Library for Proteus first. Lets get started with this project.

Arduino Lilypad Simulation in Proteus

  • Now I assue that you have already downloaded the Arduino Lilypad Library for Proteus and are ready to use it within Proteus.
  • So open Proteus ISIS and get these components from the Proteus components library as shown in below figure:

  • After getting these components, draw a circuit in Proteus as shown in the below figure:
  • You can clearly see in the above figure, the Arduino Lilypad Simulation in Proteus. After that you need to write a code for Arduino Lilypad so that you could get the hex file for it.
  • In this project, I have used three LED lights and make them ON and OFF using the switch button. If the button is not pressed then the LEDs will remain ON and when you hit the button , the LEDs will go OFF.
  • Copy the below code and paste it into the Arduino software and compile.
int analogPin = A0;
int ledCount = 3;

int ledPins[] = {
2, 3, 4};

void setup() {
// loop over the pin array and set them all to output:
for (int thisLed = 0; thisLed < ledCount; thisLed++) {
pinMode(ledPins[thisLed], OUTPUT);
}
}

void loop() {
// read the potentiometer:
int sensorReading = analogRead(analogPin);
// map the result to a range from 0 to the number of LEDs:
int ledLevel = map(sensorReading, 0, 1023, 0, ledCount);

// loop over the LED array:
for (int thisLed = 0; thisLed < ledCount; thisLed++) {
// if the array element's index is less than ledLevel,
// turn the pin for this element on:
if (thisLed < ledLevel) {
digitalWrite(ledPins[thisLed], HIGH);
}
// turn off all pins higher than the ledLevel:
else {
digitalWrite(ledPins[thisLed], LOW);
}
}
}
  • After compiling this code, get the hex file of code. The hex file and this simulation file is also given at the end of this post so you can download it from there.
  • Now upload this hex file into this Arduino Lilypad and hit the RUN button
Note:
  • If everything's goes fine then as youhit the run button, the LEDs will get ON as shown in the below figure:
  • Now, when you press the button, these LEDs will go OFF as shown in the below figure:
  • That's all, you have successfully implemented the Arduino Lilypad simulation in Proteus. :)
  • In order to download this simulation and the hex file, click on the below buttons.

Download Proteus Simulation

Arduino Lilypad Library for Proteus

Hello friends, few day ago I have posted a tutorial on how to do Arduino Simulation in Proteus. In that post, we have used an Arduino Library for Proteus but as this library is in its initial phases that's why currently it supports only three basic Arduino boards which are Arduino UNO, Arduino Mega2560 and Arduino Mega1280. But as we know there are numerous Arduino boards which are used these days. So, I searched a little and I came across this amazing Arduino Lilypad Library for Proteus which has the support for few other arduino boards, so I thought to share it with you guys. I have tested this library myself as always and its 100% working. I have tested it on Proteus 7 and I think it will work fine on Proteus 8 as well. As we have the support for above three boards in the previous library so the two new boards here are Arduino Lilypad and Arduino Nano, both of them are quite used these days. I have explained it in detail, step by step below, if you still feel problem in any step then ask in comments.This library has the support for following boards:

  • Arduino UNO
  • Arduino UNO SMD
  • Arduino Mega
  • Arduino Nano
  • Arduino Lilypad
Note:
  • This library isn't designed by our team so all credit goes to its creator, who is blogembarcado. Hats off dude !!!
  • We are just spreading the knowledge so that more and more engineers could get benefit out of it.
  • I have also posted Ultrasonic Sensor Library for Proteus, which you can download, using this library you can simulate Ultrasonic Sensor in Proteus, moreover you can also download different examples on Ultrasonic Sensor Simulation in Proteus to get a complete grip on this sensor.

Arduino Lilypad Library for Proteus

  • First of all, download this new Arduino Lilypad Library for Proteus by clicking on the button below:
Arduino Lilypad Library for Proteus
  • Once you downloaded the rar file, extract the file named as "BLOGEMBARCADO.LIB".
  • Now place this file in the library folder of Proteus, which, in my case, is "C:\Program Files (x86)\Labcenter Electronics\Proteus 7 Professional\LIBRARY". I hope it will give you the idea where to place the file.
  • After placing the file in this folder, now open the Proteus ISIS and click on the component selection button.
  • In the search box write "Arduino" and the list of all the arduino boards will be shown immediately as shown in the below figure:
  • You can see all the five boards in the above figure and you can select any of them.There's also another components in the list which is ultrasonic sensor. Yes, this library also supports ultrasonic sensor but I haven't tested it yet that's why didn't mentioned it, I will test this sensor soon and then will also explain its working.
  • Now you can select any of these boards and can start working on them rite away. All the five boards are shown in the below figure:
  • The two new Arduino boards in this library are shown below:
  • So, now simply design your circuit and write the code in the Arduino ide. After writing the code, get the hex file from arduino software and upload it to these boards.
Note:
  • In order to upload the hex file simply double click it and the properties window will pop up. In the Properties window, there will be an option named Program File. In this Program File, browse for the hex file and upload it.
  • Now run your Proteus simulation and it will work like charm.
  • I will post few projects on these boards soon as soon as I get time to write them, so stay tuned and have fun.
  • I have posted a small project on how to use Arduino Lilypad in Proteus which you can read and download from Arduino Lilypad Simulation in Proteus.
Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir