Arduino Lightsaber for/with LED string blade

neskweek:
Thank you Jake.

I already said it before : You've made a really neat job with this.

Actually I think I already almost finish the MPU integration part. I still need to make the example/test sketch but this should take no time.

I did take a look at the DFPlayer implementation. Since it's not totally the same logic that the one I made it might require some adaptation in LSOS too.

But I will need to make some changes too. The first I saw is that you did embark SoftwareSerial lib.
I will need to mod this one because I will use some timer interrupts, and this damn librarie reserve/lock all the timer interrupts available.

Thanks! And yeah, I don't like that I had to do it that way with the SoftwareSerial library. If we can cut that out and do it a different way then I'm all for it. Hopefully lighter weight too, as including the SoftwareSerail library eats up a ton of RAM with buffers and stuff.

Ha ha !

I was just speaking of a little modification of SoftwareSerial :stuck_out_tongue:

When I first started with the DFPlayer I did search for a lightweight alternative but I didn't find any.

But now , I have a better idea on how this thing works, I can give it another shot to find something smaller.

Another solution might be to use arduino's RX/TX pins to connect DFPlayer and use the native serial line but, if I remember correctly from my early tests, it disable USB communications :confused: (so no uploads :(). And anyway DIYino is not wired that way

[EDIT]
Yep, still don't found a lightweight alternative...

Do you use SoftwareSerial for DFPlayer operations only?
If so, and if debug is not implied , we just need the UART send protocol part.

Another alternative might be to rely on Cosa API instead of Arduino API, but it would imply a lot of rewriting.
And I don't know if it would be beneficial in terms of hex size.
Not even sure it's a good idea

Is there a current wiring diagram for usaber for use with the dfplayer?

Soulbp:
Is there a current wiring diagram for usaber for use with the dfplayer?

Not as far as I know. However, it's not too difficult to work out. Just wire Rx on the module to whatever pin you are using for Tx on the Arduino. All the rest is just voltage in and ground connections for power.

Thanks sorry was too specific, I just meant an updated wiring diagram for use with usaber, I suppose it doesn't matter whether it uses dfplayer or not. Does the pro mini when connected via ftdi not supply voltage to vcc like it does if you lose from raw? I think I'm saying that correctly.

neskweek:
Ha ha !

I was just speaking of a little modification of SoftwareSerial :stuck_out_tongue:

When I first started with the DFPlayer I did search for a lightweight alternative but I didn't find any.

But now , I have a better idea on how this thing works, I can give it another shot to find something smaller.

Another solution might be to use arduino's RX/TX pins to connect DFPlayer and use the native serial line but, if I remember correctly from my early tests, it disable USB communications :confused: (so no uploads :(). And anyway DIYino is not wired that way

[EDIT]
Yep, still don't found a lightweight alternative...

Do you use SoftwareSerial for DFPlayer operations only?
If so, and if debug is not implied , we just need the UART send protocol part.

Another alternative might be to rely on Cosa API instead of Arduino API, but it would imply a lot of rewriting.
And I don't know if it would be beneficial in terms of hex size.
Not even sure it's a good idea

My credo is always to try to change the software first, being more easy than to change hardware. This holds true to the SoftwareSerial as well, I'm happy that the YX5200 works with the SS, it could work with HardwareSerial as well, but it has to be confirmed first. But before I invest time in that, first I would like to know which library "eats up" how much code space? Is there a good way to estimate/measure it? Only practical solution which comes into my mind is to start with an empty sketch and add the libraries one at a time. Then once we have the figures, we can have a look which library offers the biggest saving potential.

Actually for instance if I think about the MPU6050 library, it is a very complex library from which we use a tiny bit, but still the whole resides in the code space. So instead of trying to explore tweaking the HW, I would first make the used libraries to include only the code which we need for our particular purposes. I guess this would achieve the most with the least effort.

Protonerd:
My credo is always to try to change the software first, being more easy than to change hardware.

I chuckled when I read this. As a pro dev I've done some strange things in SW throughout my career to cover mistakes made by the HW and network folks. They still haven't given me a cape or spandex suit... the latter is probably for the best. :wink:

Protonerd:
This holds true to the SoftwareSerial as well, I'm happy that the YX5200 works with the SS, it could work with HardwareSerial as well, but it has to be confirmed first. But before I invest time in that, first I would like to know which library "eats up" how much code space? Is there a good way to estimate/measure it? Only practical solution which comes into my mind is to start with an empty sketch and add the libraries one at a time. Then once we have the figures, we can have a look which library offers the biggest saving potential.

I think you'll find that compiler optimizations may cloudy that approach a little. In theory, you can #include all day long, but as long as you don't call a method or use a class, then they should be optimized out and the cost should be nothing. However, different compilers/linkers approach this in different ways and some are better than others at recognizing when something is not needed and leaving it out. Global variables, for example. Some compilers will allocate the memory for an unused variable, while others (with the right options) will not. It's... well, let's just call it "icky".

