Close
0%
0%

Skywalker Lightsaber

Not as clumsy or random as a blaster. An elegant weapon from a more civilized age.

Similar projects worth following
Don't point this directly at your face when handling! Handle with caution and care.

  • 1 × Arduino Pro Mini
  • 1 × MPU6050 module
  • 1 × 3D printed Lightsaber
  • 1 × 26650 LiFePO4 cell
  • 10 × APA106 / WS2812B LEDs

View all 7 components

  • Adafruit Trinket M0 - controlling the onboard dotstar LED via Arduino IDE

    davedarko01/04/2018 at 10:08 0 comments

    Since I couldn't find how to control it, here's my code how I did it. They probably focus on their python stuff more than on the Arduino IDE, which makes sense and all in all the Trinket still works with the Arduino IDE, so hurray :) You need to install the Adafruit_DotStar library, best done with the library installer. I had to change the datapin and clockpin, easy to find on the pinout site (https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino/pinouts. The other change I had to make was the configuration definition to BGR, RGB backwards. Now that I was able to do that, I found this https://forums.adafruit.com/viewtopic.php?f=25&t=124501&sid=21195cd2275abc7ba8a32912d47cff6f :D

    // Simple strand test for Adafruit Dot Star RGB LED strip.
    // This is a basic diagnostic tool, NOT a graphics demo...helps confirm
    // correct wiring and tests each pixel's ability to display red, green
    // and blue and to forward data down the line.  By limiting the number
    // and color of LEDs, it's reasonably safe to power a couple meters off
    // the Arduino's 5V pin.  DON'T try that with other code!
    
    #include <Adafruit_DotStar.h>
    // Because conditional #includes don't work w/Arduino sketches...
    #include <SPI.h>         // COMMENT OUT THIS LINE FOR GEMMA OR TRINKET
    //#include <avr/power.h> // ENABLE THIS LINE FOR GEMMA OR TRINKET
    
    #define NUMPIXELS 1 // Number of LEDs in strip
    
    // Here's how to control the LEDs from any two pins:
    #define DATAPIN   7
    #define CLOCKPIN   8
    
    Adafruit_DotStar strip = Adafruit_DotStar(
      NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BGR);
    
    // The last parameter is optional -- this is the color data order of the
    // DotStar strip, which has changed over time in different production runs.
    // Your code just uses R,G,B colors, the library then reassigns as needed.
    // Default is DOTSTAR_BRG, so change this if you have an earlier strip.
    
    // Hardware SPI is a little faster, but must be wired to specific pins
    // (Arduino Uno = pin 11 for data, 13 for clock, other boards are different).
    //Adafruit_DotStar strip = Adafruit_DotStar(NUMPIXELS, DOTSTAR_BRG);
    
    void setup() {
      strip.begin(); // Initialize pins for output
      strip.show();  // Turn all LEDs off ASAP
    }
    
    void loop() {
      strip.setPixelColor(0, 0xFF0000); // red
      strip.show();
      delay(1000);
    
      strip.setPixelColor(0, 0x00FF00); // green
      strip.show();
      delay(1000);
    
      strip.setPixelColor(0, 0x0000FF); // blue
      strip.show();
      delay(1000);
    }

  • more standards and modules

    davedarko01/03/2018 at 13:23 0 comments

    I was inspired by @deshipu to get an adafruit trinket M0 and redo the lightsaber with it, since the atsamd21 being used has a DAC on board and enough pins left to control some neopixels, check a button and grep stuff over I2C from the accelerometer. Just playing around with arduino and analog write I can say that it sounds so much better already. 

    There will be a connector involved for the neopixels and I want to make everything fit the acrylic pipe first, then redesign the 3D printed parts where needed. 

  • APA106 vs. WS2812B

    davedarko01/28/2016 at 23:06 0 comments

    So it turns out that they are almost the same protocol... Red and Green are switched. But that is fixable :)

  • runs again!

    davedarko01/28/2016 at 22:41 0 comments

    I haven't checked the MPU6050 yet, but until I do I have to choose a color. Maybe I'll go with purple. Or rainbow.

  • 12V again ...

    davedarko01/17/2016 at 18:24 0 comments

  • killed by 12V

    davedarko01/16/2016 at 18:25 0 comments

    So I wanted to present my lightsaber and quickly plugged in the power supply but forgot to set the voltage first. Muahahah. Damn.

View all 6 project logs

Enjoy this project?

Share

Discussions

Stefan-Xp wrote 01/07/2016 at 20:34 point

Wow awesome project :) Just the right thing ;-)

Would you please do a longer video? 

The 3D Modell is also a really nice job! *Thumb up*

  Are you sure? yes | no

davedarko wrote 01/08/2016 at 12:07 point

Thanks Stefan! I'll do a video soon with the current state and thoughts on it. 

  Are you sure? yes | no

KennyAwesome wrote 01/07/2016 at 12:01 point

Did you already include my doppler effect code to your project?

  Are you sure? yes | no

davedarko wrote 01/07/2016 at 13:27 point

Not exactly. What I did, previous to seeing your project and am still doing, is to average the total acceleration data and use this as a manipulator for the frequency generated by the tone() library. I based everything around a 50Hz wave and modulate everything to a deviance of 19Hz max. As I understood, you're manipulating the 555 circuit with your arduino? I still don't get your hardware design. Would be cool if you could share this as well and maybe a demo in form of a video showing your doppler effect.

  Are you sure? yes | no

de∫hipu wrote 01/02/2016 at 14:40 point

How are you charging the LiFePO4?

  Are you sure? yes | no

davedarko wrote 01/02/2016 at 17:22 point

no clue yet. I have a USB power bank, that might have an LiFePO4 (+charger) inside, so I might take that. But the size looked just too awesome. 

  Are you sure? yes | no

davedarko wrote 01/03/2016 at 14:09 point

I've just checked the battery, seems like I've bought a "normal" LiPo by lucky accident :D I was mainly looking for the interesting form factor and didn't thought there were other batteries than LiFePO4 in that size.  http://www.ebay.de/itm/281885589684?_trksid=p2057872.m2749.l2649&ssPageName=STRK:MEBIDX:IT 

  Are you sure? yes | no

de∫hipu wrote 01/03/2016 at 14:21 point

Ah, that should be easy to charge :)

  Are you sure? yes | no

davedarko wrote 01/16/2016 at 18:21 point

I just found this project for charging LiFePO4 batteries https://hackaday.io/project/7312/gallery#5d137094c5bf3ddc7d37b9c016b0b91b

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

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