Introduction: Arduino Based Lightsaber With Light and Sound Effects
Hello jedi! This instructable is about making a lightsaber, that looks, sounds and performs like one in the movie! The only difference - it can't cut metal :(
This device is based on Arduino platform, and I give it a lot of features and functions, it was a very big job and I used all of my programming skills, but it was worth it!
So, let's talk about features! Also you can watch a short review in my video, in which I show all effects and functions of GyverSaber system and also there are two professional jedi fighting with my lightsabers in the end of video!
Features:
- Smooth turning on/off with lightsaber-like sound effect
- Randomly pulsing color (you can turn it off)
- Sounds:
- MODE 1: generated hum. Frequency depends on angle velocity of blade
- MODE 2: hum sound from SD card
- Slow swing - long hum sound (randomly from 4 sounds)
- Fast swing - short hum sound (randomly from 5 sounds)
- Bright white flash when hitting
- Play one of 16 hit sounds, when hit:
- Weak hit - short sound
- Hard hit - long "bzzzghghhdh" sound
- After power on blade shows current battery level from 0 to 100 percent
Battery safe mode
- Battery is drain BEFORE TURNING ON: GyverSaber will not turn on, button LED will PULSE a couple of times
- Battery is drain AFTER TURNING ON: GyverSaber will be turned off automatically
Control button:
- HOLD - turn on / turn off GyverSaber
- TRIPLE CLICK - change color (red - green - blue - yellow - pink - ice blue)
- QUINARY CLICK - change sound mode (hum generation - hum playing)
- Selected color and sound mode stored in EEPROM (non-volatile memory)
Step 1: Materials and Components
I always buy electronic staff on Aliexpress, but you can find same modules on Amazon, eBay, etc.
Electronic components:
- Arduino NANO http://ali.pub/20o35g http://ali.pub/20o36t
- Addressable LED strip. WS2811, 12V. Take white PCB, IP30, 60 LEDs per meter http://ali.pub/23csyd http://ali.pub/23cszc http://ali.pub/23csyd
- Button with LED. Take 5V version http://ali.pub/23ct29
- MPU6050 http://ali.pub/23mryw http://ali.pub/23mst1
- Cheap MicroSD http://ali.pub/23msne http://ali.pub/23msqp
- MicroSD module mini http://ali.pub/23ms27 http://ali.pub/23ms5b
- Or this http://ali.pub/23ms11
- Batteries 18650 with protection http://ali.pub/23moiu http://ali.pub/23moke http://ali.pub/23moiu
- DCDC Step Down http://ali.pub/23mpex http://ali.pub/23mpfi http://ali.pub/23mpex
- Amplifier http://ali.pub/23mp6d http://ali.pub/23mp75 http://ali.pub/23mp6d
- Speaker http://ali.pub/23mq8h http://ali.pub/23mq9g http://ali.pub/23mq8h
- Resistors KIT http://ali.pub/23mqei http://ali.pub/23mqfo
- Power button http://ali.pub/23mtiw
- Charging port http://ali.pub/23mtf0 http://ali.pub/23mt69
- CC CV charger for 3 cells http://ali.pub/23mt8s http://ali.pub/23mt9d http://ali.pub/23mt8s
- Prototype board http://ali.pub/23mrwy
Materials and instruments:
- Polycarbonate tube (light diffusion, 32mm)
- 2 stubs for this tube
- Some tubes for hilt (I used PVC sewage pipe and tubings: 40mm for hilt, 32mm for PC tube mount)
- Steel wire
- Common instruments for soldering and cutting plastic
Step 2: Wiring
I decided to make this project on prototybe board, 3x7cm, you can see all schematics and some ugly-looking-wiring =)
IMPORTANT! Before wiring, connect DCDC step down converter to 12V DC power source and adjust output voltage to 4.5V!
Step 3: Hilt
I use sewage pipes for hilt, but these are russians sewage pipes, so I think you need to improvise.
Step 4: Batteries
I use 3 lithium batteries (ordinary 18650 from laptop battery). At first we need to put them inside 40mm tube (hilt), and we need to heat the tube for it. But at first we need fix batteries together by tape and thicken them with 2 layers of paper.
So heat the tube, put batteries inside and cool down the tube as fast as you can! Lithium batteries very don't like high temperature. Then pull them off and you will see perfect battery case.
Step 5: Soldering Batteries
As I said, lithium batteries don't like high temperature. So use flux and powerful soldering iron (100W) to solder batteries very quickly. So, connect them in serial.
Step 6: Blade and LED Strip
I have 75cm blade, so I cut 75+75=150cm piece of strip. LED strip will be folded twice around wire, so use double-side tape to fix all, and you will get double side LED strip with wire inside.
Strip needs some supports along the blade tube, I used 3 supports made of nail in thermal shrink tubes, and attach them to strip with thread and super glue.
Drill a holes in stubs for wire, wire will be strained between two stubs and fixed by 3mm screw, but not right now.
Step 7: MPU6050
I connected MPU6050 using old IDE flex wire, because it is good idea to place MPU as close to blade as possible. And I just glue it in low stub of PC tube :)
Step 8: Hilt Buttons
Make some holes for buttons and charging port, and a few holes in bottom for speaker. Also I painted hilt with black paint.
Step 9: Final Wiring
So, connect batteries, pull off wires for switch and charge, solder it all and fix in their holes. Also, solder speaker wires too.
Step 10: Speaker Fixing
I fixed speaker using a ring of 40mm tube and some nails =) It is brutal and very strongly.
Step 11: Programming
You can find Arduino sketch, libraries, SD sound files and a lot of instructions in project page on GitHub, but I attached sketch and archive with all project files here, in Instructables.
Simple guide:
- Open GyverSaber.ino and tune:
- Number of microcircuits WS2811 on LED strip (note: one WS2811 controls 3 LEDs!)
- Turn on or turn off blade pulsation
- Hardly recommend measure real resistance of voltage divider resistors
- System can work without battery monitoring, just deactivate BATTERY_SAFE. BUT IT IS NOT RECOMMENDED
- Flash arduino
- Upload audio files to SD card
- Enjoy!
MicroSD info:
- Size < 4G
- Format to FAT
- Copy audiofiles in the root
If you want add your own sounds, convert them to .WAV:
- 8 bit
- 16-32 kHz
- Mono
- Use online converters or Total Audio Converter
WARNING! If you are flashing assembled scheme, you must power up it! Arduino will not work correct with connected DCDC converter!
Attachments
Step 12: Tuning
I made GyverSaber fully customiseable so you can build your own saber with different blade length and other parameters, just take a look on sketch settings.
Step 13: Final Screw
So, lightsaber is almost done! Just one last screw, which fix blade to tube. I made some drawing with all saber body construction.
Step 14: Results
So, DIY lightsaber is ready to fight! You can watch some tests with spins, swings, object hits, chandelier crash (oops!) and also two real Jedi, fighting with GyverSabers (yes, I made 2 of them!!!) in my video review on this DIY lightsaber and it's functions and features.
Sincerely, MadGyver.

Runner Up in the
Arduino Contest 2017
265 Comments
5 years ago
This is amazing. Great job. Where do you find the polycarbonate tube? How thick is the tube wall? In the U.S. there are tubes to cover fluorescent bulbs, which is what yours looks like, but they are all clear. Thanks.
Reply 5 years ago
Thickness is about 1.2mm. We have both clear and light diffusion tubes
Reply 10 months ago
@Mad Gyver Where did u get them cause in germany i cant find any
1 year ago
I have a Board designed for my Projekt. :D
Reply 1 year ago
Hi! Any chance you could somehow share this? I want to get a custom PCB too.
Reply 1 year ago
Wow thats awesome!
I have 0 idea about board design, can you recommend me any platform to do/learn to do something like that? It seems very useful!
Reply 1 year ago
Easyeda is easy build
Reply 1 year ago
Yes! (I had no idea it was that easy to purchase custom pcb, but after some research I think I got it! Will test it as soon as all the components arrive!) Thanks for your post, it really inspired me!
Reply 1 year ago
Awesome work
1 year ago
Is it also possibilie to make gradients ? Like 3 colors at the same time or so
Question 4 years ago
I connected everything but have a lot of noise, the sound effects are soft in comparison. Soundmode 1 is trembling the speaker like made, it's unbearable. in Soundmode 2 there is a lot of noise. Also the MPU6050 is only working when I connected everything to USB and after flashing. if I reset the arduino with USB connected the MPU6050 is working again, but if I do the same without USB the MPU6050 stops working, even though it's getting power. I allready have changed everything without results, are there any sugestions?
Answer 4 years ago
I faced the same noise issue.At first i had think that this is a electrical noise.But one thing caught my attention.At idle "HUM" sound generated and this works through "toneAC.h" library.Than when another sound effect(*.wav files) plays, this noise has been stoped for a while.I had delete "HUM.wav" for finding the source of noise.Than suddenly noise dissappeared!!!This is our problem my friend.
This is the final state;
https://www.youtube.com/watch?v=-ultjaXpqiY&feature=youtu.be
Reply 1 year ago
Can you show me how to fix this error, I deleted "HUM.WAV" from SD but it still a lot of noise
Reply 1 year ago
I’m like really late but I saw yours and it looked awesome I was just wondering what exact leds you got because those looked really nice and the ones I currently have aren’t programmable
Reply 4 years ago
I am having the same issue. I bought enough supplies to build 4 of these but so far have not been able to get it to make any sound other than what seems to be overloading the speaker. I have built two just in case I had done something wrong the first time. Both are having the same issue: the lights work, flicker and change on command, but it seems that they both don't have motion sensitivity at all because the sound is terrible and I am still not sure if it is the mpu6050, the sd reader, the sd card, the amplifier, or the programming. it does not respond to movement, just has an extremely laud machine gun sound coming out of the speaker, and the speaker gets really hot. I would really REALLY appreciate any help to get the sound to work.
Reply 3 years ago
I got the exactly problem.....The crazy clicking drive me mad....did you slove the problem??? i tried to add low pass filter no luck. I even tried to connect the L and T to the audio output from my mobile. and there is no clicking sound. I believe the problem is on the digital pin from Arduino nano. but i have no idea to solve this...
Reply 1 year ago
I have the same problem. Maybe a capacitor between the Arduino and amplifier might help...
Reply 3 years ago
change pin on A1 to ground and will be fine as i did MPU6050 starts working
Reply 1 year ago
Thanks a lot! It definitely works with this change of pins!
Answer 4 years ago
I have same Problem. My Sound is very noise. Change Amplifier, sd card and Reader without change of problem.