I do have some encouraging evidence that the compiler used by the Arduino IDE is pretty good at this. I was able to import my USaber library, which collectively is a decent chunk of code, but my image was still only about 6K for my ATTiny85-based saber board that I'm working on now. Because I didn't use most of it, only what was needed was actually included in my Hex file. If I were to new-up an object for every single kind of blade and sound board that it supports, I'm sure we'd see a much larger image.

JakeSoft:
I think you'll find that compiler optimizations may cloudy that approach a little. In theory, you can #include all day long, but as long as you don't call a method or use a class, then they should be optimized out and the cost should be nothing.

I do have some encouraging evidence that the compiler used by the Arduino IDE is pretty good at this.

I learned something again. I really naively though that all libs wouldsimply be dumped into the code space no matter if used or not. This is encouraging, at least it does not matter which libs you include and there is no need to put effort into making them lean :slight_smile:

The last weeks I slimmed down the core code of LSOS, not only to get it fit for just the stuff I need, moreso I added even more with every kb I freed. Now I am able to control a crystal chamber rgb led (which I so badly wanted to have), some additional fancy blinking lights, and I need some more ins and outs on the arduino for a heat sensor and a cooling fan.
Yes, you read right. My plan was to power a photon pump as blade lighting (it eats 30 Watts like peanuts, but squirts 1600 lumen in full rgb), unfortunately this little sucker gets hot as hell, and just a copper cooling plate under the star array chip isn't sufficient anymore to catch up.

Is there a way to get two additional pins by moving the serial stuff to the RX/TX pins of the arduino? From what I've read so far this disables uploading the sketch, but after that the USB connection isn't used anymore, so has someone arround here tried a possible solution, or could point me in a direction?

Ok, so for those in the know, I am getting married saturday and made some staff sabers using my Robo R1+ 3D printer...this video shows one that was my design but made by a pro (though the quality kind of sucks in ABS). It uses LSOS software with my own PCB designed to house an Arduino Pro Mini 3.3V....I reinforced the PLA with Gorilla Glue to help keep it together from the vibration of impact. When I am completely done and have down time I will post a rudimentary mockup 3D design you can modify for your own custom hilts

Here with short blades in (the staff coupler piece is not shown) Dropbox - File Deleted

I'd be curious how you wired your promo I up.

DJWing79:
Ok, so for those in the know, I am getting married saturday and made some staff sabers using my Robo R1+ 3D printer...this video shows one that was my design but made by a pro (though the quality kind of sucks in ABS). It uses LSOS software with my own PCB designed to house an Arduino Pro Mini 3.3V....I reinforced the PLA with Gorilla Glue to help keep it together from the vibration of impact. When I am completely done and have down time I will post a rudimentary mockup 3D design you can modify for your own custom hilts

Dropbox - File Deleted - Simplify your life

Looking pretty good! I'd be interested to see and hear more about what's under the hood.

DJWing79:
Ok, so for those in the know, I am getting married saturday and made some staff sabers using my Robo R1+ 3D printer...this video shows one that was my design but made by a pro (though the quality kind of sucks in ABS). It uses LSOS software with my own PCB designed to house an Arduino Pro Mini 3.3V....I reinforced the PLA with Gorilla Glue to help keep it together from the vibration of impact. When I am completely done and have down time I will post a rudimentary mockup 3D design you can modify for your own custom hilts

Dropbox - File Deleted - Simplify your life

Looks terrific, I like non-metallic hilts more and more. Acually I will also upload some photos on what I'm working on now, it's sooooo much more fun to modify/tweak a plastic hilt! You can do much more with much simpler tools (like having a dremel and a few screw is sufficient) and achieve great results.
@Jake, I recall you are the champion of plastic hilts, aren't you?

Have fun on your wedding DJWing! Have you been able to finish also the DIYino based sabers in time for your wedding?

I just wanted to share with you guys some pics I've made from my most recent build. It is intended for my son, because he masqueraded as Kylo Ren in the school Carneval day (Carneval is a big event in some parts of Germany, where people go around and about in different costumes).

First of all I wanted to implement this using neopixels, due to 2 reasons:

  • I still had 2m of the 60LED/m type I wanted to use up. Although I know it cannot be diffused very well and the individual LEDs will still be visible, but for a child's toy it would be sufficient, also considering that for kids color change and a long battery life is way more important than optimal blade homogenity.
  • I plan to program a flicker using neopixels which comes closest to the agitated, flame like flicker in TFA.

For hilt I modified a toy Darth Vader kid saber hilt I had still at home, because I deemed that the DIYino and all other stuff will fit snugly if I remove all unnecessary plastic parts and also because I can work on a plastic saber with tools I possess at home.

There is a short video intended only as a sneak peek and proof of concept. It shows the saber running an example FastLED code. I still have to re-code my version of the LSOS I upgraded with neopixels, simply because I've overwitten it accidentally with a new version which does not have neopixels support....and my biggest goal is to code a flicker sequence coming closest to a screen accurate Kylo Ren blade.

This is how it started, by taking an old you Vader lightsaber and starting to modify it to look like a Kylo Ren. DIYino is still not wired up, just dropped in there to see if it fits the space available.

The internals of the hilt, including board, neopixels (inside the blades), and recharge port.

Full saber view:

I will post some more pics from the fully finished hilt. Yesterday I added a hole and fixed the recharge port just below the activation box, moreover I stabilized the cross-guard by tapping the blade segments and secure them with screws. Still no pics, but I will show them in an update later...

BTW: I now uploaded a draft DIYino Prime User Manual

Most of the content is quite generic, so it can be used even if you are implementing the circuit using different components.

Great Job guys :wink:
@DJWing79 You made some really kick ass sabers. Happy wedding day buddy !

I too have some great news. I finally achieved a fully functionning hilt !!! I'm so glad !

I ended up soldering the puppy by myself, ended that yesterday night and only burned my left pinkie.
This morning I resolved the two last minors short cuts and made a test with the nearly completed ledstring blade I've made (I need to wrap it and tube it).

All is working perfectly ! AT LAST !!!
The hilt body in itself still need some work to be ended but it now can be used : I still need to wrap some leather on the tube section, carve the pomel, add two strips in the battery holder to ease battery removal and make a better AUX button.

Now the DIYino build is in progress. I'm still at the body design, but at least this time the chassis is ready to go.

Hopefully I'll settle myself for a simpler design, something between Obi Wan's and Saberfoge's Gladius. Parts should be easier to make.

@Protonerd Nice manual :wink:

I have some question :

  • Can the recharge port be used without modification to charge 2 batteries in serial ?
  • If yes, what kind of charger (Voltage and amperage) should I use (these are 2 LiMn2O4 18650 batteries)?

neskweek:
I have some question :

  • Can the recharge port be used without modification to charge 2 batteries in serial ?
  • If yes, what kind of charger (Voltage and amperage) should I use (these are 2 LiMn2O4 18650 batteries)?

Just slightly before the last minute! I was about to drop you a mail, you went dark for so long. But the result justifies the reclusion fully! Make a video once you complete it!

For battery charging I use this one:
https://www.conrad.de/de/ansmann-li-ion-ladegeraet-lic-1-2-5307232510-lic-1-2-liion-lipo-510741.html
It has on the bottom/belly side a roraty sweavel which can be used to select 4.2V charging for a single 3.7V battery or 8.4V charging for a serial connection of 2x3.7V=7.4V battery pack. Depending on if I charge my HP-LED or neopixel saber I use the 4.2V, for LED-string saber I rotate to the 8.4V option. One of the male connectors supplied is compatible with the 2.1mm socket commonly used as recharge port.
I'm not sure if a LiMn2O4 needs a different charging scheme, you know about batteries more than I do...

@Protonerd Nice manual :wink:

BTW, I made a recent update again of the User Manual. Phrasing is still very basic and needs serious polishing, but foremost I want to give guys out there using either DIYino Prime or similar home built circuitry some starting point for the wiring, therefore I've put emphasis on the pictures.
I'm also happy for feedbacks!

It's wonderful to see so many projects coming along. :slight_smile:

Some video you should see....

Lightsaber Sparring Dummies

Cat Fights Dog Lightsaber

So...funny story...I had to reprint my wife's saber just before the wedding....so she had one I made (the white one from the video...I printed one for my nephew...mine was printed for me by a professional house....so...first swing and mine snaps...epic fail....I pick up the two pieces and swing (it was the center connector that snapped...and the ones I printed held up like a champ....sooooo...lesson learned...print my own damn sabers...now for what's under the hood...I didn't have time to wire the diyino because I couldn't find my 5v boost boards and wanted them to work right...I used a arduino pro mini 3.3V atmega 328...the mpu 6050 and the DFPlayer...only problem I had with them using the LSOS is that when I twirled them too much the audio would lock up and the saber would become unresponsive (but light stayed on) and if they were left on for more than 5 min it would shut off and not turn back on until I put in kill switch and pulled it back out...then it worked fine for another few minutes..so...in conclusion...the white one in the video is with my new design for printing the bodies on a 3D printer...I will share a basic design file soon. It involves gluing pieces together and leaving the access bays as the only thing that needs to screw on...thus eliminating a stress point for breakage...oh and I designed this sled for the electronics, battery and speaker but I couldn't use it because my soldering skills still kind of suck and the electronics ended up being a little too tall to fit in the hilt...