Darth Vader's lightsaber

my kid wanted a lightsaber so I made him one...

Similar projects worth following
I made a Dart Vader's lightsaber which reacts to motion and changes light/sound.

The instructions below cover most of the build process but some experience is required and aren't really for complete beginners.

x-extension-fcstd - 2.93 MB - 10/27/2022 at 21:49


x-zip-compressed - 3.46 MB - 10/27/2022 at 21:49


x-wine-extension-pdf - 104.20 kB - 10/27/2022 at 21:48


View all 12 components

  • 1

    The goal is to make a replica of the Darth Vader's lightsaber which will produce sound and change blade color depending on the motion.

    Main sections:

    • MCU
    • sound output
    • light
    • sensor
    • light
    • case + hardware

    I will go through each of these in the following steps.

    The device should consume no power when not in use (except for the minimal consumption of the battery monitor) and should have only a pushbutton as a control.

    One of the goals is to use components I already have (luckily I have a lot of stuff around :)). That's why for the motion sensor I went with ITG3200 gyroscope as I had one on the breakout board laying around.

  • 2
    Sound output

    For sound output I needed a speaker and an amplifier. Since I didn't have any speakers with the right dimensions I found the smallest/cheapest bluetooth speaker in a local shop which turned out to be of a perfect size with a cost of slightly below 10€ (there are probably much cheaper things available on AliExpress but I wanted to get it without waiting). It's iDance keychain speaker. Unfortunately it doesn't have AUX input so some hacking is in order.

    The speaker is (hot) glued so some heat is needed to open it.

    The PCB contains MCU+BT and a small power amplifier. The amplifier (FT2820) is connected directly to battery but the enable pin is controlled from MCU. The datasheet contains a lot of details. So, a quick test proved that just connecting the power and pulling the amplifier's EN pin high is enough to get the sound output with the MCU being powered off. The EN pin is pin number 3 and sound + and - inputs are pins 8 and 9 (yellow line). The two traces to sound input pins need to be cut and the pin 3 needs to be connected to input power (purple line) - I don't have the closeup picture of the finished work so I just drew the lines.

    To properly get the sound signal into the amplifier it needs to be AC coupled so capacitors are needed in line with the input.

  • 3
    Power supply

    The goal is to have one pushbutton control the device. This creates a slight issue for the power-off animation+sound as it needs to run after the button has been released. So, we need a latching circuit which will detect when the button has been released and then run the poweroff animation+sound and then completely power off the device.

    For this we will use the P-channel MOSFET Q1 (pretty much any with apropriate gate threshold and current capability) as the main switch. The R1 keeps it open. Pressing the pushbutton will connect the gate to GND and cause the MOSFET to start conducting and power the rest of the circuit. If the pushbutton is released the MOSFET will stop conducting and cut the power. That's why we also have Q2 which can connect the MOSFET gate to GND if activated from the main MCU using the PWR pin. So the main MCU needs to set the PWR pin high to keep the current flowing (even when the button is released) until it does all of the poweroff stuff and then clear the PWR pin which will cut the power to the whole device.

    To be able to also sense the status of the pushbutton from the MCU (and since the MCU runs on 3.3V and the battery can go up to 4.2V), two Schottky diodes D1 and D2 are needed. The BTN pin needs to be pulled-up on the MCU side (using internal pull-up resistor). In this case those two diodes need to be Schottly type (with the forward voltage of around 0.15V) as the standard Si diodes will not work.

    For the MOSFET I used the IRF9332TRPBF (since I had it) and for Q2 I used BC548 but almost any other NPN bipolar transistor  with similar characteristics would work.

View all 7 instructions

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates