lilypad arduino = \o

34
LilyPad Arduino = \o/ Rain Ashford | http://rainycatz.wordpress

Upload: rain-ashford

Post on 29-Oct-2014

15 views

Category:

Technology


7 download

DESCRIPTION

A presentation i gave to the Open Source Hardware User Group, at Osmosoft, London on 01/07/10. I talked about my enthusiasm for Arduino and told the story of Twinkle Tartiflette an interactive, wearable artwork, which via a stylus allows the user to play a song by touching the appropriate words in sequence.

TRANSCRIPT

Page 1: LilyPad Arduino = \o

LilyPad Arduino = \o/Rain Ashford | http://rainycatz.wordpress

Page 2: LilyPad Arduino = \o

LilyPad Arduino is a great platform for rapid prototyping, for my standalone interactive art projects and wearable artworks. As well as learning about electronics and programming.

Page 3: LilyPad Arduino = \o

..but my first Arduino wasn’t a LilyPad!It was this ‘Digital’ Arduino in April 2008 and I was rather amused, a bit bemused, but a lot inspired with a simple sketch running an LED sequence on a breadboard.

Page 4: LilyPad Arduino = \o

..it did kick-off my interest in tinkering so I was very excited to attend Makers & Hackers, in February 2009, a one-day hack-a-thon where I first saw a sewing machine, soldering iron & Arduino side-by-side. It was a great day for sharing and learning for everyone.

Page 5: LilyPad Arduino = \o

..the ideas and possibilities that blossomed out of that day filled me with joy and brought some lovely new friends too with whom I was part of a team and made a very strange Arduino alarm clock! Arduino is great for collaborative projects!

Page 6: LilyPad Arduino = \o

..about 2 weeks later I attended the UK’s first Maker Faire in Newcastle where our BBC Backstage team built an even stranger RFID weather cock-bot tank and then there was no going back!

Page 7: LilyPad Arduino = \o

Anyway.. Somewhere along the line I heard about this thing called a LilyPad which sounded like just the ticket for my interactive art leanings!

Page 8: LilyPad Arduino = \o

What is it? The LilyPad Arduino is a microcontroller & suite of modules designed for wearables & e-textiles that can be sewn directly to fabric with conductive thread. It was designed and developed by Leah Buechley of MIT & Sparkfun Electronics.

Page 9: LilyPad Arduino = \o

Official Arduinos use the megaAVR series of chips, the LilyPad board is based on the ATmega168V, the low-power version of the ATmega168, newer LilyPads use ATmega328, the difference is 16K vs. 32K. Arduino clones & other microcontrollers use various processors, e.g. mbed uses an ARM chip.

Page 10: LilyPad Arduino = \o

The board runs on 2-5 volts from USB or battery. It comes pre-programmed with a bootloader that simplifies the uploading of programs to the on-chip flash memory, compared with other devices that typically need an external chip programmer.

Page 11: LilyPad Arduino = \o

The LilyPad has 22 pads / pins *Pin 1 - TX/D1Pins 2,3,4 - D2, D3, D4Pin 5 - GND or "-" (ground)Pin 6 - VCC or "+" (power)Pins 7,8,9,10,11,12,13,14,15 - D5 through to D13Pins 16,17,18,19,20,21 - A0 through to A5 (analog pins)

Page 12: LilyPad Arduino = \o

* It’s a good idea to familiarise yourself with what each of the pins are, their I/O and keep a track of what pins you are sewing to which modules!

Page 13: LilyPad Arduino = \o

