loading
I've been invited to go to a friends 40th birthday party and want to take a present that will be appreciated. He is a bit of a tech head and has also been known to get drunk and shout PANTS! a lot. So I've decided to make him a pair of flashing LED disco pants.

The idea is that the LEDs will be controlled by an Arduino so they can be flashed in sequence. To achieve this each LED on the pants will be separately addressable but to do this without a large number of unnecessary wires in the undergarment I will be using the Charlieplexing method to power them. There will be four strings of 12 charlieplexed LEDs
and each string of 12 LEDs will only need  4 wires. So a total of 12 wires will be needed to control the whole array of 48 LEDs.

The other advantage of multiplexing a Charliplexed array of LEDs is that only one LED per array will be ON at any one time. The down side to this is that they will have to be rapidly flashed or multiplexed to give the illusion that more than one is on at a time and that is more complex code on the arduino. However the big benefit is in power saving as there will be a potential of 4 LEDs on at any one time (one for each 12 LED string) which will lower battery consumption enough to get away with using a 9 volt battery.




Step 1: Materials

I only had this idea a week before the party so I had to use materials I had in my junk pile and 'left over bits' box. I'm glad I buy LEDs in bulk numbers.

Materials
Pants, Good old fashioned Y fronts are the best
LEDs Blue (36) and Red (12)
Resistors (Red 130 Ohm) (Blue 80 Ohm)
Arduino
9V battery
Battery clip
Coloured wire
Heat shrink tubing.

Tools
Soldering iron
Computer and Arduino IDE
Pre-programmed arduino processor.
Big assed needles
Sewing machine (but you could probably sew by hand as an alternative)

Plus the usual small workshop tools.

Step 2: Pants Selection.

First was to select some appropriate underpants. As I normally go commando  I didnt realise the choice was so vast and I very quickly settled on the traditional 'Y' fronts basically because I childishly think that they will have more comedic value. Especially as I will be able to illuminate the 'Y' with more LEDs

On a more practical note the thicker seam around the edges and the seam forming the Y will also provide some extra thickness to hide the wires and LED legs in.

I did contemplate a pair of boxers which being loose would have potentially made them more comfortable to ware but the concept of an LED Y on them won the choice.

Step 3: LED Brightening

The high brightness LEDs I was using have a very directional viewing angle so I scuffed up the plastic surface with some sandpaper. You can see that after this the LED is bright from angles. It was tedious to do this for all 42 LEDs but very well worth the effort.

This is a photo of the 10mm LEDs I used to test the idea, I used 5mmLEDs for the actual project.

Step 4: LED Charlieplexing.

Because space is at a premium and there are only a limited number of pins available on the Arduino I have only two choices if I want each LED separately addressable. The first choice is to use a shift register or dedicated LED driver chip but this would have in its self needed to be housed in the pants and connected to each LED which is not the level of complication I want to go to in this project., The other way is to use Charliplexing. I know that on its own charliplexing can only drive one LED at a time but if they are then multiplexed then they can all appear to be ON.

Diagram of charliplexing.

The description of how charlieplexing is worth its own Instructable and there are a few really good ones to check out.

One benefit of charlieplexing is that each string of 12 LEDs can only have on illuminated at a time. So with the LEDs getting 10Ma each 4 strings of 12 LEDs will only be using 40mA plus the arduino power. This means a single 9 volt battery will last all night and bulky AA batteries can be avoided.


Step 5: LED Location

As these are supposed to be made for maximum comedic value for a party I chose to simply highlight the outline of the pants and also the 'Y'. I did contemplate random positioning of the LED but gave up as that would simply be spangly pants with little humour.

There is 4 strings of 12 LEDs
One around the left leg hole
One around the Right leg home
One around the middle
One on the 'Y'

The left leg and right leg holes will be common and display the same pattern. The Y and belt line will be separate.

Step 6: Sewing the Tape On.

The cotton tape is very important as it will enclose the wires and LED legs. This will make them more comfortable to wear and help hold the LEDs in position. I sewed on one side of the tape before fitting and wiring the LEDs. The other side will be sewed in position after they have been thoroughly tested for wiring errors.


NOTE: It is important to stretch the elastic as you sew the tape on. If you don't do this they wont stretch and you wont be able to get them on when they're finished.

ALSO NOTE: The cotton tape is fitted on the inside of the pants!


Step 7: Mounting the LEDs

This is where the big assed needles come in useful. The LED legs are not strong or sharp enough to pass through the elastic in the band around the top of the pants or around the leg holes. This is over come by poking the two big needles through to make a pair of holes that the LED legs can pass through.
You'll have to measure the waist of your pants and mark out 12 evenly spaced marks so the LEDs are positioned evenly.

Step 8: Connecting Up the LEDs and Arduino.

The LEDs are then soldered to wires as marked out in the charliplexing circuit diagram. The LED legs are cut short and bent over to stop them falling out. Heat shrink is added to provide some extra physical support for the LED and to cover any sharp wire ends.
Take care to give some extra wire between LEDs to allow the elastic to stretch! I gauged how much extra to leave by stretching the elastic and marking the wire with a pen before cutting it.

The resistors were soldered 'in-line' and then protected with some heatshrink.

I used a 9volt battery to test that each LED lit up when it should. I made a few mistakes and had to reverse a couple of LEDs before it was perfect.

The Arduino was sewn into place on the outside side of the side pants and the 9 volt battery clip was sewn onto the other side.

The whole process of soldering and heat shrinking took about 5 hours.

Step 9: At the Party.

The Pants were brilliant even though I didn't get the flashing pattern I wanted due to lack of programming time after the mammoth 5 hour soldering frenzy. Everyone loved them and in the darkness of the farmers field and bonfire the effect was dazzling.

They were difficult to photograph as the camera flash made them look off and the digital camera would not  focus in the dark. The video is the only working shot of them that was made before they were broken.

The only problem is that at some time just before daybreak birthday boy fell over and landed arse first on the Arduino and smashed it rather badly which was a shame but at least they survived for most of the long dark night hours.
Yes. Just yes.
<p>No schematics, huh?</p>
<p>No schematics, huh?</p>
<p>Hmmm... do you need to dry-clean the Y-fronts had it survived? I can't imagine it be thrown in the washing machine with all the wiring in place.</p>
<p>Okay I now I seen everything!!!!</p>
but why?!
A good point, very well made. <br>It took so long to solder up the LEDs that I simply didn't have time to make a up a bit of perf board to hold the micro. I even had a ATMEGA8 with a bootloader burnt on it ready to knock the cost down a few more points but the party date was fixed and as they say, Time and Tide Wait for no Man.
Why did you used a Arduino Duemilanove module? wouldn't it have been more reliable to use some perfboard and a simple bit of componets soldering it might have taken a extra day or 2 but would have been way more flexible because of lack of parts to be bent/snapped off, also those duemilanove boards are like $30 aren't they? Other than that this is a really nice project!
Nice, but was disappointed in the video...<br><br>I was hoping for some older bald guy (with a beer belly) doing the Saturday Night Fever dance with nothing on but these :(
Totally awesome.
Blinking undergarments, that's a brilliant idea! You know in case you're jogging at night.......in your underwear!
I thought you would have also wired up a disposable camera taser circuit to it for your friend. It's not going to hurt a bit.
That's a great idea!
The Flux Capacitor, now in underpants! Although running at 88 miles per hour could be troublesome..

About This Instructable

9,711views

12favorites

License:

Bio: I'm a keen motorcyclist with a collection of post-apocalyptic looking bikes and sidecars. I enjoy touring about for my holidays with my dog who ... More »
More by o0mouse0o:Disco pants! Awesome Twin Spotlamps Large Arduino Prototyping Shield 
Add instructable to: