Wednesday, September 1, 2010

iPhone Controlled LED Suit - Quick Demo

iPhone Controlled LED Suit -- Part 2

The Controller / PCB

In the interest of time, and seeing how well my Lantronix breakout board came out on the CNC mill, I decided to CNC my own PCB for the entire suit.  I knew it would be fairly simple since most of the components are built on to the Arduino Pro Mini.  I still haven't found a decent way to design a PCB to be milled.  I use Altium for my circuit design, but this time I had to put my nerves to the test by taking the design into SolidWorks.

First, I started by drawing the overall board shape.  Then I extruded a .002" layer of copper on top of the board as a separate body.  Then I made a sketch containing all of the drilled through-holes for every component.  This took a lot of time because it involved looking up every component (luckily there weren't very many) and creating the footprint in the 2D sketch.  In the next feature I extruded away the excess copper, leaving only the rings around the holes I drilled.  This is accomplished by offsetting all of the entities in the previous sketch by a certain amount that I varied accordingly for each component.  Each piece of copper is a separate body in Solidworks at this point.


Next I began drawing traces.  Thankfully Solidworks lets me draw a single line, then extrude it in two directions to create a trace of the same height as the copper layer and with a thickness I choose.  Unfortunately it won't let me create multiple traces in one sketch and extrude them all at once.  So for now I am stuck drawing each trace in its own sketch and extruding them over and over again.  It was a very slow and painful process, but once I got used to it I knocked it out in a few hours.  

Most PCB design software, including my favorite one, Altium, lets you design a PCB by viewing from the top, but while drawing traces on the top or bottom layer.  Unfortunately I forgot about this when getting started with the PCB in Solidworks, but that was easily fixed with a Body Move/Copy to flip the copper to the other side without mirroring it.  Then I performed the same steps on the other side for a few more traces.  To check my sanity, I drew up the larger components and placed them to check for interference.

I chose a right-angle slider switch for the power, and screw terminals (not pictured) for attaching the wires on the right side.  I knew it would be a heavy toll for a 3.3v linear regulator powering the Lantronix module (~250mA) from approximately 12 volt supply voltage.  That is a lot of heat to burn off.  I found this awesome little 1 amp 3.3v switching regulator that is a drop-in replacement for the TO-220 style linear regulators, but it is way more efficient.

Being the impatient person I am, I didn't want to spend any more time on the design.  It was time to start milling right now!  First, all the tools were set up in the tool changer and indicated.  Then a piece of double-sided copper-clad FR4 PCB material was taped down to a 1/4" aluminum plate and clamped in the mill vise.  The first operation involved drilling the different sized holes, and then the traces were routed out with a .020" endmill.

After the traces got routed out and the operations for one side were complete, I cleaned up the burrs and the finish with a Scotchbrite pad.  With some acetone, the tape's adhesive broke down and I removed the board from the aluminum plate.  Then, using the holes that were just drilled, the aluminum plate was tapped for #4-40 screws, and I flipped the board over and mounted it back to the aluminum plate to perform the operations on the other side.  Then with a razor blade under a microscope, the excess copper was separated then peeled away from the board with pliers, leaving just the traces.

Since the Lantronix module was not cheap (around $65) I knew I wanted to make it removable in case this PCB turned into a disaster.  I had some 2mm headers from Sparkfun, but they needed a little work to fit properly.  The ends of the headers had extra material, which kept me from placing them in line with each other.  I took care of this in a few minutes on a manual mill.

I was ready to start soldering the components.  I used a DIP socket for easy Arduino removal as well.  Because the board is double-sided but the through-holes are not plated, I purposely designed some through-holes just to insert pieces of wire to transfer traces from one side to another.  Cool, everything fits!

Now it was back to Solidworks to design an enclosure.  When you have access to a FDM printer, it is fun to reminisce about all the adventures you've had with radio shack project boxes, but it's so nice to move on.  My friend Alex taught me all the tricks to plastic enclosure design in Solidworks:  Lip & Groove, Snap Hooks, and good practices in general.

And seriously, no lie, I pressed "PRINT" and it appeared a few hours later.  I had picked up a 2.4ghz antenna, and added a right-angle male header to my Arduino Mini for easy programming using the FTDI Basic Breakout.

That wraps up the controller for the most part.  I added a tactile pushbutton switch and a LAN activity LED after I took these pictures, but that is what those little holes in the top are for.  Now it's time to get on to more important things, like coding this shenanigans...

Tuesday, August 31, 2010

iPhone Controlled LED Suit -- Part 1

Since I just created this blog a few days ago, I will have to go back in time a few weeks to talk about starting this other project.  The helmet is in Alex's hands getting prepped for painting.  The circuitry is not done, but in at a good stopping point.  Maybe I can work on them during my lunch breaks throughout the week.  Anyway...

My friends had been trying to convince me to attend Dragon Con for the last 5 years or so.  I myself am not a huge sci-fi fan or anything, but I am a nerd and I do like building cool stuff.  That the same idea some of my friends have too.  I attended my first Dragon*Con last year with nothing in hand and no idea what to expect, but I left with some crazy ideas.  After a while though, those ideas got put on the back burner and other projects took priority.  But with DC 2010 looming on the horizon, I got inspired to make an interesting outfit.  I thought it would be neat to have a full-body suit of LEDs that I could control to any color or pattern I wanted.  

One of my friends and fellow DC attendee, Chris Williamson, decided to build a mobile dance floor this year.  He showed me some LED modules he bought from Bliptronics.  They are individually controllable, over 31,000 color combinations, and they looked pretty rugged.  Check out some pics of Chris's dance floor and his installation of the LED modules below.  The whole thing is motorized and fitted with a sound system.  And notice the stripper pole in the middle - hanging out with our crowd will be interesting this year...


The LEDs looked great though.  I bought 40 of them to try out.  I soon realized that in order to make an entire suit light up evenly, I was going to need both some good diffusion and A LOT of LEDs.  I also finally caved in and bought an Arduino.  Until this point I have used PICs for most of my projects.   But Sparkfun sells the Arduino Mini which is small enough to use on the suit.  Since Ben from Bliptronics had published source code for the LED modules, the easiest way to test them out was to hook them up to an Arduino.  Just a side-note about my gratitude toward Sparkfun:  Not only are they a wildly successful company and a great resource to the maker community, but they are the reason why a young renegade web developer could ever be respected as a real electrical engineer building medical devices.  Thanks guys!

I couldn't come up with a good idea for an outer suit, so I decided to keep the nerd-factor down and just wear some white dress clothes.  Below is a picture of my preliminary test to see how 40 LEDs looked under a white shirt.  

The outcome was pretty cool, but 40 LEDs were quickly used up.  I went back to Bliptronics, this time ordering another 160 LED modules.  At $4 apiece, you can do the math.  When I come up with a project, I tend to go a little overboard.  Ben was nice enough to give me a discount on the modules.  Thanks Ben.  I started sewing LEDs onto an old shirt I had.  With the white button-up shirt over it, this is how it looked.  The video makes it look brighter than reality.  It didn't have the effect I was going for -- it needed more diffusion.  

I also didn't know how I was going to control so many LEDs.  But being a true iPhone user my first thought was "Oh man, it would be sweet to have an app for that...".  If you've been following my links so far, you might have noticed that I have a good reason to be tight with the iPhone.  However, there was one small problem.  I didn't know how to write apps, and I didn't even own a Mac!  The last time I bought a Mac was around the time when the App Store was first launched.  I bought a Mac Mini and I thought I was going to start writing iPhone apps overnight.   I sold it on eBay a few weeks later after a lot of frustration.  Well I found myself back at the Apple Store again, this time making an even bigger purchase.

