element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
    About the element14 Community
    About Us
    • Watt's Up?
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Lightsabre Sound and Light fx.
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 19 replies
  • Subscribers 685 subscribers
  • Views 3316 views
  • Users 0 members are here
  • raspberry_pi
Related

Lightsabre Sound and Light fx.

CrazyFace
CrazyFace over 10 years ago

My 15 year old son, Who has Asperger's Syndrome(A form of Autism for those who have not heard of it before),  is a huge Star Wars fan and just after Christmas he asked if he did some work with his uncle during the school holidays and saved up his wages would he be allowed to buy a Lightsabre.

We initially thought he meant one of the Hasbro toy ones and asked him if he was a bit old for something like that, But we were so wrong!, he wants a full blown custom dueling sabre with sound and clash lighting effects.

So we looked at what was available and came across a few sites that sold complete sabres, custom sabres, or sold everything needed to create your own, but the prices are unbelievable. Don't get me wrong, they are probably worth every penny but for what my son wants his to do, he was looking at well over £250, and compared to what he could realistically afford to get, lets say his dreams of having the sabre he wanted were shattered and you could see the disappointment in his face.

I thought nothing more of it till about 2 weeks ago when out of the blue he came to me and asked if i could make one for him, which made me so proud that he believed I was capable of doing it and that he actually trusted and wanted me to do it, Unfortunately he had more belief in me than I did and told him I didn't think i would be able too, but seeing his hopes fade away again has really been getting to me since and I decided to see if I could do something about it.

 

My initial thoughts were get his ideas down on paper and go from there, So I got down what he wanted and started to look for things I could possibly use on ebay to make the hilt, after finding a few things he said he wanted in the design, I incorporated them into a rough drawing and got his approval and off he went happy, But I then realized that most of the stuff we had looked at for design ideas would not work together or couldn't be adapted to work how he wanted it and I felt like I was going to have to tell him I couldn't do it again.

But I was not going to be beaten yet, I've redrawn a new design that still incorporates the things he wanted and got his approval, I then designed a second sabre(For Myself of course image), but although I have the designs there are no dimensions due to not knowing how much space would be used by the electronics yet alone what I would be using for them, well there are plenty of kits out there that do everything he wants his sabre to do, but by the time I've added a power supply and charge circuit, amp, speakers and the lighting it could be in excess of £150, I've looked at some other sound fx boards like the Adafruit Audio FX Sound Board + 2x2W Amp - WAV/OGG Trigger -16MB but again after considering the cost of everything else needed the costs rise a fair bit.

Well after seeing fvan's Raspberry Pi Zero AirPlay Speaker, I began think about how I could use the Raspberry Pi Zero I got with the MagPi issue 40 and be able to store far more sound fx and use that as the brains, which as led me here today to see if any one has any suggestions or ideas how i can achieve my goal. so far my idea is to use the Pi Zero with the Pimoroni pHat Dac, add a small stereo amplifier and some small oval laptop speakers. I would need a battery powerful enough to be able to power everything for about an hour of actual physical dueling and also be able to recharge the battery without having to remove it, I need to include a accelerometer and impact sensor to control movement fx and clash effects, then there's the blade side of things, I want him to be able to chose what colour he wants his blade not be stuck with just one, but he would be happy with just a purple one. I cannot decide whether to piggy back around 90 super bright leds up the inside of a diffused blade, Or whether to use a RGB cree or similar at the base. Would I need a led driver?.

As you can see the idea is there and I would like to think it is achievable at a fraction of the cost of other established boards but I need some guidance or recommendations on whats probably the best way to go regarding the parts I use and making sure its safe for purpose.

Once the electronics side of things are ironed out I will be able to complete my designs with dimensions and try find someone with the equipment needed to make them for me. Its looking like majority of the parts will either be lathed or cnc'd with a few smaller parts 3D printed which I expect will take up most of what little budget I have.

