Our Geeky Wedding – The Geekiest Wedding Overview

Posted in Projects, Wedding by Bill
22 Apr 2013
WeddingProjectBanner2 Mara and I met in college, both getting our B.S in Electrical Engineering. We are both true passionate geeks; we love to tinker and create things. So it’s no wonder why we put so much into creating a truly original Geek Wedding.  There was a lot of 3D printing involved, meters of wire used on our clothes; we even used a soldering iron during the ceremony. We developed a lot of useful stuff during the creation phase, and of course everything is Open Source.

 The Projects

  • The Geeky Proposal
Before the wedding come the Engagement story. How did I ask her to marry me? Why by hiding the message on a PCB she designed! After we sent them off to be fabricated, I contacted the PCB pool coordinator and asked him to add some text the the silkscreen. When Mara got ready to populate the boards, she found the message of a lifetime.

The message across the boards

  • Electronic Wedding Invitations
Then it came time to design our wedding invitations. We decided to take our wedding theme (circuits and swirls) literally by creating invitations with actual circuits on them. Completely hand crafted, we used a solid ink printer to make flexible circuit boards at home and added an ATTiny13 and some LEDs for a sparkling effect. Bonus, there’s an Easter egg in the code!
  • Electronic Wedding Wishing Well
A ‘Wishing Well’ at a wedding is a tradition where guests write well-wishes for the couple. We decided to make a well that did more then just sit there by adding some light and sound effects. Combing an Arduino, an inexpesive music player, an PWM shield, and a 3D printed latch, the well puts on a quick show every time a ‘wish’ is deposited.
  • 3D Printed Wedding Table Center Pieces
To keep ourselves on budget, we ended up designing and 3D prinitng our own unique table centerpieces. Using a Makerbot 3D printer and a Silhouette cutter, these centerpieces are completely DIY.

IMG_20130220_162733

  • Electronic Wedding Attire
When it came time to think about our wedding attire, did we keep to tradition? Of course not! Instead, we added LEDs and EL wire to our outfits. To keep bulges low, we had to re-purpose EL inverters for standalone operation. We also used inexpensive LilyTiny’s to run 12 LEDS with 4 IO pins.

02_976_D_S_1076

  • Circuit Wedding Ceremony
Not content with tradition wedding vows, we came up with our own wedding ceremony involving a soldering iron and LED display. Bonus: it used the same boards I asked Mara to marry me on!
  • Photobooth Mod
We took a Photoboop kit and added a RGB button and some sounds to attract the attention of our guests.

IMG_20130305_165858 (Large)

  • Hand Painted Isle Runner
Mara and her wedding party spent many hours hand painting a custom isle runner to match our geeky theme. (click to enlarge)

02_794_D_S_0894 (Large)

  • EL Wire Bouquets
Mara worked directly with the florist to design unique bouquets complete with 3 meters of EL wire each.

02_1001_D_S_1101 (Large)

  • Electronic Themed Jewelry
Mara and my mother worked together to create unique jewelry with resistor and PCB elements from old print cartridges.

02_427_D_S_0527 (Large)

The Technology Created

We created a few new and different technologies during the creation of our various wedding projects. First is Vixeno, an easy way to embed Vixen light shows in AVR code. 

Create Light Shows with Vixen and Embed them into your Arduino Project   Next is code for a Charlieplexing display powered by a LilyTiny, ATTiny85. LilyTiny board Even though we didn’t end up using it, we came up with an easy way to light up small fiber-optic sheets available from Sparkfun. IMG_20130331_132651

 The Pictures

Some of the best photos from the wedding can bee seen in this Flickr slideshow.   Read more..

Our Geeky Wedding – Electronic Wedding Attire

Posted in Projects, Wedding by Bill
22 Apr 2013
WeddingProjectBanner Part 5 of the tour through Our Geeky Wedding focuses on the clothes we wore for the wedding. Or, technically what we did to the clothes we wore for our wedding. Of course in a wedding with an engineering theme only one thing comes to mind when you think of the attire: e-textiles!

The Plan

Mara and I both decided to design our own clothing for the wedding. Since I knew I’d be ruining improving whatever suit I’d be wearing for the wedding, I knew I couldn’t rent. So I used a suit left over from a buddy’s wedding instead of buying a new one. Mara took customization up a level and designed a dress and bought it from a vendor on the cheap. Both garments were the right price for our geek wedding.

02_1047_D_S_1147 (Large)

The Technology

We both knew we wanted LEDs and/or EL wire to play a part in the design; however we still were on a tight wedding budget. KISS (Keep It Simple Stupid) and cheap were the main goals as I set out deciding how to design the systems we needed for our attire. Lilypads offer some great options for e-textiles, but I didn’t want to fork out $25 per pop to have a ATMega powered LilyTiny just blink some LEDs. Instead, the $7 ATTiny powered LilyTiny looked much more reasonable. Since it only broke out 4 IO pins, I decided to try using Charleplexing to maximize the number of LEDs it could control.
LilyTiny board

LilyTiny board

The Charlieplexing code I wrote for the LilyTiny (available HERE) enables the individual control 12 LEDs. It runs via a interrupt driven software PWM/plexing routine.  I combined this firmware with my Vixeno Vixen python script to create customized light animations powered by the LilyTiny.
Vixen - Charleplexing code for ATTiny

Vixen – Charleplexing code for ATTiny

The flash memory in the ATTiny is large enough to hold about a minutes worth of 12 channel 8 bit information at 10 frames per second. More than enough for some cool custom light animations. Now we had an inexpensive way to add LEDs to our attire.
Vixen LED sequence writing

Vixen LED sequence writing

Next was EL wire. I knew I wanted to run EL on one side of my suit, but being a big guy I wanted to avoid bulky inverters in any pockets. Even the bulge from a run-of-of-the-mill 2x AA battery pack inverter would stick out stick out like a sore thumb. I already planned to have a ‘master battery’ in a pants pocket run both the LEDs and EL wire, but i couldn’t find an appropriately sized inverter. All the offerings from the usual players were for large 12V inverters meant to run meters upon meters of EL wire. I needed ~8V input, small size and only needed to run about 5′ of wire. Since nothing fit the bill, I decided to make my own, in a sense.
Custom Inverter

Custom Inverter

I started with the really inexpensive Sparkfun EL battery pack/inverter. I removed the shell and took out just the inverter bit. I reverse engineered the design enough to figure out how to bypass the on-board microcontroller that generated the On/Off/Blink function and just keep the inverter circuit powered indefinitely.
The brown wire soldered to the exposed test points will keep the inverter running

The brown wire soldered to the exposed test points will keep the inverter running

  This also let me cutoff the large push button power switch.
Removing the button saves a lot of space

Removing the button saves a lot of space

I took a few measurements, opened up AutoDesk and whipped up a simple case design to house just the inverter PCB. Since the inverter was designed to accept 3V, I left just enough room in the custom enclosure to squeeze in a Pololu voltage regulator.
Inverter with voltage regulator

Inverter with voltage regulator

With the battery springs and push button removed, I had my small profile inverter that would run off of the 8V from my battery pack.
Size compared to COTS 12V inverter

Size compared to COTS 12V inverter

Speaking of the battery pack, I knew I needed something that energy dense to run my suit all night but still light weight and small profile. Also, free would be nice. That limited me to what I had on hand, which just happened to be a bunch of 18650 Li-Ion cells, the same ones used in our custom centerpieces. I was running short on time so I drafted and 3D printed a simple protective case for the batteries, threw in a Li-Ion protection board, wrapped the whole thing up in electric tape and called it a day.
Cells wired in series with protection board

Cells wired in series with protection board

Battery box with connector

Battery box with connector

Batteries, switch installed

Batteries, switch installed

At 2.2AH, one pack lasted just long enough to make it through my reception. I also used the same battery design to power the display used in our geeky circuit ceremony.

The Design

The idea I had for my suit was to create ‘circuit traces’ on the left side with the EL wire. I took a picture with the suit and sketched out a rough idea. Using my sketch as a guide, I cut the EL wire into various lengths and terminated one end of each bit with thin enameled magnet wire, which was a tricky proposition. I started by removing the enamel with a dremel, soldering one wire the the core conductor, shrink tube sealing the connection, soldering another wire to the outer conductor and shrink tube sealing the whole end.  I choice enameled magnet wire because I had it on hand and it seems small/flexible enough to route around my jacket with little effort.
EL termination steps

