Go Down

Topic: Arduino Lightsaber (Read 366159 times) previous topic - next topic

JakeSoft

If this video gets enough likes, I'll unlock multi-font support in the free version of STREAM. Watch until the end for details!

S.T.R.E.A.M. is Free Video


Protonerd

This is definitely a stellar Episode of the Arduino Saber Story!!! I already did my homework, at home 4 sabers are now running the S.T.R.E.A.M. show and every time I ignite it, it is another time to be amazed. I definitely contribute to those sound profile extensions

MrDoggss

#1442
Mar 23, 2019, 07:32 am Last Edit: Mar 23, 2019, 07:37 am by MrDoggss
I've been following this thread for a long time, and am happy to see people still posting.  Figured I would post my latest, since it's based on Jakesoft's OP.

LED string blade is coming along, and I'm starting work on the hilt.  The biggest progress I have made is the electronics. After doing some testing, and ordering parts (still need more parts...)  here is what I did.

I designed a board, and had it made.  1st try at this, and it shows.  It works, and now I just need to solder IC sockets and connect wires. Nothing special, but not bad for a prototype.







JakeSoft

I've been following this thread for a long time, and am happy to see people still posting.  Figured I would post my latest, since it's based on Jakesoft's OP.

LED string blade is coming along, and I'm starting work on the hilt.  The biggest progress I have made is the electronics. After doing some testing, and ordering parts (still need more parts...)  here is what I did.

I designed a board, and had it made.  1st try at this, and it shows.  It works, and now I just need to solder IC sockets and connect wires. Nothing special, but not bad for a prototype.

Hey, that's pretty cool. It's a brew-board for my original design! There was a guy "Canobi" who did something similar quite some time ago. (I'm not sure what happened to him or his inventions; we haven't heard from him in a long time.)

Does your board assume 3-wire or 1-wire serial for the WT588D? What are you using for the software? It's exciting to see some new stuff.

Chevyrwicked

I have been seeking full Arduino code for lightsaber. all I see all your file is random code and I couldn't understand how to put it together at all. this pic below is what connected right now without mos regulator. but I have step down dc to dc inverter.  I have 5 file loaded to wt588d-u for 00h file for one line mode (001 lightsaberpulse.wav, 002 ltsaberswing05.wav, 003 ltsaberhit01.wav, 004 ltsaberon01.wav, 005 ltsaberoff01.wav). is there any way how I code Arduino for this design I have now?

thanks
rob

http://forum.arduino.cc/index.php?topic=261980.105

Protonerd

I have been seeking full Arduino code for lightsaber. all I see all your file is random code and I couldn't understand how to put it together at all. this pic below is what connected right now without mos regulator. but I have step down dc to dc inverter.  I have 5 file loaded to wt588d-u for 00h file for one line mode (001 lightsaberpulse.wav, 002 ltsaberswing05.wav, 003 ltsaberhit01.wav, 004 ltsaberon01.wav, 005 ltsaberoff01.wav). is there any way how I code Arduino for this design I have now?

thanks
rob

http://forum.arduino.cc/index.php?topic=261980.105

All your questions are answered if you are willing to research this site: https://github.com/Protonerd/FX-SaberOS

mikyt

#1446
Apr 02, 2019, 10:15 pm Last Edit: Apr 02, 2019, 10:20 pm by mikyt
Hi Jake,
first of all, thanks for your reply. Sorry for "ignoring" it: I somehow completely missed it.

Welcome!

Your setup sounds very similar to what I used for my Mk. III saber. The only difference is that I used the 16-pin version of the WT588D. I did not experience the same issue you describe, however I seem to recall others saying they have. Maybe I just got lucky. What kind of battery are you using?
I'm using a 3.7v 18650 LiPo battery, and a step-up converter to bring it to 5v.
I have tried powering the WT588D chip in any possible configuration I could think of, with 5v or 3.3v, coming from either the Arduino or a variety of set-up/-down converters drawing power directly from the battery. All to no avail

Quote
One  possibility is that you have an EMI problem with the power to your ADXL335 where having the sound active is introducing noise and causing your readings to go crazy.  To test this, try adjusting the volume of the sound to a really low number while monitoring your sensor and see if the readings level out. (use the SetVolume() function on the WT588DSoundPlayer). If the readings become stable at low volume, you may need to introduce a decoupling capacitor somewhere in your circuit to smooth out power delivery. 
I had independently come to the same hypothesis about the noise. I haven't tried lowering the volume, but I had started experimenting with various capacitors in various positions.
In the end I figured that the noise travels along the data connection (I'm unsing the 1-wire protocol) between the arduino and the sound chip. If I unplug that cable while a sound is already playing the noise disappears, the readings from the sensor become reasonable, and the noise in the sound disappears as well... and of course I cannot trigger new sounds, at that point, which is of course unacceptable.

The way I managed to make everything bearable was:
1) switching to a GY-521 as the sensor: it seems to be much more robust to noise
2) powering the WT588D chip with 5v from a step-up converter, and adding a 10uF, 50v capacitor in parallel the 5v, right next to the WT588D. This doesn't help with the noise on the data line, but at least reduces the noise I hear from the loudspeaker.


All in all, this works. Still, I'm a bit unhappy with it. I have just received a DFPlayer mini, and I'm experimenting with it to see if it behaves any better, before finalizing my build.

I'll try and send an update here when I know more.

Chevyrwicked

All your questions are answered if you are willing to research this site: https://github.com/Protonerd/FX-SaberOS

thanks for info tho and it took me a week to figure that link you provide to do the research. but I coded it for myself using wt588d-u and Arduino nano usb by those research and this is what I come up with below with the code and I tried my best when I push button. nothing work. but wt588d-u I have reprogrammed to key mode.

const int buttonPin = 10;     // the number of the pushbutton pin
const int ledPin =  1;      // the number of the LED pin
const int humPin = 2;
const int clashPin = 3;
const int swingPin = 4;
const int clash_sensorPin = 6;
const int swing_sensorPin = 7;
const int threshold = 100;

int buttonState = 0;         // variable for reading the pushbutton status
int sensorReading = 0;

void setup() {
 pinMode(buttonPin, INPUT); // button
 pinMode(ledPin, OUTPUT); // led
 pinMode(humPin, OUTPUT); // hum sound
 pinMode(clashPin, OUTPUT); // clash sound
 pinMode(swingPin, OUTPUT); // swing sound
 pinMode(clash_sensorPin, INPUT); // clash sensor
 pinMode(swing_sensorPin, INPUT); // swing sensor
 Serial.begin(9600);       // use the serial port
}

void loop() {

 buttonState = digitalRead(buttonPin);
 if (buttonState == HIGH) {
   // turn LED on:
   digitalWrite(ledPin, HIGH);
   digitalWrite(humPin, HIGH);
 } else {
   // turn LED off:
   digitalWrite(ledPin, LOW);
   digitalWrite(humPin, LOW);
 }
 sensorReading = digitalRead(clash_sensorPin);

 if (sensorReading >= threshold) {
   digitalWrite(clashPin, HIGH);
   Serial.println("clash!");
 }
 sensorReading = digitalRead(swing_sensorPin);

 if (sensorReading >= threshold) {
   digitalWrite(swingPin, HIGH);
   Serial.println("swing!");

 }
 delay(100);
}

MrDoggss

#1448
Apr 18, 2019, 11:22 pm Last Edit: Apr 18, 2019, 11:23 pm by MrDoggss
Hey, that's pretty cool. It's a brew-board for my original design! There was a guy "Canobi" who did something similar quite some time ago. (I'm not sure what happened to him or his inventions; we haven't heard from him in a long time.)

Does your board assume 3-wire or 1-wire serial for the WT588D? What are you using for the software? It's exciting to see some new stuff.

I used the 3 wire config for the WT588D.  Software wise, I will be honest, I have few versions saved and I'm not sure who created them. They are definitely from references somewhere in this thread though. Once I figure it out I will post credit for it. 

I'll have to modify whatever I use since I am running a Pro Mini with 2 main LED's. I am not a coder, so that could be interesting! lol

F4LL3N

#1449
Apr 20, 2019, 06:28 pm Last Edit: Apr 20, 2019, 08:52 pm by F4LL3N
Hi All, I'm working on my very first homemade Lightsaber, and I've decided to do it with FX-SaberOS.

For my build I'm using a home-brew (Arduino Nano) + MPU6050 + DFPlayer Mini. The DFPlayer is not a XY original one, but it does has a blue led and the white marks around the soldered parts, so I think it should work. For the power supply I'm using an old charger connected to the breadboard and connected to the VIN connector (the charger provides 6~7v).

The sketch version is latest from master, and I've configured to use the DIYino PRIME board, and STRINGLED (at least for testing, I haven't really decided which blade to use yet), and the sound founts used are the ones from the git repository, but I've only copied the "SF01_VanillaLyte", which is the soundfont I'm using.

So far, and after several retries, I've mange to get it working, well, most of it. I'm having a small issue with sounds. The sounds seems to be OK (though sometime it appears to me they get all mixed up, in those cases I just restart the board, and it starts OK), the problem is the blade ignition sound doesn't seems to finish, it gets stoped before, and there is no HUM nor swing sounds. In other words, you ignite the blade, then silence, press the main button and the blaster sounds, then silence... you shut the blade off, and then silence (actually that last one is OK hehe).

Can anyone give me a hand to find what could be happening? From what I've read some possible options are: the SD card format/copy problem, the fake DFPlayer, but I'd like to know if is there any other thing I could be missing here.

Thanks in advance!

Find attached a pic of my "first attempt" circuit.


EDIT: On a second thought, my problem might be related to this issue: https://github.com/Protonerd/FX-SaberOS/issues/85

Since I'm only using a single soundfont, my first soundfont is also my last one.

Go Up