Magical Mistletoe. Created by Leslie Birch. Last updated on :45:29 PM UTC

Similar documents
Interior Purse Light. Created by Becky Stern. Last updated on :41:08 PM UTC

Audio Prank Gift Box. Created by Becky Stern. Last updated on :46:15 PM UTC

Bunny Ears with MakeCode

3D Printed Camera LED Ring

Luminous LED Flowers. Created by Becky Stern. Last updated on :47:44 PM UTC

Neon LED Signs. Created by John Park. Last updated on :11:09 PM UTC

Tent Lantern. Created by Timothy Reese. Last updated on :17:25 AM UTC

Phone-Activated Talking Dog Collar

Solar Boost Bag. Created by Becky Stern. Last updated on :44:55 PM UTC

Arduino Lesson 6. Digital Inputs

Celebration Spectacles

Adafruit LED Sequins. Created by Becky Stern. Last updated on :02:00 AM UTC

Adafruit LED Sequins. Created by Becky Stern. Last updated on :00:06 PM EST

No-Sew LED Wristband. Created by Kathy Ceceri. Last updated on :23:40 PM UTC

Simple LED Unicorn Horn

Reindeer Mask with Animated Eyes

Guardian Shield+ Zelda Breath of the Wild

Alohamora Bottle. Created by Erin St Blaine. Last updated on :58:53 PM UTC

Infinity Mirror Valentine's Candy Box

NeoPixel Ring Bangle Bracelet

Light-Up Angler Fish Embroidery

Chirping Plush Owl Toy

Trinket NeoPixel LED Longboard

FLORA TV-B-Gone. Created by Becky Stern. Last updated on :32:57 PM UTC

NeoPixel Manicure. Created by Sophy Wong. Last updated on :50:38 PM UTC

Portable Apple Watch Charger

Trinket-Powered Conference Room Occupancy Display

LED Eyes. Created by Ruiz Brothers. Last updated on :50:55 AM UTC

Circuit Playground Digital Input

Adafruit Capacitive Touch Sensor Breakouts

Flora Brake Light Backpack

Circuit Playground Express Head-Tilt Ears

Adafruit TPL5110 Power Timer Breakout

7 Portable Multitouch Raspberry Pi Tablet

Adafruit IO Basics: Digital Output

Pushrod Garage. Created by John Park. Last updated on :07:30 PM UTC

Jewel Hair Stick. Created by Leslie Birch. Last updated on :47:17 PM UTC

Clockwork Goggles. Created by John Park. Last updated on :03:10 PM UTC

Mad Science Test Tube Rack

Mystical LED Halloween Hood

Coffee Detonator: The TNT Plunger Grinder

'Sup Brows. Created by Kate Hartman. Last updated on :52:04 PM UTC

Adabot Operation Game

Milk Jug Glow Skull. Created by John Park. Last updated on :28:36 PM UTC

Crickit Dancing Marionette Kit Created by Dano Wall. Last updated on :03:11 PM UTC

TRON Bag. Created by Becky Stern

GPS Logging Dog Harness

FLORA Pixel Brooch. Created by Becky Stern. Last updated on :19:07 PM EST

FLORA and GEMMA ICSP. Created by Becky Stern. Last updated on :42:16 PM UTC

NeoPixel LED Cortana Costume

PyPortal View Master Created by Ruiz Brothers. Last updated on :51:28 AM UTC

Toy Car Speed Timer. Created by Kirby Griese. Last updated on :13:49 PM UTC

Crawling Animatronic Hand

NeoPixel Basketball Hoop

Con Badge with Circuit Playground Express

Bluetooth Controlled NeoPixel Headphones

Unicorn Hat with Moving Ears

Bandolier of Light. Created by Becky Stern. Last updated on :16:17 PM EST

Bike Wheel POV Display

TSL2561 Luminosity Sensor

Adafruit PowerBoost 500 Shield

Stumble-Bot. Created by Dano Wall. Last updated on :04:06 AM UTC

Cup o' Sound. Created by Becky Stern. Last updated on :30:06 PM EST

Circuit Playground Yoyo

Adafruit MCP9808 Precision I2C Temperature Sensor Guide

Adafruit TPL5111 Reset Enable Timer Breakout

Hammer Time Mini Golf Hazard with Crickit

HalloWing Jump Scare Trap

Feather Weather Lamp. Created by Ruiz Brothers. Last updated on :54:26 PM UTC

Data Logging with Feather and CircuitPython

Slider Crank Mechanism -- from Cardboard and Craft Sticks