EL termination steps

I took some sewing pins and laid out my design with the EL wire. I used the terminated end as an anchor point by threading the magnet wire through the suit.
First design held by pins

First design held by pins

Closeup

Closeup

Threading wire

Threading wire

Anchored

Anchored

Then came the sewing, LOTS of sewing. I used clear sewing thread to secure the EL wire to the suit. It took about 2 afternoons to sew it all down. Afterwords, I twisted all the enameled wire together and brought the bundle to the exterior pocket.
All done with EL

All done with EL

Next came the LEDs. My idea was to match blue LEDs with the blue EL wire and create an effect of electricity ‘flowing’ through the wires. Since I had 12 LEDs to work with off one LilyTiny, I split them up into 3 groups of 4. I placed a group of 4 along 3 of my EL wires. Only downside to Charlieplexing is the complicated wiring, so I drew a picture to help me out.
Wiring plan for Charleplexing

Wiring plan for Charleplexing

I used strands from a rainbow ribbon cable to connect the LEDs. Since all but a few junctions required a wire in and out I’d take two striped wires and twist them together. I’d solder the twist and use a needle to poke it through the jacket, finally soldering it to the LED. In the end I had my LEDs along my EL wire ‘traces’.
EL wire and LEDs

EL wire and LEDs

Behind the suit

Behind the suit

I used a gluegun to secure the points where the wire pierced the jacket and other various places to keep it neat.
Quick test of the EL wire

Quick test of the EL wire

I soldered the 4 wires to the LilyTiny and glued that to a piece of cardboard. I added a Pololu voltage regulator to drop battery voltage down to 5V for the LilyTiny.
LilyTiny and regulator

LilyTiny and regulator

But I wasn’t done there. I had an idea for another element to the design, an EL handkerchief square in the breast pocket. This element ended up causing me the most grief. I started by taking a blue EL panel from Sparkfun and trimming it to fit in the pocket. The Sparkfun EL inverter wouldn’t power the square, but a similar model from Adafruit seemed to do the job. Just like the Sparkfun inverter, I reversed engineered the Adafruit inverter and soldered a jumper to keep the inverter part on all the time. I glued it along with a voltage regulator and the trimmed EL panel to another piece of cardboard.
EL napkin Mod 1

EL napkin Mod 1

However it seemed trimming the EL panel caused it’s power consumption to increase. The Adafruit inverter would overheat and shutoff after a few minutes. I trashed the design and started again. Not taking any chances I minimized the amount of material removed from the EL panel and switched to a beefy 12V inverter from Adafruit, mated with a Pololu boost regulator to supply the 12V. I tucked the inverter down into an internal chest pocket and that seemed to minimize it’s bulge.  
Mod 1 vs Mod 2

Mod 1 vs Mod 2

I had Mara slice up some vinyl circuit traces on her Silhouette Cameo craft cutter and laid them out on the EL ‘napkin’.
EL Napkin

EL Napkin

And put it all together:
Geek suit

Geek suit

Next up is Mara’s dress. She decided not to include any EL elements, but she did want LEDs. Using the same design as my suit, she took 2 LilyTinys, programmed them with a Vixeno sequence and wired up two charlieplexing displays.
Soldering her wedding dress, days before the wedding

Soldering her wedding dress, days before the wedding

LilyTiny's flanking the inside of the dress

LilyTiny’s flanking the inside of the dress

 
LEDs hide nicely

LEDs hide nicely

For power, we glued a Pololu boost regulator to a 2x AAA battery pack. With no other ideas on where to hide said battery pack, we tied it to a second garter she wore throughout the night.
Power garter

Power garter

Both pieces turned out to be a big hit at our wedding. Both my suit and her dress ran all night with no problems, and our guests couldn’t stop complementing us on how well them came out!
At the alter

At the alter

Up close

Up close

      2 Comments // Read more..

Our Geeky Wedding – Wedding Circuit Ceremony

Posted in Projects, Wedding by Bill
15 Apr 2013
WeddingProjectBannerp4 When it came time for Mara and I to draft our wedding ceremony we pondered how we could incorporate an element from our theme. We had 4 days to go and only some vague ideas. Mara bought some wood letters to spell out ‘I Do’ and wanted to use them in the ceremony. We also joked about using a soldering iron during the ceremony; but how could we do it tastefully? Then it hit us, a common wedding ceremony know as the “Fishermen’s Knot” could be reworded for something a little more geeky. Yes, we really did solder some wires together in the middle of our wedding, with a Weller soldering iron Mara bought me for a past birthday no less. And you won’t believe what PCBs came in handy for the build…

Video

Ok, this post will be short because this project was thrown together 4 days before the wedding and we didn’t have time to stop and document the steps. We were set to get married and still had a lot to do, as evident by the mini-maker space we created in my parents house:
Wedding Hack HQ

Wedding Hack HQ (click to enlarge)

  Mara bought the letters at a local hobby store. I sketched out a rough outline of evenly spaced LEDs and went to work creating the holes with a drill press. A coat of blank paint and then my best man Dan went to work soldering wires to all those LEDs. Next we had to figured out a way to control those LEDs. In a pleasant case of coincidence, the boards I hijacked to ask my bride to marry me 2 years ago were designed to control large numbers of LEDs. Yes, the boards that asked “Mara Will You Marry Me?” were used to run letters that said ‘I Do’ during our wedding ceremony.
Talk about coincidence!

Talk about coincidence!

The boards are a breakout for a inexpensive constant current shift register. Mate that with an Arduino running a SPI based PWM library and you’ve got yourself chain-able LED driver system. Dan did all the wiring while I whipped up a few driver boards. Once we had everything wired up and running the demo code I went to work programming a sequence for the display. Thanks to my Vixen-Arduino Python script, I was able to quickly choreograph a lighting sequence and embed it into the Arduino code.  I did run into a new problem, turns out the AVRDude has a bug; if it encounters a whole page of FFs in the hex file, it will assume it’s already that way in the flash and skips sending it over to the Arduino. A quick change to Vixen to limit maximum brightness to 254 bypassed the bug and got me running. During the ceremony, the final connection between the Arduino and the battery pack is made and soldered together. ‘Completing the circuit’ turns the display on and the preprogrammed sequence begins to play. This was the quickest project of the wedding and turned out to be one of the most talked about afterwords. Everyone loved the unique addition to our ceremony!

Wait, what were you wearing?

Go here to read about our geeky Wedding Attire, or here to read about the rest of our wedding hacks.    9 Comments // Read more..

Sparkfun Fiber Optic Fabric 3D Printed Light Box

Posted in Projects by Bill
31 Mar 2013
During the rapid design and development phase of all the geeky items we were creating for our wedding Sparkfun listed a new item on their website; a large fiber optic sheet. We bought one with the idea of integrating it into Mara’s dress but had to figure out a way to light it up. In the end we didn’t end up using it for the wedding, but I did come up with a way to create a powerful light source for it and I’m sharing it for others to use. Fiber optic applications need light, a lot of light.  More than a little 20mA LED can provide. In large installations, halogen or other powerful light sources are used to feed fiber optic installations. Usually these ‘light boxes’ are large, power hungry and produce a lot of heat.
A real fiber light source

A real fiber light source

Since we were trying to use the sheet on a wedding dress the light box had to be compact and light weight. I decided to try using a High Power Luxeon LED to feed the sheet.

Better than a 20mA LED

A quick test holding the LED to the fiber connector proved it could work, but alignment is key. I would need to build something to hold the fiber connector in a sweet spot just above the LED. And I would have to deal with the heat the LED produces. So I sat down to my CAD program and came up with this:
Light box design

Light box design

The design comes in two parts. The top piece holds the LED and fiber connector, the bottom holds a really tiny fan available from Digi-key for $15. The idea is the fan draws air through holes in the top piece, through the empty mounting holes on the LED board, across the back of the LED board and out through the bottom piece. I fired up the 3D printer and had my prototype printed in less than an hour.
Parts to assemble

Parts to assemble (All images click to enlarge)

Fan in bottom piece

Fan in bottom piece

LED in top piece

LED in top piece

Snap bottom on top and line up wire slot

Snap bottom on top and line up wire slot

Connected to fiber sheet

Connected to fiber sheet

The fiber connector fits loosely in the top piece, this allows in/out adjustment to position the connector at the right height off the LED for even light distribution. Once found, I taped the connector in place but gluing would be better for long term applications. Now it’s time to see it in action.
In a dark room with no flash

In a dark room with no flash

With camera flash

With camera flash

Up close, no flash

Up close, no flash

  A nice bonus is the fan is 3V, so with a white LED you could power the fan in parallel with the LED since it has a 3V forward voltage. This would make wiring easier and the whole unit could run off a Sparkfun LED driver board. And that’s it! We couldn’t find a nice way to integrate this into Mara’s wedding dress but maybe someone else may find a use for it! I’ve let this light box run at 600mA (~2W) overnight with no failures.

All design files available for download HERE on Thingiverse

If you don’t have access to a 3D printer email me at the address on the bottom of the page. I’m willing to print you a copy for the cost of shipping and a few bucks to cover plastic. Some image are CC BY-NC-SA 3.0 from Sparkfun.com     6 Comments // Read more..

Our Geeky Wedding – DIY 3D Printed Geek Wedding Table Centerpieces

Posted in Projects, Wedding by Bill
24 Mar 2013
WeddingProjectBanner Well, I’m pleased to say the #GeekWedding was a success and I am now a married man. The 3 weeks leading up to our wedding turned into a hack-a-thon of custom DIY projects we’ll be posting about over the coming months. We are going to wait out the 5-8 weeks it will take to get our wedding pictures before we post about many of the projects, but for a few we have enough media on hand to post about now. First up is our DIY custom 3D printed wedding centerpieces. IMG_20130220_162733 We got dangerously close to our wedding day with only vague ideas on how we were going to decorate our tables with our ‘Circuits and Swirls’ theme. The table cloths already incorporated a swirls element, but there was no circuits to be found. Then this idea came to me. We are both a fan of blinky things (wait till you see our wedding attire) and I knew edge lit plastic engraved designs always look cool. But how could we make something at home on the cheap? First I tackled the engraved plastic part. I ran to the craft store and found thin plastic sheets. I ran these sheets through Mara’s Silhouette paper cutter a few times and found it could score the plastic enough to diffuse light. wedcenter Next I needed structure to house the power source, LEDs and plastic sheets. I sat down with Autodesk Inventor and came up with some prototypes. The ends result is 5 pieces that come together to form a single centerpiece. I had to build a dozen of these things, so I incorporated a few tricks to make them easier to build. Below is the design. The end of the posts shows a matching cake topper we made even closer to the wedding. wedtopper

The Design

weddingcenterpiecebottomP2

Base piece.

I had to take into several factories during the design and prototyping of our centerpieces. They needed to be cheap and easy to make. This was a last minute project and we were short on time and money. It might have helped if I was more proficient at 3D CAD, or formally taught mechanical engineering in any sense. Regardless, this EE got the job done, though I’m sure not in the most elegant way. I wanted to make the design ‘snap’ together so it would be easy to make. It took a few tests prints until I got the dimension tolerances just right on my 3D printer to make that happen. All 5 parts needed to make a centerpiece were designed in Autodesk Inventor and printed on our Makerbot Thing-o-matic 3D printer. The LEDs strip were leftover from my best man Dan’s latest project and were a perfect fit for this application. The batteries were removed from packs meant for cable modems. I just happen to have a whole box of these packs lying around. I already had the plastic filament for the 3D printer and scrap wire. All we had to buy to make these centerpieces was plastic sheets from Hobby Lobby for $1.67 each and switches from Mouser for $0.71 each. Not bad for a tight budget.

All the 3D files and our Silhouette files can be found here on Thingiverse.

My hope in posting this is people can change the design on the sides and make their own awesome edge lit centerpieces to match any occasion. The rest of this post will read like assembly instructions for the centerpieces for anyone who tries to make their own. Even if you don’t have access to batteries like mine the base will hold a 4x AA battery pack and a voltage booster (to get 12V). The centerpieces were such a hit we had several guests ask if they could take one home. We said no, but still 2 were taken anyway. Since they have served their purpose and family expressed such an interest in them, we’ve decided to retrofit a regular AA battery pack in place of the Li-Ion batteries and send them out as gifts to our family. If you don’t have access to Li-Ion batteries like we did, skip the Li-Ion battery section if you are building these centerpieces.

Creating the Clear Plastic Sides

This is where Mara’s Silhouette paper cutter came in. The design is ‘carved’ or scored onto the plastic sheets by the cutter. silhouette-cameo-open-view After some failed attempts, we found a knife setting of 7, speed setting of 1, and a thickness setting between 26-28 worked best at carving or scoring the plastic sheets. Each sheet produced 4 sides, and each centerpiece only needed 3. The Silhouette also scored straight lines onto the plastic to allow us to snap the sides apart during assembly. Below is the pattern we created for the Cameo: cutdesing We found the bottom rollers on the Cameo would leave an imprint in the plastic after cutting. To mediate this problem we used electrical tape to ‘cushion’ the pressure from the bottom roller. You can see the electrical tape in the picture below: IMG_20130220_161115

02_71_D_S_0171 (Large)

Making the Battery Packs

The following is what we originally did when built the centerpieces. If you don’t have access to these types of batteries, skip below where we retrofitted in regular AA batteries. I have a box full of Lithium Ion battery packs mean to be used in Arris cable modems. These are the same packs I used during the Build your own battery pack tutorial. It is overkill to use these 2.2Ah 18650 cells cells to run 20mA LED strips but since I already had all these batteries lying around it would be foolish to buy new batteries for this project.  I charged them up before separating and building the battery packs.
Removing the cells from the proprietary battery pack.

Removing the cells from the proprietary battery pack.

After the cells were removed from the original battery pack, it was just a matter of wiring 3 in series to give me ~12V.

Cut off the original protection board.

Cut off the original protection board.

Separate the cells.

Separate the cells.

Match 3 in series.

Match 3 in series.

Solder 3 in series.

Solder 3 in series.

Before and after.

I had to build 12 battery packs!

I had to build 12 battery packs!

I tried my best to build packs of similar model cells. You can see in the last picture I was running into a variety of colored wrapped cells inside the modem battery packs.

Wiring up the Base

Each centerpiece takes 3 segments of the LED strip. The segments need to be wired to the battery. Since they have solder pads on both sides of each segment, I used small gauge speaker wire to connect the segments together and to the battery through a on/off switch. Take care to observe polarity (+/-) of the LEDs. Make sure all the pluses (+) get connected together and connected to the plus side of the battery. Same for minus(-). The design for the base pieces includes a very small channel along the top surface. This causes the 3D printer to layout seemingly useless lines around the center of the base. These lines are where the edge of the LED strips need to lie in order for the LEDs to line up with the edge of the plastic sides during assembly. This made assembly much easier.
Self adhesive LED strips adhered to the base. Edges lined up with marks on 3D part.

Self adhesive LED strips adhered to the base. Edges lined up with marks on 3D part.

A single hole is located on one corner for a longer piece of wire to be fed through to underside where the battery pack will be kept.
Strips connected by wire and a longer piece fed through to other side.

Strips connected by wire and a longer piece fed through to other side.

IMG_20130216_201357

Wire coming out the bottom.

Next step is to add and wire in the on/off switch. If you are going to be using a AA battery pack, skip to the next section to see how to wire it in. Start be cutting short one of the wires coming from the LEDs and solder it to one side of the switch. Solder the extra wire to the other.
Cut short.

Cut short.

Solder to switch.

Solder to switch.

Solder extra to other side of switch.

Solder extra to other side of switch.

Push into switch socket.

Push into switch socket.

Next it’s time to solder the wires to the battery pack. Take care not to short the battery pack at any time.
Soldered to battery pack and pack inserted.

Soldered to battery pack and pack inserted.

Finally cover the batteries with the 3D printed cover. This cover has holes for screws and also holds the switch in position. In my case since the cover is slightly bigger than the compartment the cover snapped into the base and didn’t need the screws.
IMG_20130216_202252

Battery cover.

Now the base is complete.

Completed base with blinding LED light.

Completed base with blinding LED light.

Converting for AA Battery Use