I've given myself till his birthday in November to finish this project and as long as costs don't spiral too high and make buying a ready made one practical I'm hoping to be able to make him a pair at a fraction of the cost for the one he wanted originally.

Any help, ideas, guidance ect would be greatly appreciated and thanks for taking the time to read this.

  • Sign in to reply
  • Cancel
Parents
  • CrazyFace
    CrazyFace over 10 years ago

    Well after some deliberation I have decided to start experimenting with my Raspberry Pi Zer0 first and see how close I can get to what I want to achieve, If this doesn't work out how I hope I will revisit some of the other ideas or simply take the easy route and buy a soundfx board from Adafruit.

    I intend to use a Pimoroni Phat-DAC to output the sound effects but I haven't decided if I will use a mono or stereo amp yet, although I don't really think it will make much of a difference, other than a slight difference in my total spend at the end.

    For the blade I've ordered a 2m 5.0vdc RGB LED strip which will be connected to 3 TO220 Mosfets so I can control the colours with the RPi0 and hopefully have several pre-defined modes with matching sound effects but that all depends on how I get on with the programming side of things later in the project, I will also use 1 or 2 super bright white LED's close to the base of the blade that will illuminate upon impact to create the flash on clash effect.

    I'm hoping to use a Vibration sensor switch to trigger the flash on clash effect and the impact soundfx, and have found some cheap boards on ebay that look and sound perfect for this task, but I also have to consider a sensor to detect the Lightsabre being swung and initiate swooshing sounds, i Thought about using an Accelerometer for this but think that might be a waste as it only needs to trigger the effect not actually log the x,y,z points, which led me to consider another vibration sensor switch with softer spring, but with that I have to somehow differentiate between a swing of the blade or blades colliding and I don't see a way of not setting of the swoosh sound at the same time as the impact sound, unless there's a way to make the program override the swoosh when impact is sensed, guess I will have to investigate that further.

    The hardest part of this for me at the moment is powering everything that is needed, I have a 5.0vdc 2600mah PowerBank which will power the RPi0, what I'm wondering though is would I be able to use a buck booster connected to the 3.3v pin of the RPi0 to boost the power to 5v for the Leds and other bits or would i be best looking at an alternative.

    If anyone has any suggestions as to which mosfets, vibration and movement sensors would be suitable or what the best way for me to power it all is any guidance will be greatly appreciated and help me greatly, because at the moment I'm just guessing really and hoping I'm heading the right way with it.

    Thanks,

    Mark.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • CrazyFace
    CrazyFace over 10 years ago

    Well after some deliberation I have decided to start experimenting with my Raspberry Pi Zer0 first and see how close I can get to what I want to achieve, If this doesn't work out how I hope I will revisit some of the other ideas or simply take the easy route and buy a soundfx board from Adafruit.

    I intend to use a Pimoroni Phat-DAC to output the sound effects but I haven't decided if I will use a mono or stereo amp yet, although I don't really think it will make much of a difference, other than a slight difference in my total spend at the end.

    For the blade I've ordered a 2m 5.0vdc RGB LED strip which will be connected to 3 TO220 Mosfets so I can control the colours with the RPi0 and hopefully have several pre-defined modes with matching sound effects but that all depends on how I get on with the programming side of things later in the project, I will also use 1 or 2 super bright white LED's close to the base of the blade that will illuminate upon impact to create the flash on clash effect.

    I'm hoping to use a Vibration sensor switch to trigger the flash on clash effect and the impact soundfx, and have found some cheap boards on ebay that look and sound perfect for this task, but I also have to consider a sensor to detect the Lightsabre being swung and initiate swooshing sounds, i Thought about using an Accelerometer for this but think that might be a waste as it only needs to trigger the effect not actually log the x,y,z points, which led me to consider another vibration sensor switch with softer spring, but with that I have to somehow differentiate between a swing of the blade or blades colliding and I don't see a way of not setting of the swoosh sound at the same time as the impact sound, unless there's a way to make the program override the swoosh when impact is sensed, guess I will have to investigate that further.

    The hardest part of this for me at the moment is powering everything that is needed, I have a 5.0vdc 2600mah PowerBank which will power the RPi0, what I'm wondering though is would I be able to use a buck booster connected to the 3.3v pin of the RPi0 to boost the power to 5v for the Leds and other bits or would i be best looking at an alternative.

    If anyone has any suggestions as to which mosfets, vibration and movement sensors would be suitable or what the best way for me to power it all is any guidance will be greatly appreciated and help me greatly, because at the moment I'm just guessing really and hoping I'm heading the right way with it.

    Thanks,

    Mark.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • shabaz
    shabaz over 10 years ago in reply to CrazyFace

    Hi Mark,

     

    Your PowerBank could power the RPI and the LEDs I think? Worth a try. The 3.3V pin won't have enough power, there is only a finite amount of current that can be drawn from it, the exact value would be a guess since there are no schematics for the 'pi.

    If you're open to eventually creating your own PCB (with say EAGLE or KiCAD) then you might want to consider this very interesting TPS27081A power load switchTPS27081A power load switch. I've not used it, but I plan to do so. It is small but still hand-solderable. It seems perfect for where you want to switch a couple of amps at 5V, and can be directly controlled from the 3.3V logic levels from the 'pi. And it is cheap. Without a PCB, you'd need some adapter board though for a prototype, like the one below. Ideally you need a 1mm or 2mm sized soldering iron tip although bigger tip is still usable, it really isn't a super-tiny SMD part. If you need help with this, let me know - noticed you're in the UK, I'm not so close to your town but could solder it up if needed to a board. But worth trying it yourself if you can, because this is not an overly small part so definitely achievable with most soldering irons.

    image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • mconners
    mconners over 10 years ago in reply to shabaz

    Hey, I have a bunch of those boards on my desk image

     

    Mike

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Cancel
  • mconners
    mconners over 10 years ago in reply to mconners

    And Shabaz is right, they're not that hard to solder up.

     

    Mike

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • shabaz
    shabaz over 10 years ago in reply to mconners

    They're great, aren't they! Love that you can get discretes, op-amps,  even logic gates in SOT-23.. image it is like the TO-92 replacement for the 21st century..

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • CrazyFace
    CrazyFace over 10 years ago in reply to shabaz

    Thanks for the quick response Shabaz, I will be trying the Pi and Led strip from the power bank as soon as they arrive, like you say its worth a try. I did forget to mention above that from the information I've found on the Phat-DAC it only uses 3 of the gpio pins but the amp would need a power supply. I feel quite comfortable with a soldering iron and I believe I have both a 1mm and 2mm tip on different Irons, So if I have to that would not phase me at all, and that chip is perfect, but I really do appreciate your offer and if things don't go so well I might yet take you up on it. I wouldn't know where to start trying to design my own circuits yet I've a lot to learn, I did try a few years ago in the hope of etching my own but that was as far as that went. So purchasing a few of the boards and power load switches might be a good idea.

    It looks like the vibration sensor board I was considering will need power too, I need at least an hour of play before charge.

    Could this be simplified by just using individual tilt and vibration sensor switches connected to thee gpio pins and trigger the effects or would I need to include anything else like resistors to protect the Pi?.

    Mark. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to CrazyFace

    image – I'd definitely go with an accelerometer instead of a vibration sensor, as it is very simple to generate an authentic and variable swoosh sound from g-meter data and at the same time detect and discern impacts, as these are a magnitude bigger than when the saber is swung. I'd accumulate the g-foces of all axes, to have acceleration of the saber as well as centripetal forces (more important) aboard. Then feed it to a static-noise generator to alter the wavelength – or play a clash sound, if g-forces are over a certain threshold. This sound effect compares somewhat to swing a tube faster or slower.

    Mike

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • shabaz
    shabaz over 10 years ago in reply to CrazyFace

    Hi Mark,

     

    I had a look at the phat-dac thing, but they've not included an amplifier which is a shame, it would have taken hardly any space or cost for them.

    The usual LM386 could be used, it is a fairly typical amp, and would have more than enough output for a speaker, and can run from 5V.

    Another audio amp option is here BBB - Building a DAC - part 2 there is a circuit for an audio amp there which uses the   which operates at 5V too But the  LM4861MLM4861M

    is only offered in an 8-pin SOIC package (again this is quite large so easy to solder on a PCB).

    Anyway whichever amp you use, the stereo from the DAC can be summed into a single input using a couple of resistors (e.g. use anything of a few kohm, like 4.7k resistors).

     

    Regarding the vibration sensor, you could have it a bit more advanced and use a combined accel/gyro module. Admittedly a bit over-the-top, but it gives you some flexibility when it comes to the

    sound effects. For example some foreboding effects when the sabre is gently picked up or moved, and different effects when swung.

    The DAC doesn't use the I2C pins, so you could connect some combined accel/gyro module which uses I2C as an example. I've used the MPU-9150, that's not a bad module - it would be a very advanced

    sabre with that : ). The IC is now end-of-sale but it is still available all over the place on ebay, pre-soldered onto a small stamp-sized PCB (space matters for your application!) so easy-to-use.

    image

    The gyro will give XYZ rotation values that will increase in magnitude depending on how rapidly the sabre is swung, and you also have the XYZ accel values which will tell you easily if the

    sabre is at rest (and in what orientation) or being held upright, etc, or moving.

    If you play with both sets of values I'm sure you'll figure out some nice sound effects to go with the action.

    To use the MPU-9150 boards, most of them accept a 5V supply (they have an on-board regulator down to 3,3V), so could be connected directly to the RPI 5V connection on the 40-way header

    (the MPU-9150 doesn't consume a lot of current). Then just wire the I2C SDA/SCL pins to the RPI, and also a couple of resistors (e.g. 4.7k) from those pins to the +3.3V pin on the RPI, to build your

    I2C bus.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Cancel
  • Problemchild
    Problemchild over 10 years ago in reply to shabaz

    How about using one of those little 2W class D boards off the net that seem to be about for like 99p. That way you have little to go wrong and enough power to make a reasonable noise!

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • CrazyFace
    CrazyFace over 10 years ago in reply to Problemchild

    Thanks for the pointers guy's I decided to go with a 2ch 3w digital power pam8403 class d audio amplifier board and the GY521 6 dof mpu-6050 3 axis accelerometer and gyroscope module for aduino but made the mistake of not checking whether the libraries for the acc/gyro were available for the RPi before ordering So I might need to re-evaluate this and follow your guidance and get the one you recommended above shabaz, if I cant get it to work. Only thing left to get now electronically speaking is the Phat-Dac and some resistors and i can start work on it.

    Thank you all for your invaluable input and I will be sure to keep you informed of my progress and probably have a few more questions to ask along the way.

    Mark.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • shabaz
    shabaz over 10 years ago in reply to CrazyFace

    Hi Mark,

     

    The pre-built audio amplifier board seems a good idea!

    You should be fine with the  MPU-6050MPU-6050 the MPU-9150 is a dual-die IC internally one die containing what is most likely an MPU-6050(or a close variant anyway and the other containing a magnetometer IC So the code is similar or identical

    I've not tried the MPU-9150 or 6050 with the RPI(I used a-9150 with a microcontroller but I'm sure we can troubleshoot and get it working if existing RPI code on the Internet for the  MPU-6050MPU-6050 doesn't work The MPU-xxxx doesn't need anything uncommon like I2C'repeated starts etc and is therefore easy to work with

    Do post a link to the 6050 or a detailed photo of it, just so it can be double-checked that it has an on-board regulator (otherwise it will need powering from 3.3V and not 5V) when you get a chance.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube