Arduino Lightsaber

Totally cool !

flyingangel:
Hi!

Wow, your lightsaber is realy cool! I'd like to update my one too! Do you have any shematics of your version? Which LEDs did you use?

Thanks for sharing,
Robert

Thanks! I am willing to share the design, but I don't have anything that is easy to share digitally; only hand-done drawings in a paper notebook. Give me some time to put something together.

Usually we don't have schematic capture software and most of us hate Fritzing because it is not a schematic so what we do is just take photos of the hand drawn stuff and post the photos. My cell phone camera is 8 Mega pixels so it is more than clear enough. I mean let's be realistic here. The guy just cares about how to build it, not how pretty the schematics are. If all the information is there I would say just put it out there as photos, and leave at that.

I made an attempt to transfer the most useful drawing from my notebook. I don't have a good program at home for drawing schematics, so please excuse the crudeness of it.

Not shown are the bits where the N-channel MOSFETs are used to switch the main LEDs. That part is pretty straight forward, though. I hope this helps. If you build it, post up here; I'd love to see what somebody else does with it.

Perfect. Thanks ! What kind of leds ? What current rating will the Mosfets need. ?

I used a Luxeon Tri-Rebel star LED array like this one:

The Cree version would also work:
http://www.ledsupply.com/leds/cree-xpe-indus-star-rgb-high-power-led

The Custom Saber Shop sometimes has a version in stock with a deeper blue LED. I haven't tried it, but some claim that it makes a better purple when the colors are mixed with red.
http://www.thecustomsabershop.com/Luxeon-Tri-Rebel-Star-P777.aspx

Depending on the color, max current on these kinds of LEDs can range from 700mA to 1500mA. You shouldn't have a problem finding FETs to handle that. Mine are rated for something like 18 amps!

Also, I am noticing I made an error on the diagram. The negative for the WT588d should be on the far left pin at the top, not the right. I'll try to get a fix up for that tonight when I get some time.

Is there more than one led ?
FYI, if anyone is interested, the attached datasheet is for this mosfet from sparkfun (30A)

RFP30N06LE.pdf (189 KB)

Yes, there is more than one LED (there are three) used to light up the blade in my project example. The way I accomplished changing colors was to use varying levels of Red, Green, and Blue light that mixed together in the blade. At a very basic level, this same method is used by TVs and such to create different colors for each pixel. That's why you'll notice I have the blue lines to the MOSFET gates all connected to PWM-capable pins on the Arduino.

You don't have to do it that way. To simplify the project and operate with a single LED for the main blade, you could drop say pins 5 and 6 and drive a single MOSFET and single LED for the main blade on pin 9. That way you could still have the ramp-up/ramp-down effect during power on/off. You would loose color change and flash-on-clash functionality (at least, you'd have to come up with another implementation, maybe pulse the output or something instead of changing colors), but it would be easier to code and use fewer components (also cheaper, more room in your hilt, etc).

An example of this type of LED would be this:
http://www.thecustomsabershop.com/Luxeon-Rebel-Star-P523.aspx

Also available here:

For the sake of others who are interested and don't know how to write the code to drive the leds, are you going to release your lighting code ? I saw the link for the sound code.

This will get you started:

Programming-wise, fading these high-powered LEDs is no more complicated than that.

I corrected the schematic in a previous post.

Roger that.
Schematic in Reply#6 corrected.

Nice! The Force is strong with this one 8)

Just curious what you used for clash and swing sensor

Swing Sensor:
http://www.thecustomsabershop.com/Swing-Sensor-SW-200D-P486.aspx

Clash Sensor:
http://www.thecustomsabershop.com/Clash-Sensor-SW-18020P-P485.aspx

So this module can actually do gapless play back? Excellent!

Awesome² 8)

What speakers did you use? (8ohm 0.5watt?)
How many db did you get? (It seems as loud as a smartphone on full volume)
On your schematic you didn't use any amplifier, right?

Since you nearly answered all component related questions, you should add the whole list to the first post if possible!

purgedsoul:
So this module can actually do gapless play back? Excellent!

Yes! Two ways to do it, even:

  1. There is a "repeat" serial command that you can send. It will repeat whatever sound is played with no gaps. As long as there are no dead spots at the start or end of your sound files then it works great.

  2. You can program the WT588d to play a list of up to something like 200 sounds when commanded. Sounds are played back-to-back with no gaps.

Would you be willing to share some of your code for the soundboard I started playing with it but can't figure out how to get it to repeat any suggestions would help

wildjack6:
Would you be willing to share some of your code for the soundboard I started playing with it but can't figure out how to get it to repeat any suggestions would help

Sure. Here is the most important part of the code from SugarBombs:
(See full code here: WT588D-16P Sound Module Working Code - Audio - Arduino Forum)

void WT588D_Send_Command(unsigned char addr) {

  unsigned char i;

  digitalWrite(WT588D_CS, LOW); 

  delay(5); //delay per device specifications

  for( i = 0; i < 8; i++)  {    
    digitalWrite(WT588D_SCL, LOW);    
    if(bitRead(addr, i))digitalWrite(WT588D_SDA, HIGH);
    else digitalWrite(WT588D_SDA, LOW);          
    delay(2);  //delay per device specifications   
    digitalWrite(WT588D_SCL, HIGH);    
    delay(2);  //delay per device specifications 
  } //end for

  digitalWrite(WT588D_CS, HIGH);

} //end WT588D_Send_Command

Try putting this somewhere in your code:

//Turn on repeat mode
WT588D_Send_Command(0xF2);

//Begin playlist 0
WT588D_Send_Command(0x00);

Of course, make sure the WT588d is configured for 3 line serial mode.