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!


  • 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

Picture of Materials and Components

I always buy electronic staff on Aliexpress, but you can find same modules on Amazon, eBay, etc.

Electronic components:

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

Picture of 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

Picture of Hilt

I use sewage pipes for hilt, but these are russians sewage pipes, so I think you need to improvise.

Step 4: Batteries

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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!

Step 12: Tuning

Picture of 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

Picture of 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.


viciousc (author)2018-01-08

Hello MadGyver, very impressive work, specially when you try to build it, you realize it is really complicated :)

I succeeded to get the parts, and found out my Nano is a clone, had issues installing the win driver, but know connection with board is ok.

When trying to upload skecth is giving the following error:

/tmp/446632482/GyverSaber/GyverSaber.ino: In function 'void setup()':

/tmp/446632482/GyverSaber/GyverSaber.ino:157:17: error: 'setAll' was not declared in this scope

setAll(0, 0, 0); // and turn it off


/tmp/446632482/GyverSaber/GyverSaber.ino:203:20: error: 'setColor' was not declared in this scope



/tmp/446632482/GyverSaber/GyverSaber.ino:204:35: error: 'voltage_measure' was not declared in this scope

byte capacity = voltage_measure(); // get battery level


/tmp/446632482/GyverSaber/GyverSaber.ino:212:33: error: 'setPixel' was not declared in this scope

setPixel(i, red, green, blue);


/tmp/446632482/GyverSaber/GyverSaber.ino: In function 'void loop()':

/tmp/446632482/GyverSaber/GyverSaber.ino:224:15: error: 'randomPULSE' was not declared in this scope



/tmp/446632482/GyverSaber/GyverSaber.ino:225:11: error: 'getFreq' was not declared in this scope



/tmp/446632482/GyverSaber/GyverSaber.ino:226:16: error: 'on_off_sound' was not declared in this scope



/tmp/446632482/GyverSaber/GyverSaber.ino:227:11: error: 'btnTick' was not declared in this scope



/tmp/446632482/GyverSaber/GyverSaber.ino:228:14: error: 'strikeTick' was not declared in this scope



/tmp/446632482/GyverSaber/GyverSaber.ino:229:13: error: 'swingTick' was not declared in this scope



/tmp/446632482/GyverSaber/GyverSaber.ino:230:15: error: 'batteryTick' was not declared in this scope



/tmp/446632482/GyverSaber/GyverSaber.ino: In function 'void btnTick()':

/tmp/446632482/GyverSaber/GyverSaber.ino:258:26: error: 'setColor' was not declared in this scope



/tmp/446632482/GyverSaber/GyverSaber.ino:259:32: error: 'setAll' was not declared in this scope

setAll(red, green, blue);


/tmp/446632482/GyverSaber/GyverSaber.ino: In function 'void on_off_sound()':

/tmp/446632482/GyverSaber/GyverSaber.ino:281:27: error: 'voltage_measure' was not declared in this scope

if (voltage_measure() > 10 || !BATTERY_SAFE) {


/tmp/446632482/GyverSaber/GyverSaber.ino:285:18: error: 'light_up' was not declared in this scope



/tmp/446632482/GyverSaber/GyverSaber.ino:310:18: error: 'light_down' was not declared in this scope



/tmp/446632482/GyverSaber/GyverSaber.ino: In function 'void randomPULSE()':

/tmp/446632482/GyverSaber/GyverSaber.ino:349:46: error: 'setAll' was not declared in this scope

setAll(redOffset, greenOffset, blueOffset);


/tmp/446632482/GyverSaber/GyverSaber.ino: In function 'void strikeTick()':

/tmp/446632482/GyverSaber/GyverSaber.ino:360:15: error: 'hit_flash' was not declared in this scope



/tmp/446632482/GyverSaber/GyverSaber.ino:373:15: error: 'hit_flash' was not declared in this scope



/tmp/446632482/GyverSaber/GyverSaber.ino: In function 'void batteryTick()':

/tmp/446632482/GyverSaber/GyverSaber.ino:522:25: error: 'voltage_measure' was not declared in this scope

if (voltage_measure() < 15) {


exit status 1


thanks a lot


anv3D (author)2018-01-08

Where'd you get the polycarbonate tube?

anv3D (author)2018-01-08

Hi, what's the OUTER diameter/radius of the middle part of your hilt, and what is the length of the hilt? and is 32mm the outer or inner diameter of the polycarbonate tube?

bobbydee (author)2017-12-27


I am trying to plan this out, but the component links are all going to the site in Russian. I am not able to accurately find the items on the English site.. any suggestions other than re-searching the components?

zuio (author)bobbydee2018-01-08

In the url, just change ru.aliexpress to en.aliexpress or whatever language you prefer.

JoseR440 (author)bobbydee2017-12-28

Add the product to the basket in Russian and close. Then open aliexpress in English and you have it in the basket

rexio1 (author)2018-01-04

how much did you spent to build the lightsaber...Im new on this but im planning to build my first lightsaber but using 144 led /m with ws2812 or a luxeon tri-rebel

minwooc91 (author)2018-01-01

Looks awesome, but what do you think about using 3xAA battery holders? (

anv3D (author)2017-12-31

Hi, what's the OUTER diameter/radius of the middle part of your hilt, and what is the length of the hilt?

PortalCube13 (author)2017-12-17

is it possible to do this with a raspberry pi?

PaulW234 (author)PortalCube132017-12-24

No, RPi cant control the LED's They need an accurate data feed with the cycle of the data which can only be accurate with a micro controller with a cycle clock.

Mad Gyver (author)PortalCube132017-12-17

but what for?

JoseR440 (author)2017-12-24

When verifying the program in IDE gives me the following message:

Arduino\libraries\FastLED-master/FastLED.h:17:21: note: #pragma message: FastLED version 3.001.005

# pragma message "FastLED version 3.001.005"


Someone else happens?

JoseR440 (author)2017-12-24

Amazing project, I have ordered the materials to do it

Another way to make the tube translucent according to this video:

TxemaI (author)2017-12-17

Could you please show how the components (batteries, board) are finally placed within the hilt? Sorry, I am a bit lost.

Mad Gyver made it! (author)TxemaI2017-12-17

Thanks =) I've attached some drawing for you

anv3D (author)Mad Gyver2017-12-23

Where does the MPU6050 and sd card holder go?

anv3D (author)anv3D2017-12-23

also, is therea slot or something where you remove the sd card?

TxemaI (author)Mad Gyver2017-12-18

Great, just what I needed! Thanks!

FlexoW (author)2017-12-22

hello, why you use 12V ws2812 Leds instead 5v ws2812b ?

Mad Gyver (author)FlexoW2017-12-23

Where do you get so powerful power source? 5V and about 3-2 Ams?

laith mohamed (author)2017-12-23

Go and fight jedi

TylerW135 (author)2017-12-23

I added all the stuff up including the stuff without links and it was about $100. give or take $20. Is this correct?

TylerW135 (author)2017-12-23

WOW I AM SO GOING TO MAKE THIS! about how much did this cost you total? I am only a teenager so i gotta save, and i am currently living in Indonesia so i will have to wait until I move back to America to build it, but it looks totally SICK!

uitae (author)2017-12-18

Resistors KIT

Please let me know in detail.

220 Ohm 51K 100K?

MarkL85 (author)uitae2017-12-21

i would like to know this too.... i see the 51k and the 100k in the photos, but there are a couple more that are definitely not 220 ohm... and they are not in the schematic.

NooBosjyaka5 (author)2017-12-20

Mmm.. i remember this "Твою мать!" at the end of video :D

NooBosjyaka5 (author)2017-12-20

Ну привет тебе, с России уже :)

anv3D (author)2017-12-18

Awesome! How much did this cost you total, and where can you get the polycarbonate tube? I can't find light diffusion ones on

Mad Gyver (author)anv3D2017-12-19

I think you can use clear tube, but make it diffusion. Use 1 layer of paper inside, or white spray paint

anv3D (author)Mad Gyver2017-12-20

Ok, ill try that. How much did this cost?

AleksB5 (author)2017-12-19

AAAmazing instructible, I voted for this and would be my next project as my son agreed that this will be an exciting one. Thanks for this Sir Alex MadGyver.

HollandM (author)2017-12-18

I cannot find any light diffusing (not clear) polycarbonate tubing anywhere in the United States. Any suggestions?

Tangski (author)HollandM2017-12-19

yes, check suppliers in China. :)

wcdsidinfo (author)HollandM2017-12-19

Lowes home improvement has clear tubes that are used to protect florescent light tubes - about $4 each. They are clear, but paper or paint will fix that!

Tangski (author)2017-12-19

This is TOTALLY BRILLIANT!! I can see people wanting this at Comicon and...and others who love to role play Star Wars...I know I would LOVE oneLOL I especially love it that you can hit with it and it has sound and light effects! This is not just a nice job, but makes a ton of kid dreams come true! This should be give it a go! LOVE IT!! Cheers buddy...wish I understood more on the electrial part, but maybe I can get someone to put that part of it together...the lights I get, build, batteries...very easy...not the computer part...sigh...NICE!!! I vote this a winner hands down!!

Mad Gyver (author)2017-12-19

Guys! If you can't find diffusion tube, use clear tube, but make it diffusion =) Use white paper or white spray paint.

ptrobrn (author)2017-12-17

How do the LEDs hold up to impacts?

Mad Gyver (author)ptrobrn2017-12-19

LEDs has some mobility, so they not take all impact at themselves

Dave n OliviaS (author)2017-12-18

This isn't the most complicated light saber I've seen, but the beauty is in the simplicity and customizability!!! The instructions and schematic are down right awesome!!! ANYONE from beginner to advanced will find this fun and have a great time building it!!! For all of these reasons this guy gets my vote!!! Keep up the quality work!!!

Mad Gyver (author)Dave n OliviaS2017-12-19

Thanks :3

TimothyM116 (author)2017-12-18

Great Project. I'll made one of this as soon as i can obtain all the items needed.

But my question is: is it possible to do this with only 2 batteries?

Mad Gyver (author)TimothyM1162017-12-18

Thanks! Unfortunately no, this LED strip needs 12 volts to operate, also at 9 volts it's light is very dim...

TimothyM116 (author)Mad Gyver2017-12-19

My fault, I didn't check the led strip. And what if I'll use a 5V addressable strip? At home I have a lot of led strips.. -_-'

jasonk148 (author)2017-12-17

if you don't mind me asking, where did you get your polycarbonate tube with end caps?

Mad Gyver (author)jasonk1482017-12-18

There is some shop in Moscow... PC tubes, caps ant a lot of other PC products

HollandM (author)Mad Gyver2017-12-18

I'm not in Moscow so has anybody found the light diffuser tubes elsewhere?

SamuelI19 (author)Mad Gyver2017-12-18

Will you sell it $

RobBest (author)2017-12-18

Very nice project. Well done!

anv3D (author)2017-12-18

I think I might make a Kylo Ren or Darth Maul version! If I do I'm going to 3D Print the handle. :)

About This Instructable




Bio: I like to create things, handmade weapon, arduino projects, science and some crazy staff! Also I like to capturing videos about my projects and I ... More »
More by Mad Gyver:Arduino Based Lightsaber With Light and Sound EffectsAutomatic Trash BinDIY Time Control Machine
Add instructable to: