Arduino Lightsaber

Protonerd:
Are you sure you followed the instructions and used MOSFETs? It seems from your description that you use bipolar transistors instead, which might require a different kind of driving scheme. Please swap your transistors for logic level nMOS transistors and you will be good to go.

Can you suggest me a model of MOSFET to be sure it will work?

Hello guys. Hoping for an advice from expierenced lightsaber builders on a PC tube for a blade. There are basically 2 types I can buy, regular one with flat surface inside(thats what i've been using so far) and there is another type with corrugated surface inside...claimed to better diffuse light. Keen to try it but wondering if anyone already used second type and knows for sure if it's better or worse in terms of a lightsaber blade.

IiN:
Can you suggest me a model of MOSFET to be sure it will work?

Hi,

I use IRF530N, they always worked fine for me.

Andong:
Hello guys. Hoping for an advice from expierenced lightsaber builders on a PC tube for a blade. There are basically 2 types I can buy, regular one with flat surface inside(thats what i've been using so far) and there is another type with corrugated surface inside...claimed to better diffuse light. Keen to try it but wondering if anyone already used second type and knows for sure if it's better or worse in terms of a lightsaber blade.

Most people just use the smooth surface and put in something to diffuse the light (like clear gift wrap). This corrugated interior surface sounds interesting, though. It could actually be a cool effect, but I think you'd be exploring new territory there.

Andong:
Hello guys. Hoping for an advice from expierenced lightsaber builders on a PC tube for a blade. There are basically 2 types I can buy, regular one with flat surface inside(thats what i've been using so far) and there is another type with corrugated surface inside...claimed to better diffuse light. Keen to try it but wondering if anyone already used second type and knows for sure if it's better or worse in terms of a lightsaber blade.

Hello,

I have bought a lightsaber blade with the faceted surface (lengthwise) rather than the traditional round ones we normally use and it was terrible. It just didn't diffuse the light correctly, resulting in a dim, dull blade.

I've never seen corrugated before though. Can you post a link to the product you are asking about?

Messiahlad:
Hello,

I have bought a lightsaber blade with the faceted surface (lengthwise) rather than the traditional round ones we normally use and it was terrible. It just didn't diffuse the light correctly, resulting in a dim, dull blade.

I've never seen corrugated before though. Can you post a link to the product you are asking about?

Maybe I'm wrong with the naming and it's actually called faceted. Added photo of this type

Has anyone tried the DFRobot Beetle? I picked one up for a thermal detonator I'm working on. At half the size of the Nano, it might work great in a lightsaber. It uses an atmega32u4, instead of the atmega328p.

Links:

Bipe:
Has anyone tried the DFRobot Beetle? I picked one up for a thermal detonator I'm working on. At half the size of the Nano, it might work great in a lightsaber. It uses an atmega32u4, instead of the atmega328p.

Links:
Beetle Board - Compatible with Arduino Leonardo - ATmega32U4 - DFRobot
Beetle_SKU_DFR0282-DFRobot

That looks like a good one to try. So small!

As a thank you to long-time DIYino and Arduino Saber supporters, I have made a free version of the STREAM system available for users of DIYino Prime V1 and Home-brew equivalents (Nano + DFPlayer + MPU6050). (Stardust V3 versions are coming soon.) Both RGB in-hilt LEDs and Pixel blade versions are available to try.

This is a work-in-progress, but has passed alpha testing.

You can download for free here:

Presently all features are enabled and working except multi-font support.

A free sound font and all the files you'll need for your SD card are part of the download (see SDCard directory). A special version of my sound font converter tool is also included in the download. This tool can convert any Plecter font to STREAM format. (See SoundConverter directory.) The sound font converter tool's presets are already set to what STREAM expects (correct number of swings, clashes, etc.), so you should not have to touch them. Just select your Plecter font folder, a destination folder to put the converted files, and then convert. Easy!

Note to Mac users: All development and testing was done on Windows 10. The GUI is java-based so in theory it should work on Mac, however the included firmware loader will probably not work. For now Windows 10 is the only officially supported operating system.

JakeSoft:
As a thank you to long-time DIYino and Arduino Saber supporters, I have made a free version of the STREAM system available for users of DIYino Prime V1 and Home-brew equivalents (Nano + DFPlayer + MPU6050). (Stardust V3 versions are coming soon.) Both RGB in-hilt LEDs and Pixel blade versions are available to try.

This is a work-in-progress, but has passed alpha testing.

You can download for free here:
GitHub - JakeS0ft/STREAM at Version1.5_WIP

Presently all features are enabled and working except multi-font support.

A free sound font and all the files you'll need for your SD card are part of the download (see SDCard directory). A special version of my sound font converter tool is also included in the download. This tool can convert any Plecter font to STREAM format. (See SoundConverter directory.) The sound font converter tool's presets are already set to what STREAM expects (correct number of swings, clashes, etc.), so you should not have to touch them. Just select your Plecter font folder, a destination folder to put the converted files, and then convert. Easy!

Note to Mac users: All development and testing was done on Windows 10. The GUI is java-based so in theory it should work on Mac, however the included firmware loader will probably not work. For now Windows 10 is the only officially supported operating system.

Very much appreciated Jake,

I was looking forward to trying it out since you first gave us a preview of your works. Very excited to play with it.

Hi everyone!
First of all, thanks for the inspiring amount of information contained in this thread, you guys have been doing an amazing job!

I'm joining the ranks of those building their own lightsaber, and I have the circuit mostly done, quite similarly to how many of you guys have done it (Arduino Pro Mini 3.3v, adxl335, wt588d-u controlled with a 1-wire configuration, RGB LED controlled via 3 MOSFETs, one 18650 battery with TP-4056 protection/charging circuit). The software is mostly based on Jakesoft's USaber library.

Everything works nicely as long as I test the components one by one (in a configuration Arduino + component). And it still works when I put everything together, as long as I power the wt588-u via USB from my PC.
But as soon as I power the wt588-u with the same battery as the rest of the circuit, a lot of noise starts to appear on the readings of the adxl335, continuously triggering false swings and clashes, even if the sensor is perfectly still.

Note that when I say I power the wt588-u with a battery, I mean I tried every possible way of powering it I could think of:

  • 3.3v on VCC and VDD from the arduino
  • 3.3v on VCC and VDD from a dc-dc converter
  • 5v on VDD via a step-up converter
  • 5v on VDD-USB via a step-up converter
  • USB cable, from the battery via a step-up converter with USB out.

Notice that I have tried two differernt adxl355 and two different wt588-u, so it is not an issue of a single component.

Also, simply adjusting the thresholds does not work, because the false readings I get when I turn on the sound are higher than what is detected as a the strongest swing when the sound is off: I would have to hit the sensor very hard to get any reading at all, at those levels.

At this point I am seriously considering switching to a different sensor, or a different audio player, but I'd rather avoid it if at all possible, given that it would likely take a couple months for them to be delivered.

Has any of you experienced anything similar and do you guys have any suggestion on how to get stable readings from the sensor?

mikyt:
But as soon as I power the wt588-u with the same battery as the rest of the circuit, a lot of noise starts to appear on the readings of the adxl335, continuously triggering false swings and clashes, even if the sensor is perfectly still.

Has any of you experienced anything similar and do you guys have any suggestion on how to get stable readings from the sensor?

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?

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.

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

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

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.

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.

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 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

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

Arduino Lightsaber - Exhibition / Gallery - Arduino Forum

All your questions are answered if you are willing to research this site: GitHub - Protonerd/FX-SaberOS: System code for Arduino based Lightsaber replicas for DIYino family boards

Hi Jake,
first of all, thanks for your reply. Sorry for "ignoring" it: I somehow completely missed it.

JakeSoft:
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

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.

Protonerd:
All your questions are answered if you are willing to research this site: GitHub - Protonerd/FX-SaberOS: System code for Arduino based Lightsaber replicas for DIYino family boards

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);
}