Interactive Gift Box. Created by codingpro. Last updated on :47:40 AM UTC

Mystery Box: NeoMatrix Mk I

DIY Circuit Playground Shields

Circuit Playground Express Laser Tag

7" Portable HDMI Monitor

Punk LED Collar. Created by Becky Stern. Last updated on :02:45 PM EST

LED Eye Prosthetic. Created by Tully Jagoe. Last updated on :00:17 AM EST

FLORA and GEMMA ICSP. Created by Becky Stern. Last updated on :30:55 PM EST

Crickit Powered Holiday Diorama

NeoPixel Bike Light. Created by Ruiz Brothers. Last updated on :43:46 PM UTC

LED Breath Stats Mask

Lie Ren's Stormflower Gun Blade

Adafruit IO Basics: Analog Input

Android GBoard Morse Code Control with Circuit Playground Express

Crawling Baby Sea Turtle Robot

Adafruit IO Basics: Digital Input

3D Printed LED Knuckle Jewelry

Trellis 3D Printed Enclosure

Ping Pong Ball Launcher

Circuit Playground Kaleidoscope

Sword & Wand Prop Effects with Circuit Playground

FPV Mini Display. Created by Ruiz Brothers. Last updated on :00:18 PM UTC

Snake Charmer Box. Created by Dano Wall. Last updated on :07:25 PM UTC

Glowing Star Chuck Taylor Sneakers

Adafruit VL53L0X Time of Flight Micro-LIDAR Distance Sensor Breakout

LED Stego Flex Spike Hoodie

LED Lightbox. Created by Sam Clippinger. Last updated on :50:00 AM UTC

Raspberry Pi Selfie Bot

ISS Pin. Created by Leslie Birch. Last updated on :27:30 PM UTC

Transcription:

Magical Mistletoe Created by Leslie Birch Last updated on 2018-08-22 03:45:29 PM UTC

Guide Contents Guide Contents Overview Tools & Supplies Circuit Diagram Test the Sensor Prepare Parts Attach LED Sequins Solder Trinket and Sensor Finishing Touches Code Use it! 2 3 4 6 8 9 11 14 16 19 21 Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 2 of 21

Overview This holiday season, shed some light on your relationship with glowing mistletoe. The magic comes from a motion sensor, Trinket and LED sequins. When motion under the mistletoe is sensed, the berries light up! Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 3 of 21

Tools & Supplies If you like soldering and crafting, this intermediate project is for you. We'll be using a Trinket and a motion sensor, so make sure you review the following guides: Introducing Trinket (https://adafru.it/dhx) PIR Motion Sensor (https://adafru.it/ceb) Here's the supplies you'll need: Trinket 3.3V (https://adafru.it/ehd) USB Cable A/Mini B (https://adafru.it/e4f) JST-PH 2-Pin SMT Right Angle Connector (https://adafru.it/dcr) LiPoly Battery-3.75V 500mAh (https://adafru.it/dhk) LED Sequins Warm White - 10 (2 packs) (https://adafru.it/dhf) PIR Motion Sensor (https://adafru.it/ehe) Silicone Cover Stranded Wire 30AWG - 2 colors/2 meters each (https://adafru.it/ehf) Soldering Equipment and Tools Dremel tool Hot Glue Gun Breadboard and wires for testing parts (helpful) Mistletoe Bunch (I used the one on Afloral.com (https://adafru.it/ehb)) Green Felt (Approx. 5" square) White Wide Satin Ribbon - Approx. 1 yd. Floral Tape (available in craft stores) Scissors Needle (https://adafru.it/dgc) and Thread Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 4 of 21

Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 5 of 21

Circuit Diagram Note that the Trinket is oriented up in this diagram in order to make the pins easily readable. In the finished project, the Trinket will be oriented in the opposite direction with the USB and battery jacks facing down. You may have to adjust this configuration with more or less parallel wired LED sequins for your own mistletoe bunch. The bunch I chose has five branches, so I decided to put LEDs on four of them and leave the center one for the motion sensor. The branches are coded to light up staggered, so you may have to tweak the code since your branches may be labeled differently from mine. Have fun with it. PIR Sensor Power (Red) --> Trinket 3V PIR Sensor Black (Ground) --> Trinket GND PIR Sensor Yellow (Output) --> Trinket Pin 0 LED Branch 1 (+) --> Trinket Pin 1 LED Branch 2 (+) --> Trinket Pin 2 LED Branch 3 (+) --> Trinket Pin 3 LED Branch 4 (+) --> Trinket Pin 4 Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 6 of 21

All LED Branches (-) --> Trinket GND Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 7 of 21

Test the Sensor It's good to become familiar with the motion sensor, so first set up a breadboard according to the instructions here (https://adafru.it/cea). You can use either a 3 or 4 battery set-up, so don't panic when you see two battery cases. Have fun waving your hand around. Make sure you try moving the bracket as suggested in the "Triggering" section, so you understand how the sensor works. Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 8 of 21

Prepare Parts Solder the JST Connector to Trinket There is a great demonstration of how to do this here (https://adafru.it/cec). Notice they are using the Audio FX Sound Board here, but it's the same technique that we'll use on the Trinket. Start by soldering one of the short side pad footprints on the Trinket and tack the JST into place Then you can properly solder the last three pads without it moving around. Solder a Wire to the PIR Sensor Usually the sensor is used with a larger battery pack, but in order to use the LiPoly, which is a smaller voltage, you'll need to solder a wire to bypass the regulator. The regulator is labeled 7133-1 and has three pins on one side, with a tab on the other. You will be soldering a short wire from the first pin of the regulator to the pad of the resistor located right near the red wire of the sensor's power cable. Make sure you tin both sides of the wire first, and it helps if you use a third arm and tweezers. Solder the regulator pin wire first, to make your life easier. When finished, plug the sensor wires into their jack on the sensor. This takes a steady hand, so make sure you don't drink caffeine. It's an important step as it affects power. Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 9 of 21

Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 10 of 21

Attach LED Sequins Pick an outside longer branch to start with. Longer branches will get 3 LEDs, while shorter branches will get 2. Choose three large berries and remove them--we'll deal with those later. For now, we will be doing the wiring for the LED sequins that will replace them. Start at the LED near the tip of the branch. Cut and strip a piece of green wire long enough to go from the (+) of that LED to the (+) of the next LED. Now cut and strip a piece of white wire that will go betweem the (-) of those two LEDs. Solder them in place. Continue the same process for the other LEDs. Two wires on the same end can be twisted and soldered as one. Be sure to leave 4" tails of wire after the last LED to attach to the Trinket. Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 11 of 21

As you complete a row of LEDs, test their wiring with a small watch battery to be sure they work. Then, use floral tape to wrap each wired branch. Stretch the tape slightly as you go, so the tape adheres. Take the tape all the way to the end of the branch and cover the wires as best as you can. Now repeat wiring and wrapping for the other branches. Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 12 of 21

Solder Trinket and Sensor Take the black (-) wire of the sensor and solder it onto the GND of Trinket on the reverse side of the board. Now gather all the negative wires (white), and twist the ends together until they form a single wire. It helps to rubberband the other wires out of the way. Tin the end of the white wires. Solder the end of the white wires onto the GND of Trinket. Having problems? You can always cut a short piece of white wire and solder it to the GND on Trinket and then solder the 4 white LED wires to that. Just make sure to apply electrical tape or heat shrink tubing at the junction. Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 13 of 21

Continue to solder the rest of the wires to their correct pins on Trinket. Make sure not to trim the length of the wires on the sensor. You may need to adjust the height later once you hang the mistletoe, and it is better to keep it longer rather than shorter. Place the Trinket between two branches near the top of the bundle, preferably towards the back. Using thread, attach it using the four mounting holes. You should loop the thread a few times through each hole to make sure it is secure. Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 14 of 21

Finishing Touches Using the floral tape, wrap the sensor wires, using the same stretching technique used doing the LEDs. Leave the last 1.5" bare so there is no tension near the Trinket. Cut a long piece of green wire and thread it through a mounting hole on the sensor, up through the center of the bundle, looping it near the top around a branch. Then, feed it down to the sensor's other mounting hole. It should hang just shy of the longest branches. Twist the wire to secure it. Next, take the satin ribbon and tie a bow around the top of your bundle. Allow longer pieces to dangle on the sides. The bow helps to hide the electronics. You may want to take an extra piece of the ribbon and tie it to the top of the bundle for hanging, as well. Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 15 of 21

To prepare the battery, apply a strong tape around the top of the battery to protect the wires from stress. Then, make a holder from felt. Cut two pieces a little bigger than the battery and stitch the sides and the bottom. At the bottom, leave an opening large enough for the JST plug to dangle. Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 16 of 21

Now, use a Dremel to slice each berry in half. Then, using a hot glue gun, attach the berry slices, sandwiching the LED sequins. The idea is to use as little glue as possible to ensure that the LED can allow heat to dissipate. If you can't get hold of a Dremel, you can try getting opaque beads from a craft store, or experiment with little globs of hot glue applied to just one side of the LEDs. Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 17 of 21

Code /* ///////////////////////////////////// * Mistletoe Code modified by Leslie Birch with huge thanks to PIRsense Code from Arduino Playground * The base code is for the Parallax PIR Sensor, which is similar to the Adafruit PIR Sensor * @author: Kristian Gohlke / krigoo (_) gmail (_) com / http://krx.at * @date: 3. September 2006 * * kr1 (cleft) 2006 * released under a creative commons "Attribution-NonCommercial-ShareAlike 2.0" license * http://creativecommons.org/licenses/by-nc-sa/2.0/de/ * * * The sensor's output pin goes to HIGH if motion is present. * However, even if motion is present it goes to LOW from time to time, * which might give the impression no motion is present. * This program deals with this issue by ignoring LOW-phases shorter than a given time, * assuming continuous motion is present during these phases. * */ ///////////////////////////// //VARS //the time we give the sensor to calibrate (10-60 secs according to the datasheet) int calibrationtime = 30; //the time when the sensor outputs a low impulse long unsigned int lowin; //the amount of milliseconds the sensor has to be low //before we assume all motion has stopped long unsigned int pause = 2000; boolean locklow = true; boolean takelowtime; int pirpin = 0; int ledpin1 = 1; int ledpin2 = 2; int ledpin3 = 3; int ledpin4 = 4; //the digital pin connected to the PIR sensor's output ///////////////////////////// //SETUP void setup(){ //Serial.begin(9600); pinmode(pirpin, INPUT); pinmode(ledpin1, OUTPUT); pinmode(ledpin2, OUTPUT); pinmode(ledpin3, OUTPUT); pinmode(ledpin4, OUTPUT); digitalwrite(pirpin, LOW); //give the sensor some time to calibrate //Serial.print("calibrating sensor "); for(int i = 0; i < calibrationtime; i++){ // Serial.print("."); delay(1000); Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 18 of 21

delay(1000); } // Serial.println(" done"); // Serial.println("SENSOR ACTIVE"); delay(50); } //////////////////////////// //LOOP void loop(){ if(digitalread(pirpin) == HIGH){ digitalwrite(ledpin1, HIGH); //the led visualizes the sensors output pin state delay (200); digitalwrite(ledpin3, HIGH); //the led visualizes the sensors output pin state delay (400); digitalwrite(ledpin2, HIGH); //the led visualizes the sensors output pin state delay (200); digitalwrite(ledpin4, HIGH); //the led visualizes the sensors output pin state if(locklow){ //makes sure we wait for a transition to LOW before any further output is made: locklow = false; // Serial.println("---"); // Serial.print("motion detected at "); // Serial.print(millis()/1000); // Serial.println(" sec"); delay(50); } takelowtime = true; } if(digitalread(pirpin) == LOW){ digitalwrite(ledpin4, LOW); //the led visualizes the sensors output pin state delay (200); digitalwrite(ledpin2, LOW); //the led visualizes the sensors output pin state delay (400); digitalwrite(ledpin3, LOW); //the led visualizes the sensors output pin state delay (200); digitalwrite(ledpin1, LOW); //the led visualizes the sensors output pin state } if(takelowtime){ lowin = millis(); //save the time of the transition from high to LOW takelowtime = false; //make sure this is only done at the start of a LOW phase } //if the sensor is low for more than the given pause, //we assume that no more motion is going to happen if(!locklow && millis() - lowin > pause){ //makes sure this block of code is only executed again after //a new motion sequence has been detected locklow = true; //Serial.print("motion ended at "); //output //Serial.print((millis() - pause)/1000); // Serial.println(" sec"); delay(50); } } Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 19 of 21

Use it! Time for mistletoe fun! Make sure the cable for the motion sensor is tucked up inside the bundle and that the sensor's lens is clear of leaves. Now, plug in the battery and tuck the case inside the top of the branches. Give the sensor about 30 sec. to calibrate and then try walking under the mistletoe. In a few seconds berries will light up. Here are some other things to consider. I didn't have to adjust the settings on the motion sensor, but know that there are some listed in the PIR Motion Sensor Guide (https://adafru.it/ceb). Also, my floral tape was dark green, but really a lighter green would have blended better. If the color bothers you, consider dabbing some paint on the tape. Finally, there is a red LED that triggers on the Trinket when the motion sensor is in use. So, just put a small piece of dark tape over it and the magic will stay undiscovered. Happy hacking! Adafruit Industries https://learn.adafruit.com/magical-mistletoe Page 20 of 21