ldk experiment 6: microcontroller circuits - learn.sparkfun .ldk experiment 6: microcontroller...
Post on 31-Jul-2019
Embed Size (px)
LDK Experiment 6: Microcontroller Circuits alearn.sparkfun.com tutorial
Available online at: http://sfe.io/t49
IntroductionGather MaterialsPositive TracesNegative TracesExample ProjectsResources and Going Further
Welcome to experiment 6 of the LilyPad Design Kit, where youll dive into the design and creationof a microcontroller circuit.
A microcontroller is a tiny computer that can be programmed to intake information and regulatepower to your circuit, letting you control lights, sensors, sound, movement, and a number of otherfactors. Ultimately this will let you make projects that are unique, customized to your needs, andinteractive! We won't be programming this controller, it comes pre-programmed, but you'll learn howto connect the parts. When you're ready to program your own circuit, it will go together the sameway!
Before we begin, here are a few resources you might find helpful:
Previous LDK Tutorials
LDK Experiment 1: Lighting Up a Basic CircuitLDK Experiment 2: Multiple LED CircuitsLDK Experiment 3: Buttons and SwitchesLDK Experiment 4: Make Your Own ButtonLDK Experiment 5: Create Your Own Switch
Other Relevant Tutorials
Integrated CircuitsAnalog vs DigitalPulse Width Modulation (PWM)
Page 1 of 13https://learn.sparkfun.com/tutorialshttp://sfe.io/t49http://learn.sparkfun.com/tutorials/ldk-experiment-1-lighting-up-a-basic-circuithttp://learn.sparkfun.com/tutorials/ldk-experiment-2-multiple-led-circuitshttps://learn.sparkfun.com/tutorials/ldk-experiment-3-buttons-and-switcheshttp://learn.sparkfun.com/tutorials/dik-experiment-4-make-your-own-buttonhttps://learn.sparkfun.com/tutorials/ldk-experiment-5-create-your-own-switchhttps://learn.sparkfun.com/tutorials/integrated-circuitshttps://learn.sparkfun.com/tutorials/analog-vs-digitalhttps://learn.sparkfun.com/tutorials/pulse-width-modulation
LDK Experiment 6: Microcontroller Circuits SparkFun Wish
To get started, you'll need these parts. If you're using the Lilypad Design Kit, you've already gotthem all!
The LilyTiny is a tiny little LilyPad board designed to add flashy functionality to your project without taking up a
LilyPad Coin Cell Battery Holder - Switched - 20mmDEV-11285
Sure, your flashing, chip-tune playing t-shirt is really cool at the party... but at some point you need to turn it off.
LilyPad Rainbow LED (strip of 7 colors)DEV-11842
This is the LilyPad Rainbow LED strip, a simple seven pack of every LilyPad LED that we have, each still attac
Conductive Thread Bobbin - 30ft (Stainless Steel)DEV-10867
This is 30 feet of conductive thread spun from stainless steel fiber and wound on a plastic bobbin. Use it to sew
This set of sewing needles is a must-have when stitching together your next e-textile project. Each envelope c
View LDK Experiment 6: Microcontroller Circuits on SparkFun.com
Page 2 of 13https://www.sparkfun.com/wish_lists/79963https://www.sparkfun.com/products/10899https://www.sparkfun.com/products/11285https://www.sparkfun.com/products/11842https://www.sparkfun.com/products/10867https://www.sparkfun.com/products/10405https://www.sparkfun.com/wish_lists/79963
Now is also the time to go ahead and get your fabric ready on the embroidery hoop, if you're usingone.
Page 3 of 13https://cdn.sparkfun.com/assets/b/3/8/6/f/5244b445757b7f37388b456b.jpg//cdn.sparkfun.com/assets/9/1/f/4/5/5122ba6ace395f5d0f000001.jpg
To start, let's make sure we've got everything arranged to our liking. It's going to be important thatone positive pin on the battery pack points towards the positive pin on the LilyTiny board. Likewise,one negative pin should point towards the negative on the board. You need room for both of thesecomponents as well as for the four LEDs to spread around the LilyTiny board with positive pinspointing towards the numbered pins on the Tiny board.
Page 4 of 13https://cdn.sparkfun.com/assets/2/4/3/a/e/5244b446757b7f053a8b4567.jpg
Once you know where you want to put the components and you're confident there's plenty of roomfor everything, set aside everything except your battery holder. Don't put the battery in yet! Sewdown the positive pin furthest from where you want to put your tiny board, then sew several stitchesto the closer positive pin. Sew that down as well. If you've been following along for the entire LDKseries, you're probably an expert at this part by now! Don't cut the thread yet.
Page 5 of 13https://cdn.sparkfun.com/assets/4/6/6/b/2/5244b447757b7fa7398b4567.jpg
Continuing the trace from the positive pin of the battery, sew to the positive pin of the LilyTiny boardand sew it down with several stitches.
Page 6 of 13https://cdn.sparkfun.com/assets/6/6/c/5/3/5244b447757b7f31388b4567.jpg
Knot and cut your thread before the next step.
Page 7 of 13https://cdn.sparkfun.com/assets/e/6/6/8/3/5244b446757b7fd6388b4567.jpghttps://cdn.sparkfun.com/assets/9/6/b/3/1/5244b446757b7f47398b4567.jpg
Starting with a new thread trace, sew down one of the numbered pins on the Tiny board. From thatpin, sew a line of stitches to where you would like the LED to be, and sew down the positive pin ofthat LED. Knot and cut the thread, and leave the negative pin alone for now.
Repeat this process three more times, connecting each of the remaining numbered pins to thepositive side of an LED.
This is the homestretch! The negative side of this circuit will be one long trace, so make sure yourthread is long enough!
Page 8 of 13https://cdn.sparkfun.com/assets/7/4/1/d/2/5244b447757b7f83388b4567.jpg
Just like you did on the positive side, sew down both pins of the battery pack, then extend that traceto the negative pin of the Tiny board. Unlike the positive side, you don't need to knot and cut thethread here; you'll be continuing this trace.
Page 9 of 13https://cdn.sparkfun.com/assets/7/4/3/c/e/5244b447757b7f9d388b4567.jpg
Extend the line of stitching from the negative pin of the Tiny board to the negative pin of the nearestLED, being very careful to parallel the positive trace without touching it. Continue this trace aroundthe outer perimeter of the LEDs, connecting all of the negative pins as you encounter them. Whenyou get to the last LED, knot and cut your thread -- there's no need to bring it back around to thebattery pack.
Page 10 of 13https://cdn.sparkfun.com/assets/6/6/0/2/6/5244b448757b7ff8388b4567.jpg
This is it! Slide the battery, positive side up, into the battery holder, and turn the switch on.
How it Works
Each light will display a different behavior. Pin 0 will do a "breathing" fade. Pin 1 will flash aheartbeat pattern. Pin 2 will blink on and off. And, Pin 3 will display a random twinkle. These aregreat examples of just a few of the light effects you can achieve with Arduino code. When you'reready to start programming for yourself, you'll find the code used in this board on the LilyTinyproduct page under "Documents"
If you love the LilyTiny circuit and want to try another pre-programmed microcontroller, check outthe LilyTwinkle! It's the exact same board you've just used, but with different code. That means thatyou'll hook up lights the same way, but instead of performing 4 different behaviors, they'll all displaya twinkling effect together. Cute!
Check out these cool projects made using this circuit:
Page 11 of 13https://cdn.sparkfun.com/assets/a/f/c/0/7/5244b446757b7f81388b456a.jpghttps://www.sparkfun.com/products/10899https://www.sparkfun.com/products/11364
Resources and Going Further
Want to do more with your LilyTiny and LilyTwinkle boards? There are lots of tutorials out there tohelp and inspire you to get big results out of our little boards!
Page 12 of 13https://cdn.sparkfun.com/assets/learn_tutorials/4/9/Not_Glowing.jpghttps://cdn.sparkfun.com/assets/learn_tutorials/4/9/Glowing.jpg
LilyTwinkle Firefly JarLilyTwinkle PaintingMy Drunk Kitchen Talking Harto ApronLilyTiny Monster TutorialLED Feelings PizzaProtoSnap LilyPad Development Simple Hookup GuideWhat is an Arduino?
learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado
Page 13 of 13https://learn.sparkfun.com/tutorials/firefly-jar-assembly-guidehttps://www.sparkfun.com/tutorials/390https://learn.sparkfun.com/tutorials/my-drunk-kitchen-apronhttp://hlt.media.mit.edu/?p=2760https://learn.sparkfun.com/tutorials/soft-circuits-led-feelings-pizza/you-are-herehttps://learn.sparkfun.com/tutorials/protosnap-lilypad-development-simple-hookup-guidehttps://learn.sparkfun.com/tutorials/what-is-an-arduinohttps://learn.sparkfun.comhttp://creativecommons.org/licenses/by-sa/3.0/LDK Experiment 6: Microcontroller Circuits a learn.sparkfun.com tutorialAvailable online at: http://sfe.io/t49ContentsIntroductionSuggested ReadingPrevious LDK TutorialsOther Relevant TutorialsGather MaterialsPositive TracesNegative TracesHow it WorksLilyTwinkleExample ProjectsResources and Going Further