..some more specsDigital I/O Pins14 (of which 6 provide PWM output) Analog Input Pins6 DC Current per I/O Pin40 mA Flash Memory16 KB (of which 2 KB used by bootloader) SRAM1 KB EEPROM512 bytes Clock Speed8 MHzCircular, approximately 50mm (2") in diameter. The board itself is .8mm (1/32") thick (approximately 3mm (1/8") where electronics are attached)Wash at your own risk!

Page 14: LilyPad Arduino = \o

LilyPad uses the Arduino IDE (integrated development environment) which is a cross-platform application for Linux, Mac OSX & Windows – the editor (above) allows you to compile sketches in C programming language. Leah Buechley’s excellent tutorial to the whole process from installing IDE to basic programming explanations is here: http://web.media.mit.edu/~leah/LilyPad/index.html

Page 15: LilyPad Arduino = \o

The Arduino IDE comes with access to tons of sketch libraries which are all open source and easily downloadable into your editor to use as they are, or customise to your specific needs and great for people just starting out with programming.

Page 16: LilyPad Arduino = \o

Load your sketches via a Sparkfun Basic FTDI breakout which you attach to the six pin male header and then connect via mini USB cable to your computer of choice. It allows a sketch to be loaded without hitting reset.

Page 17: LilyPad Arduino = \o

Sewing: to connect the modules, I use conductive thread from my Arduino supplier, though I’ve started looking at creating work with other conductive medium, such as safety pins, coloured metallic embroidery thread, hooks, silver conductive marker pens and paint!

Page 18: LilyPad Arduino = \o

For a glimpse of what you can do with LilyPad Arduino I’d like to show TwinkleTartiflette – a smorgorsboard of schema and debugging examples - a wearable, interactive sound artwork!

Page 19: LilyPad Arduino = \o

Inspiration - I recently played with a Stylophone BeatBox and pondered how one would make an interactive artwork using LilyPad and a stylus…

Page 20: LilyPad Arduino = \o

..this lead to some head scratching over complex sewing schematics!

Page 21: LilyPad Arduino = \o

I wanted to combine words, image and sound into an interactive experience, so created felt stars and began sewing my schema with conductive thread - I’m the first to admit I’m not great at embroidery!

Page 22: LilyPad Arduino = \o

After what seemed like quite a while later (about a week of evenings fitted round the day job) I had two stars with conductive thread words in the right order.

Page 23: LilyPad Arduino = \o

..which needed to fit the t-shirt, I was mindful to sew the words carefully so frayed thread did not touch and cause a catastrophe.

Page 24: LilyPad Arduino = \o

It was now time to deploy the schema – I’d mapped notes to words and then back to pins on the LilyPad.

Page 25: LilyPad Arduino = \o

A couple of weeks later I thought I’d sewn all the words to the right notes and pins, also adding buzzer and battery modules. There were some interesting insulations/bridging issues to be solved between the various paths of conductive thread too – but I was ready to extract code ideas from my brain to see if they’d compile!

Page 26: LilyPad Arduino = \o

The code I have written uses the speaker module to produce simple musical notes from connecting to the words with a stylus. I used a chart to work out the frequencies of the different notes.

As I mentioned before, Arduino has various libraries and code examples that are released under open source licence.

Page 27: LilyPad Arduino = \o

Code added and it’s time to test - annoyingly there was a problem! The buzzer is not playing notes correctly, after some thinking and testing with a multimeter, croc clips and a single resistor - a solution was concluded – I’d have to add some resistors.

Page 28: LilyPad Arduino = \o

Unconnected the circuit is connected to high, but when the stylus touches a word it creates a simple circuit through the resistor and pulls it to low. Looking through a ton of resistors 10k ohm seemed like a good fit, but where and how to add them was another question!

Page 29: LilyPad Arduino = \o

A small LilyPad protoboard was just the job to attach the resistors. I have six notes, so the protoboard was just right – but I only had 5 x 10k ohm resistors, but found another resistor that was near enough!

Page 30: LilyPad Arduino = \o

After some soldering and complex routing of conductive thread for the resistors, I’d fix0red one problem, but then found I’d another to debug! Earlier, I said to be mindful of the pins, I had accidentally connected to pin 13 which is the LED pin, that has it’s own resistor and is too low for this project. This showed up in resistance testing with the multimeter.

Page 31: LilyPad Arduino = \o

The fix for the wrong pin incurred some more unpicking and re-routing. I used an analogue pin (as it was nearer and the least hassle) this time which required to be reflected in the code. Yep, a crocodile clip is the best thing to use as a stylus!

Page 32: LilyPad Arduino = \o

Yay, Twinkle Tartiflette lives! All that remains to do is tidy up a bit of sewing and try to ensure there are no trailing bits of conductive thread to cause shorts – textile glue is handy for this!

Page 33: LilyPad Arduino = \o

Here’s what finished Twinkle Tartiflette looks like! Visit my blog for more info on construction, video and code.

Page 34: LilyPad Arduino = \o

Arduino LilyPad = \o/ Twinkle Tartiflette#OSHUG 01/07/10

Thanks!

Rain Ashford | http://rainycatz.wordpress

@Rainycat