The centerpieces were so popular we’ve decided to give them out as gifts. However, bare Li-Ion cells aren’t friendly to an end user. So we took out the cells and put a AA battery pack and voltage booster in instead. We got the battery pack here and the voltage booster here. The wiring is a bit different with the voltage booster, so to help I drew a bad wiring diagram to show you: wiringStart by soldering the positive (+) wire to the LEDs to VOUT on the regulator, and solder ~4″ lengths of wire to GND and VIN on the regulator: IMG_20130325_165027 The VIN wire will go to the switch and the GND wire will connect to negative (-) of the battery pack along with the negative wire from the LEDs. To make all the connections with the batter pack, twist the wires together: IMG_20130325_165137And solder the connection secure: IMG_20130325_165213Repeat with the positive connection and then a little electrical tape will insulate the bare wires: IMG_20130325_165447 Finally I recommend gluing the batter holder into the base and tucking the regulator and wires along the side: IMG_20130325_170034

Assembling the Centerpieces

Assembly is a snap, literally. The main pieces fit together nub and hole style, kind of like Lego pieces. I made the nubs large enough they would fit into the holes with some force and don’t come apart easily. This meant I could build the centerpieces without getting messy with glue. Start by snapping the side pieces out of the single sheet of plastic that ran through the Silhouette. The design the silhouette carved into the plastic includes straight scored lines with which to break apart the pieces.
Start bending along the scored line.

Start bending along the scored line.

And snap, another side piece.

And snap, another side piece.

Peel back some of the protective wrap on either side and insert 3 side pieces into the top retainer piece. Make sure to leave the side the Silhouette carved facing outwards. You’ll see why later.
Push into top retainer.

Push into top retainer.

Add all 3 sides.

Add all 3 sides.

All 3 sides added, and internal protective wrap removed.

All 3 sides added, and internal protective wrap removed.

Next the base comes together. First, snap the triangular internal spacer onto the base.
Push the triangular spacer onto the base with some force until it snaps flush.

Push the triangular spacer onto the base with some force until it snaps flush.

Perfect.

Perfect.

Then peal back more of the protective wrap on the sides of the centerpiece and slide the retainer ring down the side.
Retainer ring around sides, nubs down.

Retainer ring around sides, nubs down.

Flip over and position sides onto base around spacer.

Flip over and position sides onto base around spacer.

Slide ring down and snap together with base.

Slide ring down and snap together with base.

Just like the triangular spacer, the retention ring snaps into the base. The compression between the ring and the spacer hold the plastic sides against the base very well. No glue needed.
Almost done, just need to remove the protective wrap.

Almost done, just need to remove the protective wrap.

The protective wrap on the plastic on the side the Silhouette carved has been cut up into pieces. This made removing all the wrap tedious, until I came up with this trick:
Wrap electrical tape around your fingers sticky side out.

Wrap electrical tape around your fingers sticky side out and ‘stick’ sides repeatedly.

Wrap pieces removed with ease.

Wrap pieces removed with ease.

And you are done! Completed centerpieces. IMG_20130220_162733 IMG_20130220_214450 IMG_20130220_214458

Matching Cake Topper

At the last minute, we used the same technique to make a matching cake topper. This time the design has one side and uses two LED strips in a row. All the pieces snap together like the centerpiece, but a wire runs out to a separate battery pack. We used a 3x AA battery pack and a Pololu voltage booster to give us the needed 12V.
Matching cake Topper.

Matching cake Topper.

Up close.

Up close.

11 Comments // Read more..

The Elemental Illuminator

Posted in Projects by Bill
2 Feb 2013
logo A while ago my ‘Science Brother’ and good friend Dan told me about a project he was planing. He had an impressive element collection and wanted to build an equally impressive display for his collection. His design consisted of a large custom shelving unit shaped to look like a periodic table. Each shelf was made from a small piece of acrylic and he wanted to add LED edge lighting in the color of the element’s periodic group. He was content with just wiring all the shelves to remain constantly lit. I was able to convince him adding a control system to the design would add another level of awesomeness to his project. What follows is the design of the system I created for him and the result. To read more about Dan’s project outside of the control system, checkout his blog.

The Project

Dan’s display is big. Each element gets its own shelf and each shelf has it’s own 12V LED strip to provide edge lighting for the shelf. Dan designed for 120 shelves, one for each element. It was up to me to design the power distribution and control system for all those shelves. We went through 2 revisions of the control hardware before settling on a design. I learned a lot in the process and I’ll cover that in the lessons learned. For now, I’m just going to cover the final design.

The Plan

I needed to control 120 PWM channels across 5′x4′ display. Dan also wanted to be able to break the display down into 4 smaller segments so I had to be able to support disconnecting the segments. I decided on the TLC5940 driver chip due to its popular use in the DIY crowd and this powerful Arduino library. Using this chip by itself is a bit of overkill with it’s powerful clocking control. The driver really shines if you design it into a scanning system; IE a display that scans a row over a set of columns or vise-versa such as in this project. I wanted to keep that design option open as long as possible which is another reason I choice the chip. However the requirement for the display to be broken into segments made the thought of wiring such a design a bit of a headache. So in the end we kept it simple and used the TLC5940s to directly drive each channel. This also kept the effort to drive the display by the main controller low and left room for other features. To support all the LED channels, nine TLC5940s were needed. A ‘master controller’ consisting of an Arduino and custom shield would handle feeding the PWM chips and support additional hardware for future improvements. Dan originally just want a way to control the display from another source (a PC or Tablet) and basic ‘screen saver’ animations to give his collection some movement. Without his knowledge, I planned to throw in another feature as well, a ‘spectrum analyzer/EQ’ display mode. I had seen several projects with similar functions achieved with minimal additional hardware and a Arduino compatible FFT (Fast Fourier Transformer) algorithm.

The Build

The first item I designed was the TLC5940 carrier board, aptly named ‘TLC4LED’.

TLC4LED Carrier Board Design

The board breaks out all 16 PWM channels,  power terminals in and out, and a data connection in and out via RJ-11 connections. The LEDs require 12V and to avoid an extra connection each carrier board has a linear regulator to supply 5V for the logic. Transmitting the clock signals and data line required by the TLC5940s down about 12′ of wire total ended up presenting a moderate challenge. I settled on a classic transmission design some may recognize from the EE bible that consists of a hardy transmitting line driver (74HC244), a Schmitt trigger buffer receiver(74HC14D) and an AC signal termination for the clock and data lines.

Clock and Data lines buffer and driver

Each TLC5940 driver board has this receiver and transmitter design that ‘buffers’ the clocks and data signals down the chain. The results were fantastic, I was able to keep all the original clock rates in the library except the SPI transmission rate, which I had to drop down by 1 to avoid transmission errors. You can see the full circuit design for the carrier boards below.

TLC4LED Schematic

End result

To drive these carrier boards I designed a shield for an Arduino microcontroller board. I decided to just use an Arduino/Shield design so the modularity was there to add any additional features in the future.

TLC4LED Shield

I also added footprints to the custom shield board for additions I already had planned. Namely, an Xbee socket and a header for a Nordic radio. There’s supporting hardware for both future additions: a 3.3V regulator, status LEDs and level shifting circuits. Future plans include the ability to drive the display from a tablet or PC over Xbee, WIFI or Bluetooth and to control the display’s various modes using an inexpensive Nordic FOB or other device.

TLC4LED Shield Design

End result

The original design did not have the audio section. It wasn’t till about 20 minutes after I submitted the design to (now) OSH Park to be manufactored I had the idea to add a feature Dan hadn’t requested nor had I offered but I knew it would be something he would love. I quickly copied this simple design centered around a LM386 amplifier and resubmitted the files. I did not even have time to test the addition. I also didn’t have a diverse enough parts selection at home at the time so when I had to find the right component values for a good level of gain from the amp I had to pull off feats like this:

That was tricky

Installing the carrier boards on the boards went off without a hitch. I hot glued standoffs to the wood to secure the driver boards and ribbon cable was used to wire each LED strip to the boards.

Up close on the back

The back

The ‘master controller’ Arduino with the custom shield ended up getting housed in an Arduino enclosure and located on the front of the display. This will make it easier to add hardware in the future, the display won’t need to be moved.

Up close

Pulled back, without cover

With cover

The Code

