Go Down

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

#### billpealer

#645
##### Feb 05, 2016, 03:11 pm
Completely right.
I would only add, that most current control circuitry actually varies the voltage to make sure the current is constant. Reason is, it's easy to play with voltage. Usually then there is a shunt resistance to sense the current (convert the current to voltage again), and based on that sensed current (which is a voltage, lol), adjust the voltage to ensure the current is stable.
hook a car battery up to your buckpuck, don't PWM control it or analog potentiometer it,..  plug it into your blue luxeon.  start the timer.

#### wailer

#646
##### Feb 05, 2016, 03:33 pmLast Edit: Feb 05, 2016, 04:02 pm by wailer
I know, but i think i can can tackle that problem myself found some other example code that will get me started, should not be too hard.
Will post examples as soon as i got it figured out.

If you wan't to teach people how to fish hand them a fishing rod .

btw was my i++ explanation any help?

#### JakeSoft

#647
##### Feb 05, 2016, 05:41 pm
hook a car battery up to your buckpuck, don't PWM control it or analog potentiometer it,..  plug it into your blue luxeon.  start the timer.
If we are waiting for the LED to blow up, then we'll be waiting for a really long time. 12 volts is 12 volts, regardless of the source. Because science.

#### billpealer

#648
##### Feb 05, 2016, 09:14 pmLast Edit: Feb 05, 2016, 09:45 pm by billpealer
If we are waiting for the LED to blow up, then we'll be waiting for a really long time. 12 volts is 12 volts, regardless of the source. Because science.
the buckpuck model in question is variable voltage based on the input.  7v in would yield 3.4v 700ma (according to luxdrive)  12v in would be,...  more.  this is from Luxdrives FAQ

"Can I input more voltage than my LEDs need or will that hurt my driver and/or LEDs?

Yes, you can input more voltage than your LED needs as long as it is in the driver range of 5-32VDC. It is best practice to use an input voltage that is closer to your needs. For example if your system ran around 7 volts, it is better to stick with the 12VDC than to use a 24VDC, whereas the 24VDC input would still work, it is better for the system overall if you used the closer value."

do you think the buckpuck can intelligently detect the MAX VF for any 3W LED and alter its voltage? If so,..  where does all the extra V go,?..  it's not being converted to A like most buck/boosts,  that = heat on the puck.   i was not interpreting that as the case from the above Q/A. 7v and 700ma will cook a 3W LED with passive cooling.  7v * 700ma = 4.9 Watt

stop judging me!

#### DJWing79

#649
##### Feb 05, 2016, 11:04 pm
ok, here's another question....can I use one buckpuck to drive the constant amperage out at 1000 ma but not use the control pin (not getting a dimmer module) and instead have the Negative out feed through a N-FET gate like my current build...would that work? I haven't done my test yet, but I've heard the buckpucks don't generate heat in the same way a boost module would

#### Protonerd

#650
##### Feb 06, 2016, 04:09 pm
hook a car battery up to your buckpuck, don't PWM control it or analog potentiometer it,..  plug it into your blue luxeon.  start the timer.

"The 3021/3023 Wide Range LED Power Module is a high efficiency dc to dc converter which delivers a fixed output current by varying the output voltage as required to maintain the specified current .  A fast response current-sensing circuit permits the unit to be used in applications where flashing or pulsing of the LEDs is required."

I swear I did not, I simply have tons of experience with such circuits.

#### Kdot

#651
##### Feb 08, 2016, 07:57 pmLast Edit: Feb 08, 2016, 08:03 pm by Kdot
So been a minute on posting here, however the progress has not stopped.

I completely have redone my coding, using this for my switch and swing Click here. I was looking for who posted there code for the plasma saber, thanks for that! Did have to add a bit more coding to make the debounce work though.

I have worked out most my audio issues. Start up to Hum is seamless now, and was able to get rid of the 1700ms delay. Working on getting swing to be long enough to hear and switch to Hum seamlessly, only hangup i have now is getting the full swing to play quick enough for another swing, however i think a second sensor might help that. Also have my 3W Cree Blue LED hooked up. Will try and get a video soon.

Sample code:

else {
PlayComplete(2);
SABER_On = true;
Serial.println("Saber is off, turning it on");
// sets the value (range from 0 to 255):
// wait for 30 milliseconds to see the dimming effect
delay(30);
}
PlayLoop(1);

}
}
//Is a swing detected
if (SW_justpressed[1]) {
SW_justpressed[1] = 0;
if (SABER_On) {

Serial.println("Swing detected");
Serial.println("Playing swing sound");
PlayComplete(randNumber = random(3, 7));
delay(150);
PlayLoop(1);
}

#### purgedsoul

#652
##### Feb 10, 2016, 04:34 pm
only hangup i have now is getting the full swing to play quick enough for another swing,

been working on this part, something about using the delay function to wait for the first sound to finish, is doing this. Need to replace this with a non-blocking delay... if anybody can come up with this solution please do share.

#### DJWing79

#653
##### Feb 10, 2016, 06:49 pm
have you tried using millis?

#### Kdot

#654
##### Feb 10, 2016, 07:35 pm
been working on this part, something about using the delay function to wait for the first sound to finish, is doing this. Need to replace this with a non-blocking delay... if anybody can come up with this solution please do share.
purgedsoul! thank you so much, i took the sample code you had posted previous and have been reworking that to fit my setup.

@DJWing79, i started to play with that, but was not 100% sure of what i was doing, but was kind of a side thought while working something else out

#### wailer

#655
##### Feb 11, 2016, 12:17 amLast Edit: Feb 11, 2016, 12:28 am by wailer
Sample code, wtd533 arduino library and even saber wave files can be found here https://github.com/ACDCLabs/WT588D.git
Even a complete bin file that can be uploaded to the 533 directly is in the repository.

Too bad no accelerometer code, but hey my own code is slowly coming together.
Thanks JakeSoft ahum....just kidding i mean Ecloud thanks for the fish man

#### stinky1

#656
##### Feb 11, 2016, 05:27 am

Here is a link to a lightsaber build that has RGB PWM code in it.  It uses a Joe Jedi or MR616 sound card,  so of course this is not a drop it in and it will work code for the whole shebang,  but will show you code that will need to be adjusted to your build.

Arduino as RGBx PWM controller and Soundcard interface

I was gonna post the code,  but its over 9,000 limit lol!!!

#### purgedsoul

#657
##### Feb 11, 2016, 07:25 am
purgedsoul! thank you so much, i took the sample code you had posted previous and have been reworking that to fit my setup.

@DJWing79, i started to play with that, but was not 100% sure of what i was doing, but was kind of a side thought while working something else out

#### JakeSoft

#658
##### Feb 11, 2016, 08:23 pm
Thanks JakeSoft ahum....just kidding i mean Ecloud thanks for the fish man
You are welcome for the parts lists, sample code, 100+ support posts, this thread, example videos, and of course the original idea.

#### wailer

#659
##### Feb 12, 2016, 12:11 am
You are welcome for the parts lists, sample code, 100+ support posts, this thread, example videos, and of course the original idea.
Of course thanks for that, without this thread i would not have come this far.
But sifting through all snippets of sample code is pretty hard work and contributing to a  more or less completed code would be more efficient, and more of a "open source" idea.
But that is my humble opinion.

Go Up