Arduino Lightsaber

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.

privateRob:
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!

Thanks!

Right, no amplifier needed (although you could certainly add one if you wanted it louder and could find room for it). I don't have any equipment that would allow me to measure it in db, but it's loud enough for me. Smartphone on full volume is probably a pretty good comparison.

I used this speaker in the finished product (8 ohm, 2W):
http://www.thecustomsabershop.com/2W-28mm-Bass-Speaker-P662.aspx

During my breadboarding, I used a very cheap 8 ohm 0.5W speaker that I harvested from a toy. It worked fine, but the sound quality was pretty terrible. Really you should be able to use any 8 ohm speaker with at least a 0.5W power rating. It all depends on your budget and what kind of sound you're looking for. I'll leave that discussion to the audiophiles.

Thanks for the help I will try it out and see what I can get working totally new to programming so any help is appreciated

wildjack6:
Thanks for the help I will try it out and see what I can get working totally new to programming so any help is appreciated

Glad I could help. Just be sure call the WT588D_Send_Command() function from somewhere outside your main loop, like when a button is pressed or something, otherwise you may get odd behavior.

Playing with it hopefully can figure it out lol

Thank you!
You Sir earned your first karma for all the questions you answered in this thread!

privateRob:
Thank you!
You Sir earned your first karma for all the questions you answered in this thread!

Yay! 8)

You can throw a few pictures of the entire system with speaker and LED??? :smiley:

You have a very saleable winner there. Thats why you are being quizzed so thoroughly. Hang on to it man and send it to someone who can manufacture it for you . You will make a fortune

I am getting ready to start a similar build and had found the same swing sensor but the part I cant figure out is how to configure it to detect a swing and not a tilt as the data sheets show its primary a tilt sensor.

I had thought about mounting it vertical the hilt with ball contact down but then if you tilt the saber at the ground it would continually trigger a swing.

Do you just detect on change condition but then I would think a slow tilt would still trigger a swing event and the toy sabers don't seem to do that and I am sure the expensive sound boards don't.

b-james:
You have a very saleable winner there. Thats why you are being quizzed so thoroughly. Hang on to it man and send it to someone who can manufacture it for you . You will make a fortune

It's funny you should say that. I posted up a similar thread to this one in the forums at The Custom Saber shop and the moderator wasn't too keen on people asking me how was built since they sell lightsaber control boards.

While I really just built this for fun and not for sale, everyone tells me I should sell it. LOL