This was a big project, for both of us. When it became time to write the code, Dan was beyond ready to have this beauty up and running in his house. I was also months away from my wedding and the Mrs. wanted my time spent on wedding projects. As a result this initial go at the code is a rushed kludge at it’s best. But it works and gives Dan exactly what he wanted. Right now it supports four modes; two of which are standalone animations to give Dan’s display some movement. The third mode is a slave mode; using my EasyTransfer library any device can send visual frame data to the Arduino over serial and it will be displayed. This will allow for other devices such as tablets or PCs to control the display. Dan has a few good ideas for things he would like to do with this ability in the future. The last mode was a surprise to Dan. An affectionate lover of dance and electronic music, I knew if I could get his display to support a ‘Party’ mode that consisted of a simple audio equalizer/visualizer function Dan would love it. I threw in the microphone and audio amp into the design at the last minute and used Adafruit’s Tiny Arduino Music Visualizer code to make the effect happen. I had to modify the library to drive Dan’s display and later to conserve RAM when not using the Visualizer mode. Since there is no hardware user interface built into the board at the moment I programed the Arduino to change modes after every power cycle or reset. This was easy to implement by just using a byte of EEPROM to store the last used mode.

The Result

Here is a video showing Dan’s Periodic Display board in action while in ‘Audio Visualizer’ mode.  

The Source

The source code as well as the TLC4LED driver breakout and shield can be found on HERE on GitHub

Lessons Learned

  • Signal issues

The first generation of TLC4LED did not condition and buffer the clock and data lines. This was a major oversight that became evident early on. After traveling down about 4′ of  the interconnecting cables the signals had degraded to the point of causing artifacts in the display. This caused strobing or flicking effects in the display segments further down the line. The new design eliminated that problem.
  • Wiring issues

The first generation of this design made me fully appreciate how much of a bad idea it it to terminate wires to circuit boards by directly soldering them together. It was a disaster, I don’t know what I was thinking other than trying to save a few bucks on minimizing PCB area. Just don’t. Spend the money on screw terminals or connectors. Read more..

Our Geeky Wedding – DIY Electronic Wedding Invitations (DEWI)

Posted in Projects, Wedding by Bill
29 Jan 2013
The Geekiest Wedding Invitations Ever Next up in the progress towards our ultimate geek wedding are the wedding invitations! Not content with plain old paper invitations my fiancée Mara and I smashed our geeky heads together to come up with a design that keeps with our circuits and swirls theme. We decided to be more literal, by putting actual circuits into our invitations! However, time spent on design, production and cost were a concern. We had to make about 50 invitations to be sent out to our guests. First I’ll jump right to the end product. What follows is a video of our invitation and a few photos taken during development and production. If you notice something odd about the light show in the video, jump to the end of the post for an explanation.

Front cover

Inside finished card

The Design

With time and money acting as constraints I kept the design quite simple. The theme of our wedding is ‘Circuits and Swirls’ and Mara was already ahead of me on the invite design. Two sides of the cards had stylish circuit traces running up and down while the opposing sides had swirls. I figured it would be neat if the stylish traces actually terminated to real working parts, in this case twinkling LEDs; something simple to implement while cool. I pulled up Digikey and priced out the cheapest white LEDs, AVR MCU, battery and light sensor (if you are thinking I could have used one of the LEDs as a light sensor, see Lessons Learned). The light sensor consists of a phototransistor biased by the internal pullup resistor in the AVR. Running at a system voltage of 3V also meant resistors in line with the LEDs were not needed, the IO pins would keep more than 20-30 mA flowing out even if the LEDs tried to draw that much. I crafted the circuit and Eagle and then started the board layout when I ran into my first obstacle. The card design was larger than the allowable work area in the free version of Eagle. Well, since I was going to be panelizing and ‘printing’ these boards, I had an idea. I laid the design out in the confined space in Eagle, then exported the design as an image. I took that image into Photoshop and extended two of the ends into the final positions. I also used Photoshop to panelize the design onto 8.5″x11″ sheets. I was able to fit 9 designs on one sheet.

Simple design

Board layout before Photoshop stretching

Early revision

Panelized design

How many do I have to make again?

I had to come up with a way to program the AVRs once they were attached. I added a programming ’port’ to the design consisting of pads off to the side of the controller.  I built a crude jig that used pogo pins to contact the pads and connected to an AVR programmer. After the program was flashed and verified the port could be cut off.

Programming a card

Building the programming jig

Theory of Operation

The idea was to use the light sensor to detect when the card was opened. We toyed with the ideas of buttons and other ways to activate the card, but ended up settling with the light sensor. It’s assumed the recipients will be opening up the card in a moderately well-lit area so they can read it. The sensor is calibrated to trigger with those lighting conditions. The cheapest AVR that still supports the C compiler I could find is the ATtiny13A. 1K of Flash and 64 bytes of memory was plenty just to flash some LEDs. To keep the design simple, there’s no hard off switch. Once the battery is attached to the card the AVR will always have power; so it had to be able to sleep to conserve energy. When the controller is first powered it samples the light sensor. That sample is used as the threshold for activation from that point on; so final battery assembly had to be in the lighting conditions we wanted the cards to activate. Too dark and they would be triggered by the sun through the envelope, too bright and they wouldn’t come on when people opened them. It took a few tries of experimentation to find a good level of lighting. From then on all we had to do was solder the batteries to all the cards under those lighting conditions. After the first calibration the programming enters a simple loop; check light, if above threshold play the light show; if not go to sleep. The light show is a set of fade values created by the ‘sparkle’ function in Vixen and saved to programming space. I used the same python script I created for the wishing well to convert the values. A simple software PWM routine handles fading the LEDs. Sleeping the AVR ended up being a trick and a half. I ran into a few issues you will see in Lessons Learned. However I was able to get it to work.  The AVR will deep sleep for 2-3 seconds before the Watchdog timer generates an interrupt to wake-up the core, test the sensor and then go back to sleep. While the card is ‘On’ it will drain the battery in less than an hour, the card ‘sleeping’ will last about a month.

Building the PCBs

While I am a passionate at home engineer, I must admit I’ve never etched my own boards before; I’m too spoiled by inexpensive PCB services. So for this project I had to learn quickly. I read about a few people using Xerox solid ink printers to print mask directly onto copper-clad kapton tape and picked up one of the printers for $70 on eBay. I also purchased five 24″ x 18″ sheets of the copper clad kapton for $65 there as well. I cut each sheet into four 8.5″ x 11″ sheets to feed through the Xerox printer.

Copper clad in the paper tray

Next I had to build an etch tank. With speed and cheapness in mind, I went to the local pet store and bought a small specimen tank, air pump and air stone for $15 total. To heat the ferric chloride I soldered wires to a power resistor and epoxied the terminals to make them liquid tight. I then epoxied the air stone and resistor to the inside of the specimen tank.

Etch tank mark 1

To hold the boards during etching I cut out a frame from HDPE plastic. The design allows fluid propelled by the air stone to flow around the center from front to back and top to bottom. I attached the copper clad kapton strips to the holder by double stick tape.

Attached strip to holder

Heading into the tank

Etching

Putting about 20 watts into the power resistor brought the ferric chloride up to 100°F, and with the air pump circulating the fluid I could etch 4 boards in 25 minutes. A quick dip in a water tub stopped the etching and a cleaning with a Brillo pad removed the solder mask.

Cleaning off the etch resist

Before and after

After allowing the boards to dry I cleaned all the pads with a flux pen (a very important step) and tinned each pad with my soldering iron. With 5 boards taped down to keep them secure I carefully soldered down each part, testing progressively as I went; except for the battery. I could finish and test about 5 boards every 30 minutes.

Assembly line

Fluxing

Soldering the parts on

AVRs go on next

Done

Finishing the Cards

I handed over the circuits to Mara after they were populated so she could finish the cards. I bought her a new toy for Christmas, a Silhouette Cameo paper cutter. She put the new tool to good use on this project. The plan was to sandwich the kapton strip circuit between the forward facing card and the outer card stock cover. Mara had planned to cut the holes in the front card for the various components to pass through by hand. Instead she used the Silhouette’s precision homing features to cut the holes for us, two cards at a time; much faster than if we did it by hand.

Automated cut out holes, major timesaver

PCB attached to top card

She also designed the card cover artwork and cut it out with the Silhouette.

Cover artwork

Finishing touches

Finishing touches

Finally the battery was soldered on last just before getting mailing.

Installing batteries

Almost finished

Finished

Lessons Learned

  • Print using Transparency mode
I learned after a couple of bad prints on the Xerox that you have to use “Transparency” as the paper type in order for the ink to adhere to the copper clad kapton. Anything else produces random results. I also haven’t figured how to clean off the ink from failed prints and reuse the copper clad kapton; the ink never adheres again. I also learned these printers will EAT ink every time they are power cycled. I had an issues where it started to refuse to print due to low ink but it was just a blockage problem. While finding and fixing the problem I wasted a lot of ink due to power cycling.

Impressive, but not easy to fix

  • Seal the power resistor
After etching 60% of the boards my heating power resistor failed open circuit. When I drained the tank and removed the resistor I couldn’t find any damage. I did notice ferric chloride slowly leaking from around the two ceramic halves of the outer body. I can only conclude ferric chloride got into the resistor and ate away at the wire. I replaced the resistor with another one but this time epoxied around where the two halves meet to completely seal the resistor.
  • Etching lessons
Etching my own copper was new to me and I had a few growing pains as a result. First lesson is that you need to watch your temperature like a hawk. I etched on my patio and the tank was exposed to the elements. Changing Florida weather threw a curve ball that I didn’t see coming. While it took 30 watts to maintain 100°F one day it raised the temperature to 130°F the next. The not so obvious to me at the time factor of course was the outdoor temperature. The spike in temperature caused the solder mask to melt away and turned the ferric chloride jet black. Next lesson was when it was time to switch out for new ferric chloride. I assumed that it would just stop working, that it would not etch any more. Instead I just got progressively worse results; the mask was dissolving  away in random spots while the copper failed to dissolve in others. Changing out the fluid corrected the problems.

Difference between old and new ferric chloride

  • White LEDs are not good light sensors
My initial prototype used the light sensing properties of LEDs to sense light. However I got poor results. Different types of light produced different results and sunlight would activate the card no matter how many layers of card stock covered the card in the envelope.  Research told the story. Different LEDs are sensitive to different wavelengths of light. While red and green LEDs are OK for sensing ambient light, white LEDs respond to UV light. This explained what I observed in my prototype circuit. I changed the design to include a phototransistor to sense the light level. I used the internal pull-up resistor in the AVR to bias the phototransistor which kept the parts count low.
  • Trouble sleeping
I ran into a few issues trying to get the AVR to sleep properly. I wanted to use the watchdog timer to wake the processor out of deep sleep without resetting the core and wiping out the RAM holding the threshold value. I realize I could have used EEPROM to store the threshold and let the timer reset the core but I didn’t want to add more steps to final production (like shorting out an IO pin while resetting the core) to set the threshold value. I found that the watchdog timer routines in AVRClib assumed you are using the timer to reset the core instead of just generating an interrupt. Just changing the bit that toggles the two modes after the timer is initialized produced strange results. I found deep in the AVR forums someone having similar problems who got it resolved by altering the routines from AVRClib to configure the timer in interrupt mode from the start. That produced reliable results in my case.

Dealing with ‘The Feds’

Yes, I’m aware I’m a Federal employee myself, so I can’t poke too much fun. But it means I also have learned to deal with rules, no matter how ridiculous they are. Shipping Lithium batteries via USPS became a lot more involved this past year and it took some time researching what those new guidelines mean. Then I had to consider what design changes could be made to follow those guidelines. Let’s start with the legalese:  (and this is just the parts that relate to my case!)
349.221 Primary Lithium (Nonrechargeable) Cells and Batteries
For domestic mailings only, small consumer-type primary lithium cells or batteries (lithium metal or lithium alloy) like those used to power cameras and flashlights are mailable domestically under the following conditions. See 622 or IMM 136 when mailing batteries internationally or to APO, FPO, or DPO destinations.
  1. General. The following restrictions apply to the mailability of all primary lithium (nonrechargeable) cells and batteries:
    1. Each cell must contain no more than 1.0 gram (g) of lithium content per cell.
    2. Each battery must contain no more than 2.0 g aggregate lithium content per battery.
    3. Each cell or battery must meet the requirements of each test in the UN Manual of Tests and Criteria, part III, and subsection 38.3 as referenced in DOT’s hazardous materials regulation at 49 CFR 171.7.
    4. All outer packages must have a complete delivery and return address.
  2. Installed in Equipment. The following additional restrictions apply to the mailing of primary cells or batteries properly installed in the equipment they operate:
    1. The batteries installed in the equipment must be protected from damage and short circuit.
    2. The equipment must be equipped with an effective means of preventing it from being turned on or activated.
    3. The equipment must be cushioned to prevent movement or damage and be contained in a strong enough sealed package to prevent crushing of the package or exposure of the contents during normal handling in the mail.
    4. The mailpiece must not exceed 11 pounds.
Did you catch all of that? Let’s break these down a bit.
  • Each cell must contain no more than 1.0 gram (g) of lithium content per cell.
  • Each battery must contain no more than 2.0 g aggregate lithium content per battery.
Seeing as the battery weighs a little over a gram as a complete package, I’m sure there’s much less actual Lithium than that in the battery.
  • Each cell or battery must meet the requirements of each test in the UN Manual of Tests and Criteria, part III, and subsection 38.3 as referenced in DOT’s hazardous materials regulation at 49 CFR 171.7.
Oh boy. I don’t even want to dive into that document. Since I received the batteries from a well know US distributor via USPS and the same rules under ‘General’ apply to uninstalled batteries I assume they would have confirmed compliance.
  • All outer packages must have a complete delivery and return address.
Easy enough, we were planning to do that anyway. Next is the section that applies to batteries ‘Installed in Equipment’.
  • The batteries installed in the equipment must be protected from damage and short circuit.
  • The equipment must be cushioned to prevent movement or damage and be contained in a strong enough sealed package to prevent crushing of the package or exposure of the contents during normal handling in the mail.
Alright, things are getting a bit complicated here because the rules are a bit vague. How do you quantify the acceptable level of ‘protection’? Are we talking a steal reinforced box? Or is a thin layer of paper good? Trying to settle somewhere in the middle was the goal. The battery is protected by two layers of thick card stock on both sides when the card is folded up in the envelope. I fell comfortable calling the battery safe from “normal handling” now.
  • The equipment must be equipped with an effective means of preventing it from being turned on or activated.
More grey area. More-so than normal because of the way the card is designed to activate. Is a sleeping microprocessor considered ‘on or activated?’ Or since the card doesn’t ‘activate’ till it senses light can it be called ‘off’ in the mean time? How effective does the ‘effective means’ have to be? The black card stock and an envelope liner effectively keeps the sun from activating the card; so I’ll consider this one satisfied.
  • The mailpiece must not exceed 11 pounds.
Not even close. Well, I think we meet all the regulations.

The Hidden Message

Now, of course I couldn’t leave a few hundred free bytes of flash leftover well enough alone. I decided it would be fun to throw in a hidden Easter Egg of sorts. Once the sparkle effect show is over, the light sensor is sampled again. If the level is below the threshold (if something like a thumb is covering the sensor for instance) than the code starts a different routine; a message is flashed out in Morse code. I coded a simple routine that adheres to Morse timings and reads out a message saved in program space. What does the message say? Well, I’ll leave that up to you to decode.

Source Code

Source for the program running on the AVR as well as the board design can be found on Github for download.

Gallery

24 Comments // Read more..

Our Geeky Wedding – Electronic Wedding Wishing Well (eWWW)

Posted in Projects, Wedding by Bill
8 Oct 2012
Geeky Wedding Wishing Well with a Show! This is the first (and probably only one before the big day) post regarding my upcoming geeky wedding. This was one of those last minute “How can we make this our own?” efforts we wanted done in time for our engagement party. Mara had bought a cheap cardboard ‘Wishing Well’ for the party and our wedding. It was cute, but bland and uniform. We wanted to make it into something original and something that matched our theme ‘Circuits and Swirls’. So we turned it into the ‘Electronic Wedding Wishing Well’. The base well comes from Oriental Trading for a measly $11. It was cheap and not very sturdy but got the job done. We ended up reinforcing the top with cardboard and covering up the electronics and wires with more cardboard.

Original Well

I had an idea in my head about I wanted it to do but I was short on time and money. In my case, I had less time then I had money, so I put together a shopping list of breakout boards that would get the job done. In the mean time Mara set out to pant the well in the same styling (Circuits and Swirls) as our wedding theme. You can see that styling in the banner above. The base pattern on the well satisfied the swirls aspect, but it needed some circuit traces.  She masked lines on the sides with electrical tape and painted the traces. After they dried she hand pained the pads on the end of each trace. (Click pictures to enlarge)

