Arduino Lightsaber

Protonerd: Thanks splinter and bill for the feedback. The form and charging with USB sure makes it interesting, but what you write makes sense, probably they cannot squeeze the same capacity in and still include an USB connector. Everything comes with a price. I was just happy to happen upon this ad due to the conversation we had about USB charging of the battery cell.

No problem! Didnt want you to try it and be disaapointed in the end.

My preferred set up is an 18650 cell in a battery holder wired to a recharge port and kill key. That way you never have to take a apart the saber to charge the battery but you can still replace the battery if you need to. There are many ways to charge it too, a usb single cell lipo charger are really cheap or if you want faster charge times you can buy a charger from one of the saber makers like saberforge or ultrasabers that already have the 2.1mm plug for the recharge port.

So I'm making progress finally. One line with the WT, working on merging the MPU 6050 code into the design.. but I have what's probably a dumb question:

How the heck do you make a menu work for this? like?? I've been racking my brain.. and I just can't seem to get it.

destructables: So I'm making progress finally. One line with the WT, working on merging the MPU 6050 code into the design.. but I have what's probably a dumb question:

How the heck do you make a menu work for this? like?? I've been racking my brain.. and I just can't seem to get it.

A menu would require a few things.

  1. A way to load and save your configuration (EEPROM)
  2. A way to enter config mode. ex. long press aux button or remove kill key with a button held down, etc, etc.
  3. A way to navigate the menu once in config mode. This can be done with a counter variable and a switch statement, using main and aux button as navigation buttons and long press for confirm.

if( configMode ) //check to see if we are in config mode. { int buttonResult = CheckButtons(); //checks your buttons to see if you up, down or confirm was pressed. switch( menuItem ) { case 1: //handle the button press. } }

just a very simple example, could be done countless of ways.

I think I might have bought the wrong MOSFETs? Or I'm an idiot and I've wired it completely wrong. https://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?catalogId=10001&langId=-1&productId=812236&storeId=10001&krypto=vFgRhKXJZKuM8sLfuPRmxv3tw%2BNp1UpMnGU4ddvL3I4WFZKPJQdG6Q%3D%3D&ddkey=https:StoreCatalogDrillDownView I plug them in and run JakeSoft's sample uSaber code, and it will dim the LED slightly, but it won't turn off. I made sure it's on a PWM pin and everything. (Mild frustration)

EDIT: I'm an idiot. Had it backwards as a mo'suckrah.

destructables: I think I might have bought the wrong MOSFETs? Or I'm an idiot and I've wired it completely wrong. https://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?catalogId=10001&langId=-1&productId=812236&storeId=10001&krypto=vFgRhKXJZKuM8sLfuPRmxv3tw%2BNp1UpMnGU4ddvL3I4WFZKPJQdG6Q%3D%3D&ddkey=https:StoreCatalogDrillDownView I plug them in and run JakeSoft's sample uSaber code, and it will dim the LED slightly, but it won't turn off. I made sure it's on a PWM pin and everything. (Mild frustration)

EDIT: I'm an idiot. Had it backwards as a mo'suckrah.

Glad you got it sorted. Also glad to hear somebody making good use of the USaber library.

JakeSoft: Glad you got it sorted. Also glad to hear somebody making good use of the USaber library.

I won't lie, I'd be up a major creek still without it. It's helped me so much. (Plus when I get frustrated, I plug in my spare arduino with the LED sample code and resistors, and just let it run for a little while. It's very helpful to refresh my dedication by watching that led do its thing. haha!)

I've got a question. I need to step down my 7.2v 1200mah cells to power the wt588d and the LEDs (still with appropriate resistors). I bought a 5v 1a regulator when I bought my mosfets. But I'm a little scared to wire it in because I don't want to blow the regulator. I know I need capacitors (to take out noise?) to go with the regulator... But can I even use that regulator with this? I'd rather blow the regulator than the LED chip or the wt588d, but if I can avoid it all together I'd like to.

Reason I'm not using a single 3.6v cell is that the wt588d and the pro micro I'm using are both 5v. Hoping I haven't sabotaged myself with these cells.

(Actually, thinking about it... Has anyone ever used a separate standalone battery to power just the LEDs?)

destructables:
I’ve got a question. I need to step down my 7.2v 1200mah cells to power the wt588d and the LEDs (still with appropriate resistors). I bought a 5v 1a regulator when I bought my mosfets. But I’m a little scared to wire it in because I don’t want to blow the regulator. I know I need capacitors (to take out noise?) to go with the regulator… But can I even use that regulator with this? I’d rather blow the regulator than the LED chip or the wt588d, but if I can avoid it all together I’d like to.

Reason I’m not using a single 3.6v cell is that the wt588d and the pro micro I’m using are both 5v. Hoping I haven’t sabotaged myself with these cells.

(Actually, thinking about it… Has anyone ever used a separate standalone battery to power just the LEDs?)

Unless your hilt is huge, you’ll want to avoid trying to add a second power supply. Fitting one battery pack is hard enough.

If you are using a WT588D-U (the big one with the USB built in) then you can just power your WT588D off the 5V regulator at the VDD pin. 1A should be plenty. Everything else can get direct battery power, I think. The Pro micro has an on-board regulator, so just power it via the RAW pin by hooking your battery directly up to it. Check your specs, but I’m pretty sure it can take the 8.4V your fully charged pack will have. Use an appropriate resistor for your LED and you can power that directly off the battery as well. That should avoid blowing anything up.

JakeSoft:
Unless your hilt is huge, you’ll want to avoid trying to add a second power supply. Fitting one battery pack is hard enough.

If you are using a WT588D-U (the big one with the USB built in) then you can just power your WT588D off the 5V regulator at the VDD pin. 1A should be plenty. Everything else can get direct battery power, I think. The Pro micro has an on-board regulator, so just power it via the RAW pin by hooking your battery directly up to it. Check your specs, but I’m pretty sure it can take the 8.4V your fully charged pack will have. Use an appropriate resistor for your LED and you can power that directly off the battery as well. That should avoid blowing anything up.

JakeSoft… You’re a godsend. I keep overthinking it. That makes much more sense. I’ll play around with it.

destructables: JakeSoft... You're a godsend. I keep overthinking it. That makes much more sense. I'll play around with it.

No problem. Good luck.

Side note: I've been reading the spec sheet for the WT588D 16-pin version again. I can't seem to find where it specified that VCC had to be 3.3 volts. I thought I saw it in an application diagram somewhere, but now I don't see it. I wonder if the VCC input is 5 volt tolerant just like all of the other pins. If so, then it might be possible to power the 16-pin version with either pure 5 volt or pure 3.3V configurations instead of needing both levels for maximum loudness.

Has anyone tried putting 5V to both the VCC and VDD pins on the sound module? That would make things a lot nicer not needing a separate 3.3V supply anywhere in the system.

I've got a spare 16-pin that I'm never gonna be able to use if anyone wants to risk test it.

Here's the LED chip I bought: http://www.ebay.com/itm/271670227296?

It says 12w RGBw and gives the die voltages as: Red 2.25~2.6V, Green 3.3~3.9V, Blue 3.1~3.7V, White 3.1~3.7V I'm assuming that would mean I'd need the following resistors (going off fully charged 8.4v): Red: 5 ohm 3 watt Green, Blue, and White (each): 4 ohm 5 watt

Is that... anywhere close to right? Apologies for all the questions. I'm trying not to strugglebus on all this electrical stuff.

Values are good but if the white is for FoC, you should be able to get away with a 2~3w resistor as its only momentary.

Canobi: Values are good but if the white is for FoC, you should be able to get away with a 2~3w resistor as its only momentary.

Awesome! Thank you, Canobi!

It's just occured to me that it should be possible to know the WT's memory Vf by measuring the voltage provided to that pin by the programmer board. I'm not near my meter right now but I'll check and get back with the results tomorrow, saves the risk in killing one finding out the hard way.

If someone does happen to have both on hand, ground can be accessed via the button solder joints underneath the programmer board.

Canobi: It's just occured to me that it should be possible to know the WT's memory Vf by measuring the voltage provided to that pin by the programmer board. I'm not near my meter right now but I'll check and get back with the results tomorrow, saves the risk in killing one finding out the hard way.

If someone does happen to have both on hand, ground can be accessed via the button solder joints underneath the programmer board.

That's a good idea. I'm interested in what you'll find.

Here's the results:

|500x375

JakeSoft: Thanks for the link. This guy seems to have all kinds of goodies for sale. :)

I wonder how much flash memory the module actually has. The product description says it can support between 2M and 16M but it doesn't actually say how much is on the one being sold. 2M might be just enough for one font at a low quality sample rate, but 16M would give you breathing room for perhaps 2 or more at a high sample rate. The later being preferable, of course.

I also prudently bought one myself and tested. It has 8M flash. Well, this is not tremendous, barely enough for 1 full sized sound font with hum-extension. With 16M it would be better I guess, and this also would give some motivation to try to reduce hum-extension and put some more effort into hum-relaunch.

On the very positive side this module is smaller than the SD-card version AND worked with my WIN10 first time right. Plug in, copy the files, attach to Arduino the same way as the SD-version, and voila it works (I have a simple sketch which just plays the sounds one after the other in the same order they are present on the whatever-is-used-to-store-them media). Actually - I was caught unprepared - it worked without any modification of the code...I though that I need to specify to the chipset whether it should play from SD or Flash, but it can actually device on its own (the WT5001 could not, that is why I mention).

I need to check whether the chipset (YX5200-24SS) supports greater flash sizes than 16M. Nevertheless I'm very much inclined towards swapping the SD-card for a Flash for the next board design. The thing to figure out is how to program the Arduino AND connect to the Flash chip using the same USB plug.

Canobi: Here's the results:

|500x375

Ah, so more or less 3.3V that we thought all along.

I never did find that diagram where I got the idea in the first place. The data sheet I have does show a diagram where VCC is being powered by 5 volts, but it's being dropped with a diode. They don't bother to tell you any properties of the diode, though. They just call it "D1". Gee, thanks. :-/

Protonerd: I need to check whether the chipset (YX5200-24SS) supports greater flash sizes than 16M. Nevertheless I'm very much inclined towards swapping the SD-card for a Flash for the next board design. The thing to figure out is how to program the Arduino AND connect to the Flash chip using the same USB plug.

I got one too, but it's been sitting on my desk for a few weeks. I haven't got around to testing it out yet (been working on playing with the ATTiny chips). I'm please to hear that available code will work with them. I was also able to direct connect with USB and upload a file with no fuss on Windows 7. So know at least that much works.

Even if you can't get the one-USB concept to work, two micro USB ports side by side should still be smaller than that SD card and free up some real estate on your next gen board.