How to wire ILTMS lightsaber?

Status
Not open for further replies.

Elias

New member
Hey guys,

I am currently trying to remake the I Like To Make Stuff lightsaber seen here: https://www.youtube.com/watch?v=a0d-wT6YS4w

But I am a beginner to electronics and have been struggling to figure out how to make this all work.

This is the code ILTMS provides: https://www.github.com/iliketomakes...tsaber_v1/blob/master/ILTMS_lightsaber_v1.ino

And these are the components I have:
- 30 LED/m Dotstar LED strip
- Battery holder with 4 NiMH 1.2V batteries
- 2 buttons
- 8 ohm speaker
- Teensy 3.2 connected to prop shield (https://www.pjrc.com/store/prop_shield.html)

If anyone could please help me figure out how I should connect all of these together, I would be super grateful.

Thank you!
 
so there's a few things to figure out it seems - audio and LEDs. Also think about power.

LEDs
I don't have experience with dotstar leds, but sounds like they're very similar to neopixels. Looks like it's an I2C interface - and for the most part since they're pretty popular you won't have to worry about the protocol too much as others have done the work for you. Adafruit has a tutorial and library to walk you through the process of addressing these LEDs. Should be pretty simple once you get the library working.

Audio
That article you linked on the prop shield looks like a good place to start to get audio going. Walks through changes to make in the example code for you to get it up and running with teensy 3.2

Power
The 4 batteries at nominal voltage will be around 4.8v. This should be fine to wire into the Vin on the teensy right next to the usb port.

One thing I'm curious about is that the dotstar LEDs appear to require 5v, this might cause some headaches. Most 5v devices will register a logic 1/HIGH signal when the pin exceeds 2.5v, so you should be ok to wire the battery voltage to the 5v input and wire your teensy's digital 3.3v pins to the signal pins on the LEDs, but need some testing to make sure it's reliable.

Also as your batteries start to die the 5v LEDs will likely die well before your teensy, maybe not a big deal but worth considering.

Andy
 
Last edited:
For what it's worth, dotstar are technically SPI. You can run them on lower voltages but the blue and green start to loose intensity against the red. While 4 1.2V batteries directly to Vin can work a better solution would be to use a boost power supply (https://www.pololu.com/product/2562/specs) to give a consistent brightness. How worthwhile adding that to the build will depend on the result you want. The project that you finish is always better than the one awaiting perfection on the drawing board.

If you are starting out would suggest building this in pieces, and if possible getting spare parts. Once you solder the prop board to the teensy you are pretty much committed. Have my own saber project gathering dust after shorting the DAC output and therefore needing major surgery.
 
so there's a few things to figure out it seems - audio and LEDs. Also think about power.

LEDs
I don't have experience with dotstar leds, but sounds like they're very similar to neopixels. Looks like it's an I2C interface - and for the most part since they're pretty popular you won't have to worry about the protocol too much as others have done the work for you. Adafruit has a tutorial and library to walk you through the process of addressing these LEDs. Should be pretty simple once you get the library working.
As GremlinWrangler says these are like SPI devices. Unlike neopixel LEDs, they have 4 inputs (power, ground, data in, clock in) and 4 outputs (power, ground, data out, clock out). Unlike neopixels, because the clock signal is provided, the microprocessor doesn't need to provide data in a precise timing window for dotstars. Generally the same sort of LEDs are used in dotstarts.

Audio
That article you linked on the prop shield looks like a good place to start to get audio going. Walks through changes to make in the example code for you to get it up and running with teensy 3.2

Power
The 4 batteries at nominal voltage will be around 4.8v. This should be fine to wire into the Vin on the teensy right next to the usb port.

One thing I'm curious about is that the dotstar LEDs appear to require 5v, this might cause some headaches. Most 5v devices will register a logic 1/HIGH signal when the pin exceeds 2.5v, so you should be ok to wire the battery voltage to the 5v input and wire your teensy's digital 3.3v pins to the signal pins on the LEDs, but need some testing to make sure it's reliable.
This isn't an issue for this build. The Prop Shield provides 4 things for this build:
  • It provides a 3.3v -> 5v buffer for running LED strings like neopixels or dotstars, so you don't have to provide a separate boost circuit;
  • It amplifies the sound, so you don't need a separate amplifier;
  • It has some amount of flash memory to hold the saber sounds, so you don't need a micro-SD card; (and)
  • It provides a motion sensor.

In short, the prop shield was pretty much designed for something like a light saber.

Also as your batteries start to die the 5v LEDs will likely die well before your teensy, maybe not a big deal but worth considering.

Andy

To the OP, connect all of the pins of the prop shield. Or you need to connect at least the following pins (with the USB port facing up):
  • VIN (right side, top)
  • 3.3v
  • Pin 19/A5 (for i2c SCL, to read the sensor)
  • Pin 18/A4 (for i2c SDA, to read the sensor)
  • Pin 13 (for the flash memory and dotstar SCLK)
  • Ground (left side, top)
  • Pin 2 (for i2c interrupts)
  • Pin 5 (to enable the audio)
  • Pin 6 (to enable flash memory)
  • Pin 7 (to enable the 3.3v->5v buffer for the LEDs)
  • Pin 11 (MOSI for flash memory, Data for the LEDs)
  • Pin 12 (MISO for flash memory)
  • Pin A14 (back row of pins, next to pin 13 -- audio out)

Then the wires you need to connect to the saber bits from the code:
  • Back of the prop shield, connection to the LEDS, from left to right: VIN, Data, SCLK, Ground
  • Front of the prop shield, connect middle two pins to your speaker (left pin is +, right is -, but for some speakers, it doesn't matter)
  • Pin 0 needs to connect one end to the button for enabling color and the other end to ground
  • Pin 1 needs to connect one end to the button for power and the other end to ground

To get the sounds onto the flash memory, you probably need Teensy Transfer, by Fank Boesing (FrankB on this forum):
 
Status
Not open for further replies.
Back
Top