End result of the new paint job

Top of Well

Then it was time for the upgrades. We first took a handful of LillyPad Micro LEDs and soldered leads to them.

Micro LEDs

This allowed us to attach the LEDs to the side walls by poking them through the cardboard and bending them back.

LED installed

I then soldered hookup wires terminated with headers to groups of 2 LEDs connected in series.

Wiring the LEDs

We also added two RGB LEDs to the top of wishing well base that light up the tissue paper roof to the well. We also reinforced the top cover with a layer of thick cardboard.

RGB LED Topside

RGB LED Bottomside

The brains behind the show is a run of the mill Arduino mated with a PWM Shield for running all the LEDs.

Arduino and PWM Shield

To play sounds along with the show, I settled on this Audio Playback breakout. It seemed to be the cheapest, but easy to implement solution out there. I also threw in a cheap speaker amp as well just to make sure it was loud enough.

Audio Playback, Amp and Speaker

To trigger the show, I designed and 3D printed a latch that would trip a photo interrupter.

The trigger sensor

It took a few tries to get it to work right.

Latch Attempts

The 3D files for the trigger mechanism are on Thingiverse. Here’s a picture of all the electronics mounted on the top of the well.

Full Package

With the hardware in place, it was time to program the show. I created an MP3 of the sound effects I wanted to play, but didn’t have an easy means to program a light show to match. I considered doing it by hand. After all a light show choreographed to music is just a list of brightness values played back at a steady rate with the music. Trying to do that by hand though seemed like a daunting task without a quick way to make adjustments. So instead I started looking at the same programs used to make those impressive Christmas light shows. The popular one, Light-o-Rama sadly isn’t free. I looked around for a while and found a clone that is free called Vixen.

Screenshot of Vixen

Even better, it saves sequences as plain text XML! Perfect for extracting data. Well, almost perfect. While the XML is plain text, the actual data that makes up the light sequence is stored as a binary list of numbers encoded to base64 ASCII. Further more it had no identifiers for channel or frame number so the data has to be parsed carefully to extract the right order of frames in channels.

Vixen Saved Sequence File

Hmm… Well, hey an excuse to learn some more Python! I’m barely to the skill level of being able to hack python scripts so I spent a few hours Googling and learning. After that I had a script that would parse Vixen Sequence files and output a array formatted for Arduino of all the data that makes up the light sequence. (I have since wrote a Tutorial on the process to help anyone else wanting to do something similar.)

Python Script

Output of script formatted for Arduino use

Now I could use Vixen to design the light show with the music and easily embed the show onto my Arduino. With gratuitous program space (32k) I figured I didn’t need any external storage for the light show file. I’d simple store it in program space on the Arduino. My 14 second show of 16 channels and 20 frames per second only took up 4k of space.  Room to spare. The python script formats the array to be store in program space. To playback the show, it’s a simple function to code.
void playShow(){

  //start music track
  wtv020sd16p.asyncPlayVoice(0);
  delay(100);

  int temp = 0;
  long start = 0;

  //start playing back show file and run LEDS
  for(int i = 0; i<vixen_frames; i++){
    start = millis();
    for(int y = 0; y<vixen_channels; y++){
      temp = pgm_read_byte(&(vixen_show_data[y][i]));
      temp = map(temp,0,255,0,2048); //scale to lower half of TLC range.
      Tlc.set(y, temp);
    }
    Tlc.update();
    delay(vixen_frameduration - (millis() - start));
  }

}
The idea is simple, load up 16 channels of values for one frame, update the TLC chip, and then wait for a bit and do it again for the next frame. You might notice it’s a bit trickier to pull values from program space. You have to use the pgm_read_byte() macro with the address to the array in memory. If you don’t you get random data. After uploading the firmware, The EWWW is complete. The parts list (without the Arduino) comes to about $92 but I had some of the needed parts lying around.

Video

Source Code

The source for what’s running on the Arduino is available HERE. For the python script and a tutorial on using it go HERE. 4 Comments // Read more..

Tutorial: Vixeno, Vixen Sequence Conversion for Arduino

Posted in Arduino Libraries, Tutorials by Bill
7 Oct 2012
Create Light Shows with Vixen and Embed them into your Arduino Project If you haven’t seen videos of those awesome Christmas light shows that sync lights to music then you haven’t ever been on the internet. The software used to create those shows is actually pretty simple to use. Load up a music file, setup number of channels and go to town creating complicated fades, sparkles and other animations with ease. A show or light ‘sequence’ is really just an array of values feed to a controller when played back. I wanted to use a popular (and free!) light show creator called Vixen to create a short light show to be embedded in a project run by an Arduino. This is the script I wrote to do just that so you can too. This tutorial will walk you through using Vixen to create a light show and then how to use my script to embed it in your next micro-controller project. Here’s what I did this it: The Electronic Wedding Wishing Well

Background

We can think of a light show sequence as just a 2-dimensional array of values that represent the brightness lights should be. In this case the brightness of the lights is an 8bit number. So its value ranges form 0-255. Since just one channel of light is no fun, we can have lots of channels instead. This is the first dimension of the array. The second dimension is time, since we want to to have our lights vary over time. We break time up into ‘frames’ just like video. The number of frames a show will have depends on how long it is and how many frames per second (fps) the sequence is setup for. Your project is going to need to have some way of controlling many channels of lights. You can use the 6 analog out channels the Arduino has built-in, or you can use various PWM expansion chips/shields available. Since RAM in and Arduino is small (2k) let’s instead store the light show sequence in program space (32k). This tutorial is aimed for people who want to store a single short light show directly in the Arduino memory, as opposed to getting fancy with external storage like SD cards. That’s for another day. If you want the light show to playback with sound, I suggest this module as it is rather cheap and easy to use. Here is a video of the project I used Vixen to complete:

Getting Started

So before we begin you first need to have Vixen and Python installed on your computer. Follow those links to download the respective programs. You will also need my converter script. Next, start up Vixen and create a new sequence. Do this by selecting Sequence -> New event sequence -> Vixen standard sequence A Wizard will pop-up to help you create the Sequence. Click Next to continue. The first thing it will ask you for is the event period. This is the time a single ‘frame’ of the sequence stays on. The smaller the number, the higher the ‘frame-rate’ the sequence has. But it comes at a cost of more memory required to store the sequence. 100ms means your show will have a 10fps (frames per second) rate. This is usually sufficient. Next it will ask you about profiles. This is a way for you to store and recall a setup configuration. We will skip this. Hit next to continue. After that is a screen asking you for the number of channels your setup has. Enter the number and then click ‘Create it’ at the bottom. It will ask you to save the new sequence somewhere on your computer and name it. Save it to somewhere you can recall later. Now we are in the sequence editor. This first thing you will want to do is assign a music file if you are creating a sequence to music. Click the music note to open the assign dialog. Click the “Assign audio” button and select your music file. When you are done select OK to close the Assign audio dialog box. Right above the channel listing, click the waveform button to visualize your audio file. This helps for aligning light cues. You can customize the name and color of your channels. Just right click on a channel name and select Channel properties. This will help you track what the channels do. For example, see how I setup the channels for a recent project: Now it’s time to create your sequence. I’m not going to go into detail, but the basic usage is to select a block (or several blocks at once) and right click. This gives you a list of patterns you can apply. From just On to Off, to fancy sparkle and shimmer patterns as well. The best way to learn the different options is to just play around with them. Vixen let’s you playback your audio while  a slider goes past the current light frame. This helps to visualize what your project will look and sound like. The playback buttons are in the toolbar. When you are done, you should have a show with some fancy light patterns or whatever you want it to be. Make sure you save the sequence, and close Vixen. Now open a file browser window and navigate to where you saved the sequence. You should see a .vix file containing your sequence. Copy my Vixeno script into this folder from the zip file you downloaded earlier. Now open up a command prompt in that folder. The easiest way to do that is to backup once in your file tree (in my case going back to my Documents folder) and shift-right clicking on the folder that holds your Vixen Sequence file and the python script. Select ‘Open Command Window Here’. You should get a command window that is already navigated to your folder with your sequence file. In that window, type in
python Vixeno.py [YourSequenceFile].vix
So in my case: And press enter. You should get some output with details about your sequence. Notice that bit about bytes of memory? That’s how much space in your Arduino the show data is going to take up. An Arduino Uno only has 32,000 bytes to work with. Your code is going to take up at least 4-5k of space leaving about ~26,000 bytes for your show data. If you need to reduce the size of your show, increase the ‘Event Period’ of your show or remove some channels. Close the command window. If you navigate a file browser back to where your sequence file was stored, you should now have a third file called “VixenShow.cpp”. If you open the new file in a text editor, you should see some variables about your sequence and a array holding all the data of your light show. It is formatted for use directly with Arduino/AVR programming, but can easily be modded for other platforms. Take this new file and copy it into your Arduino sketch folder with the sketch for your project. When you open up your Arduino project you should now see a new tab with the show data. You will also need to add a line to include it in your project.
#include "VixenShow.cpp"
Now is the part that depends on your project. How are you using the data? Are you using a PWM Chip like the TLC5940? Using analog out pins directly? Or something else? Your code should basically load up a frame into your analog out hardware, wait for a frame period to pass, and then load up the next frame. Here’s how I  did it with a TLC5940 Shield:  
  //start playing back show file and run LEDS
  for(int i = 0; i<vixen_frames; i++){
    start = millis();
    for(int y = 0; y<vixen_channels; y++){
      temp = pgm_read_byte(&(vixen_show_data[y][i]));
      temp = map(temp,0,255,0,4095); //scale to TLC range.
      Tlc.set(y, temp);
    }
    Tlc.update();
    delay(vixen_frameduration - (millis() - start));
  }
See how I used the static variables from the VixenShow file? They pass along the number of frames, channels and period so it’s easier to code a routine that plays back the file as it should. Also pay attention to how you pull out the data from the array.
      temp = pgm_read_byte(&(vixen_show_data[y][i]));
This is because we stored the data in program space. Here’s the full function that is called to playback the lightshow with music.
void playShow(){

  //start music track
  wtv020sd16p.asyncPlayVoice(0);
  delay(100);

  int temp = 0;
  long start = 0;
  //start playing back show file and run LEDS
  for(int i = 0; i<vixen_frames; i++){
    start = millis();
    for(int y = 0; y<vixen_channels; y++){
      temp = pgm_read_byte(&(vixen_show_data[y][i]));
      temp = map(temp,0,255,0,4095); //scale to TLC range.
      Tlc.set(y, temp);
    }
    Tlc.update();
    delay(vixen_frameduration - (millis() - start));
  }
}
You can see where I issued the command to start playing back the music: wtv020sd16p.asyncPlayVoice(0); Again, that depends on whatever hardware your project has to play sounds. So that’s it. Hopefully this helped you quickly script and add a light show to your Arduino project. Keep in mind the data in the array can be used for anything, not just lighting up LEDs. You could map the 0-255 range to servo angles and script servo movements to a sound file. As always, drop a comment below if you have a questions and please let me know if you make something cool with this! 5 Comments // Read more..

Rebuilding Freeze Frame

Posted in Education Outreach, Projects by Bill
31 May 2012
Freeze Frame Exhibit As you may have seen already, I enjoy volunteering for the local Science Museum. This time I took on rebuilding one of my favorite exhibits, Freeze Frame. The exhibit is simple, guests stand in front of a photo sensitive wall while a flash activates to ingrain their silhouette in the wall for a few minutes. The museum had one that had long since died and the previous volunteers simply ripped out all the parts except the photo sensitive wall and added an LED on a pen to let patrons ‘write with light’. While interesting, it’s not the same awe inspiring effect as Freeze Frame, so I took it on myself to resurrect the original function. This is how I did it. All that was left of the exhibit was the hole where the flash unit was once installed, and the photo sensitive wall. Everything else had to be built from scratch. Ok, so first the flash. I tested a friend’s photographers flash unit and it worked well, so I acquired one for this task. It has a ‘PC-Sync’ connection that is used to remotely trigger a single flash. Searching the internet gave me clues that this is a simple two wire connection that just needs to be shorted for a brief duration to trigger the flash. I tested this with an optoisolator (just to be safe) and I was able to trigger the flash with the flip of an IO pin.
diagram

Example schematic from glacialwanderer.com

Next is the user interface. I already used Sparkfun’s big red dome button for another project in the museum and knew it worked well for kids and adults. I also wanted to add audio feedback to give patrons the cue it was about to flash so I grabbed an small 8 ohm speaker as well. I figured between the audio tones and the flashing light in the button, guests would know exactly when the flash was coming and to strike a pose. I threw together a quick PCB design and had it made by Dorkbot.

Schematic (All pics are click to enlarge)

PCB

The circuit is centered around an ATtiny85 which I like to use for small projects like this. When pressed, it runs a short three count of flashes and audio tones before triggering the flash. This gives guest enough time to run back to the wall and strike a pose.

To house the electronics and interface, I had Patrick McCabe design and laser cut a wall plate for this exhibit.

The wall plate design

To mount the speaker to the plate, I warmed up the old Makerbot, designed and printed a retaining bracket for the speaker. This is how the end result turned out:

The assembled control panel

PCB close up

Speaker from the front

I also started pondering about how to mount the relatively heavy flash unit. For kicks I bought a extension arm when I bought the flash unit figuring it might prove useful. Then I realized if I mounted the flash upside down with the extension arm it could bolt to the wood paneling above it. I was about to run to Home Depot to start figuring out how to make a bolt-able bracket when I remember I had a 3D printer (still getting use to this luxury, thanks again Wired Insider for the printer). I designed and printed a simple bracket to mount the flash to the wall.

The bracket and bolts

Side note: while printing this I finally figured out why my print quality on my Thing-o-Matic has been so poor since updating to the latest firmware. Turns out there’s a bug in the firmware that reverses the setting in the machine profile “Hold Z axis”. So if it is checked (like it should be) it doesn’t actually hold the z axis, allowing the head to fall while it’s printing a layer. You have to uncheck it to make the machine hold the Z axis while printing. Here’s a before and after:

Hold Z axis bug, before and after

Last Minute Design Addition…

Anyone paying close attention to the pictures will have already noticed the schematic and design of the PCB doesn’t quite match what is in the pictures. After playing with the flash for a while I realized running the flash in stand-by all day was not a smart thing to do. I’ve been burned by that before, and wanted to make sure it didn’t happen again. I had wisely broken out an extra IO pin on my PCB design and decided to go ahead and put it to good use. I grabbed a PowerSwitch Tail off the shelf to allow the control board to cut power going to the flash when the exhibit is not used after a few minutes. I’ve made the changes to the design posted here to include the change as a proper screw terminal block.
Powerswitch Tail

PowerSwitch Tail unit. Image: Sparkfun

Install Day

When I had everything working the way I liked, I packed it all up and headed for the museum. Dave, the handyman with a heart of gold was there to help me install everything. First we removed the cover that was over the window in the back of the exhibit and installed the mounting bracket.

3D printed mounting bracket

Then the flash.

Bracket holding flash unit

Next we had to cut out a hole for the control panel.  No one remembers where the button has located in the original exhibit.

Cutting hole

Wiring it up

Screwing it in

Finally we finished it off with a pane of plastic to keep wondering fingers out.

All done

Time for a test run…

Science!

Here’s what the sequence looks like:  

The Source Code

I used AVR Studio to write and program the code running in the ATtiny85. It looks Arduino compatible because I like the API even when not developing for Arduino, so I write all my helper functions in the Arduino style.

Main loop

The main loop simple waits for a button press, then turns on the power to the flash, gives a 3 count of tones and flashes before triggering the flash, then sits in another loop for 2 minutes. This loop alows the Flash to stay running while patron are in the exhibit and presumably pressing the button multiple times. This will avoid short cycling power to the flash. When no one has pressed the button for 2 minutes, then that loop exists, the flash power gets turned off and the code continues the main loop. I also used the hardware watchdog timer just to make sure the exhibit stays running. To create the tones from the speaker, I just used one of the times to create a square wave.

Creating a tone with a timer. Click to enlarge

And the sequence that leads up to a flash…

Flash sequence

And there you have it, Rebuilding the Freeze Frame exhibit. All source for this project is available to download here: FreezeFrameSource

Creative Commons License This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

7 Comments // Read more..
Page 1 of 612345...Last »