Being familiar with the iPhone and its limitations, and having done it before, I knew bluetooth would be a bad option to attempt.  A few weeks ago I had finally received a sample part I had requested from Lantronix almost a year prior.  The MatchPort b/g Pro is a wifi-to-serial embedded module.  Out of the box it is pre-configured to create an ad-hoc network.  No access point required -- perfect for the iPhone.  The module has two rows of 2mm spaced male pins, which made breadboarding difficult.  My solution was to try to CNC mill a breakout board from copper-clad FR4 from Digikey.  

Success!  My first PCB produced by a CNC mill.  Now I could get started evaluating the Lantronix module.  Right off the bat, it powers up and creates the ad-hoc network like it said it would.  I hooked the RX and TX lines straight to a Sparkfun FTDI Breakout.  I own about 5 of these little boards.  They are so handy I typically don't have less than 3 of them hooked to my PC at any given time.  Within a few minutes I had a Windows test app written in VB.NET to open a TCP connection to the Lantronix module and I was able to send data from my laptop to a terminal window on my PC wirelessly.

At some point around this time, the rest of my LEDs arrived from Bliptronics.  I went to town sewing LED modules onto a shirt and pants.  The pants are actually white scrubs, slightly modified to not be so baggy.  The material has to be strong to hold up the extra weight of the LED modules.  This thing is starting to look pretty silly...

There is more progress!  Click here to see Part 2.

Wrapping up the helmet

Day 12
Sunday.  Alex began sanding and prepping the plastic helmet for painting.  The Killer Chrome paint will be arriving on Monday.  We need to make the surface as shiny as possible or the paint will look horrible no matter how great the paint is.  For the most part, Sunday was pretty relaxed and not much happened.  I took the opportunity to work on my LED suit a bunch.

Day 13
Monday.  I began an all-out production line soldering up PCBs.  There are 16 boards that go behind the rainbow side colors, and two main jaw boards that house the PIC microcontroller, the equalizer, and the 3mm round chasers.  The rectangular boards with the three boards and the MOSFET are the rainbow boards.  You can't miss the big through-hole resistor added last-minute.  Oops.


Meanwhile, we tested the LEDs out with the colored cellophane, and we were not impressed at all.  The colors became very washed out under the bright LEDs.  We decided to make some white plastic diffusers that would double as a little structure for the thin colored material.  

Now for some bad news...

The Killer Chrome paint turned out to be a disaster, as we had worried might happen.  For some reason, even though the surface was smoothed and shiny at the start, no matter what we did, the jet black base coat always dried flat.  With a flat base coat, there was little hope for the chrome step.  As expected, from that point the chrome step didn't turn out well either, and it was all downhill from there.  Unfortunately, this is the one step we knew would cause us the most issues, and we were forced to resort to our backup plan:  plain old "chrome" spray paint.  

Day 14

Danny and I met up with Alex for our ritualistic lunch at Five Guys.  Alex pulled up and grabbed the gold spray-painted helmet out of the trunk and Danny and I both let out a sigh of relief.  It didn't look THAT bad.  Actually it still looked pretty awesome.  It's nowhere near Volpin-good, but its not bad.  

Alex designed the diffusers to snap right into the existing light frames.  Each one is a different shape and they are each numbered very secretively.  Sick!

Danny is starting to glue on some wires for the hair.  It looks like a very painful process.  After work, I started wiring up the electronics in the light frame assembly.  We convened at Alex's house around 8 PM to work on the final assembly.  I drilled and tapped the plastic frames to mount the PCBs with #4-40 screws, while Danny and Alex worked on the colored cellophane and the EKG decal.  The color material is doubled-up and glued with 3M spray adhesive.  

When both of our parts came together, we tested out the colors under the diffuser panels.  Pretty cool!  We mounted the light frames into the helmet.  

We adhered the visor to the helmet with some PSA (aka double-sided tape).  With some quick splicing of wires, we were able to get both sides running a test pattern.  We were expecting the two sides to slowly become out of sync, but happened sooner than we expected.  I will be adding some basic communication between the two sides in order to alleviate the sync issues.  We videotaped the "unveiling" since it was such a special moment.

All in all, I think we've done pretty good considering the circumstances.  We're way ahead of schedule, only a few small items remain.  Even though we knew we'd never reach perfection, we have learned a lot and it came out looking pretty nice.

Sunday, August 29, 2010

More Helmet - Vacuum forming & Circuitry

Day 10
Friday.  PCBs and components have arrived.  We've started the print job for the right half of the helmet, which should finish late Saturday evening.  I got the PCB parts from Danny and began soldering the components on.  Just trying to get the first LED to blink is turning out to be difficult.  Because we used the ExpressPCB el-cheapo Miniboard service, there are no silkscreens or solder masks.  Knowing where each component goes would have been nice, since Alex designed the boards and I'm doing the assembly.  But I'll just have to figure it out.

Also, a second smaller printer is printing the plastic frames that hold the LEDs behind the visor.  Here is a video of the smaller printer doing its thing:

Day 11 (Part 1)
Saturday afternoon.  Danny leaves for D*C in 5 days.  We test fitted one of the plastic light frames in the left helmet half.  The printer is still printing the other helmet half.  Alex has put about 6 or 7 coats of primer, spray paint, and wax on the MDF mold.  It has the finish of a bowling ball.  We wanted the finish to be perfect because we heard the plastic will pick up even the smallest of textures.  The vacuum former is complete with a hole in the side that is a perfect fit for the shop vac hose.  We cut our first piece of plastic to shape and mounted it between two frames of wood.  The plastic is clear PETG from McMaster.  With the mold looking so great, our expectations were set for success on our first try.

IMG_1191 IMG_1158 IMG_1155

Boy were we wrong. Our first mistake was trying it without the plastic being melted enough. Then the paint on the mold did not take the heat well and completely fused to the plastic. The resulting piece photographed below came from a lot of prying, cutting, and re-heating to get the mold out of the melted plastic. Notice the red paint all over the plastic.  FAIL.


But after our first failure, we were determined to do it better.  And we did.  We decided to sand down the mold back to the first layer of primer.  We left the protective coating on the plastic this time as well, figuring it would help the mold release easier.  We also left our sheet of plastic a little larger to allow it to stretch around the steep sides more easily.  Here is a video of our second attempt:

Success!  We were all amazed at how incredibly well it worked this time.  We sketched the sharpie line on the formed plastic and with a little prying the mold came out. Using some shears we cut the piece to the rough shape. Using the first bad mold as a tray, Alex hit the inside of the good part with some spray tint from the auto parts store.
IMG_1162 IMG_1167 IMG_1170

 A few minutes later we test fitted it on the helmet half. And to wrap things up, we honed our vacuum forming skills making a few more copies as backups in case the tinting or trimming was difficult.  At this point, things are turning out WAY better than we had hoped.  Our first vacuum forming experience ever turned out to be an amazing success!

IMG_1173 IMG_1175 IMG_1197

Day 11 (Part 2)
Saturday Evening.  Checking up on the printer, it looks like the right side is almost done.  Check out the video to see how the printer can print some overhangs without any support underneath if the angle is right.

IMG_1203 IMG_1202

While that finished up, I tried to figure out why the PCBs weren't working properly.  It turned out that while rushing to finish the design, we completely overlooked the fact that the darlington transistor arrays we chose to power the LEDs are N-channel, meaning they sink current.  We had them hooked up as if they were sourcing current.  Essentially that meant both leads of each LED were connected to ground, so nothing was going to light up.  With some "slight" modifications to the PCB, I was able to cut some bad traces with an exacto knife and solder wires to the right locations.  Voila, we have light!  I wrote up a quick test pattern to make sure the shift registers were working.


We tested the LEDs under the plastic frames.  Danny has the colored material at his house, but a paper towel will suffice for now.  At 2AM, that pretty much concludes our Saturday night.  And even though the right side of the helmet looks exactly like the left side, it is so pretty I have to post it.


But wait, there is more progress!  Click here to see Part 3.