Go Down

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

Canobi

Finally got the 3w amp modules :)




The solder pads don't have holes but the exposed pads and lack of componants underneath makes for a kind of SMT hybrid so I set about making a footprint. However, I couldn't find any info regarding pad spacing and dims, so to get round that problem I cropped and scaled a pic of the amp to overlay on screen grabs of footprint edits until I had it right.

The amps will need to be soldered on by hand though as the components on the module have been through the reflow process once already and its not a hood idea to keep subjecting componants to those kinds of temperatures.

With that in mind, my plan is to load the pads with solder paste and sandwich it between the two boards as per the SMT norm, though for this trick to work with an iron, I extended the footprint pads out from under the amp a little so I have somewhere to apply heat:



So far I've only added the amp to the 3.7v board and will look at updating the 7.4v board as soon as I have time.



As a side note, I happen to have a few of these amps going spare, as well as some 2w full range speakers (27mm diameter) so if anyone is in need of either, just hit me up.

JakeSoft

Finally got the 3w amp modules :)



Wow, that's even smaller than the PAM8403 modules I somebody else suggested. They are so cheap, I've bought 5 of them from ebay, but haven't had time to try them out yet.


JakeSoft

#722
Mar 12, 2016, 10:13 pm Last Edit: Mar 12, 2016, 10:20 pm by JakeSoft
Here is another drop of the Universal Saber library. I put a lot of work into this one to ensure it was compatible with the Arduino IDE. Once you properly install the library, all you should have to do is include the library in the usual way from the IDE.

I verified the library works with IDE versions 1.0.5 and 1.6.5r5.

I provided an abstract base class so that motion detection can be interpreted in a more generic way regardless of what hardware is being used. I also added a simple motion manager example that will work with the tilt+clash sensor combo as was used in my Mk II system. (This is how the cheap toys do it.) The clash is interrupt-driven so you will NEVER miss a clash. Ever. There is a long clash de-bounce to prevent double-trigger. (If you are hitting the saber more than once every 100ms then you're The Flash and should be out fighting crime, not spending time here!)

Updates:
1. Added motion detection!
SimpleMotionManager : Detect motion with swing+clash sensor.

2. Added a new blade type
CrossGuardBlade : A simple two-channel cross-guard blade!

3. Added examples to the library. Examples can be accessed from the IDE in the usual way.
SaberBlades : Test/demo the blades
Motion : Test/demo motion manager

4. Added a copy of the full GPL license. It's free! Keep it free!

I hope you folks find it useful. Feedback welcome.

neskweek

#723
Mar 13, 2016, 03:27 pm Last Edit: Mar 13, 2016, 03:40 pm by neskweek
Man ... Great job you've done here (as always :D)!

Thank you !

JcBailey

#724
Mar 13, 2016, 03:52 pm Last Edit: Mar 13, 2016, 03:58 pm by JcBailey Reason: Photo too large.
Hello. I just wanted to say thank you for this thread.

My son got a toy light saber for Christmas and broke it the first day so I set out to do better.
I have never tackled a project like this before so I started researching and found this thread. What at first was going to be a simple lightsaber with a polycarbonate blade is now becoming a replica of Yoda's saber. I have most of the electrical components and am waiting for a few more things to arrive before I start bread boarding.

I have not done an electronic project since high school and have never programmed anything. This project is very exciting and I am grateful for the information provided here and I look forward to sharing my project.

This is a picture of the hilt so far.

JakeSoft

#725
Mar 13, 2016, 07:37 pm Last Edit: Mar 14, 2016, 01:07 am by JakeSoft
Hello. I just wanted to say thank you for this thread.

My son got a toy light saber for Christmas and broke it the first day so I set out to do better.
I have never tackled a project like this before so I started researching and found this thread. What at first was going to be a simple lightsaber with a polycarbonate blade is now becoming a replica of Yoda's saber. I have most of the electrical components and am waiting for a few more things to arrive before I start bread boarding.

I have not done an electronic project since high school and have never programmed anything. This project is very exciting and I am grateful for the information provided here and I look forward to sharing my project.

This is a picture of the hilt so far.
Welcome! I get a lot of messages and PMs on my YouTube channel and here on the forum from dads just like you. I'm always happy to hear when these videos and threads can help brighten a child's day, be it literal or the child within us all. Best of luck, I look forward to seeing your progress.

JakeSoft

Man ... Great job you've done here (as always :D)!

Thank you !
Thanks, and you're welcome! That's nice to hear from one of the few people who think about saber software as much as I do.  :)

T_R_O_N

#727
Mar 13, 2016, 08:32 pm Last Edit: Mar 13, 2016, 08:38 pm by T_R_O_N
I've finally finished reading the whole thread, great work everyone!!

Most of my parts have arrived a few weeks ago, and the last of what I need should arrive this week, then I'll be able to join in on the fun!

There was a post a while ago asking for photos of completed sabres, here I've attached some of mine. I built it last year November for a bit of cosplay at the Starwars Premiere, I also built one for my sister, they are just basic stunt sabres with aluminium tubing hilts.

My next step will be to put the arduino sound system into the hilt.

Protonerd

Here is another drop of the Universal Saber library. I put a lot of work into this one to ensure it was compatible with the Arduino IDE. Once you properly install the library, all you should have to do is include the library in the usual way from the IDE.



I hope you folks find it useful. Feedback welcome.
Hugs from me as well!

Now confronted with LSOS and Usaber I kinda know what I'm going to do after DIYino verification: I'm embarking on a serious study of the secrets of C-coding, using your code as learning vehicle! To be very honest: looking at both of your codes with neskweek, I really do not know how I pulled it off to make my saber at the first place with my meager coding experience.

But hey, I do like learning!

JakeSoft

#729
Mar 14, 2016, 01:32 am Last Edit: Mar 14, 2016, 01:33 am by JakeSoft
Hugs from me as well!

Now confronted with LSOS and Usaber I kinda know what I'm going to do after DIYino verification: I'm embarking on a serious study of the secrets of C-coding, using your code as learning vehicle! To be very honest: looking at both of your codes with neskweek, I really do not know how I pulled it off to make my saber at the first place with my meager coding experience.

But hey, I do like learning!
Technically, it's C++. But you'll learn. hehe :)

Soulbp

I finally finished reading the whole thread, plus most of the led string thread. I believe I'm going to get some of this hardware and throw my hat the ring. I've been away from programing for a few years but I'm a former game deisgner\programer. I've noticed a lot of use of delays in sample code. There are a variety of ways to accomplish the same things without locking up the logic. Can you get timestamps from the CPU clock? You can check time passage or using incremental counters all balanced with if statements. Just some thoughts.

neskweek

#731
Mar 14, 2016, 08:56 am Last Edit: Mar 14, 2016, 09:33 pm by neskweek
@Soulbp
Welcome ! It's always nice to see newcomers !

Concerning delays, you're right. The least we use it the better it is. But others solutions (at least all I thought off and try) consume more hex file size. Since we only have 32K ...

I personnaly did remove all delays from "action Mode", but kept the others, since in other mode it's less important.


For Kylo Ren blade lovers, I thought it could be an interesting piece of hardware :
https://www.youtube.com/watch?v=RJ2xGFfrND0

JakeSoft

@Soulbp
Welcome ! It's always nice to see newcomers !

Concerning delays, you're right. The least we use it the better it is. But others solutions (at least all I thought off and try) consume more hex file size. Since we only have 32K ...

I personnaly did remove all delays from "action Mode", but kept the others, since in other mode it's less important.

I agree with neskweek's approach. For time-critical portions of code that are expected to be called with great frequency, time "bookmarking" is  better than delays because it keeps the logic spinning. Anything run while in "action mode" is a good example. When the saber is on, you want quick response from motion sensing and so on, so don't lock up your processor on a delay. But, for less critical code then it makes sense to just keep it as simple as possible and use a delay thereby keeping the hex file size in check. For super-time-critical code, you *should* use delays, such as serial comms. You can't have any variance or your comms won't work. Balance is key to avoid a delay witch-hunt with no benefit.

Soulbp

Hmm... 32k so hmm oop can be an advantage her or disadvantage.. Classes can be used to help reduce redundancy but then you have higher memory usages poetentialy. Seems like a timeelapsed function could be used to replace some delays and keep code redundancy down. Does either the axis unit you use Jake or the unit Nesskweek uses does either one have a method for determining the size of the vectors used? That can be extremely handy in uses velocity based code. I suppose i will contribute to the thread less until I actually have stuff in front of me fo see.

Akavari

Hi guys, just sorry for my English, I really do not speak, and talk through Google perevodchik.Reshil collect nephew lightsaber on the Arduino Nano 3, prompt pozhaluyska, a sketch to use that better garland of LEDs, or one high-power LED, which take sounds lightsaber, and how they add to the sketch for Arduino, thank you in advance)

Go Up