Unlike all the V1 TeensySaber electronics, the V3 board is not
something I recommend that most people build themselves. All the
instructions for doing so are available here,
but most people should just continue reading to find out how to use
the board.
What you will need:
Teensy 3.2 - the brains (It is also possible to use a Teensy 3.5 or 3.6, but I think the 3.2 is best because it's smaller.)
(optional) 1-3 x auxilary FETs - These can be placed on the bottom of the board to drive additional LEDs.
Putting it together
Important! Make sure you cut the lead between VIN and VUSB on the teensy before you solder it to the TeensySaber V2. Cutting it afterwards is not nearly as fun. (But possible with an exacto knife or similar.) Note that after you cut VIN/VUSB, you'll need to provide external powre to use or program the teensy. Once attached to to the TeensySaber, it will draw power from the battery to power the Teensy.
Once that's done you need to solder your TeensySaber to a Teensy. For a Teensy 3.2, here is where you place all the pins:
The easiest way to solder the teensy to the teensysaber board is to use header pins.
However, once joined in this way, it's quite difficult to get them apart again, which means
that if one of the boards develop a fault, you pretty much have to throw away both of them.
What I recommend doing is to use header pins only in two corners, then use some regular wire
for all the other connections, that way you can cut the wires and desolder everything fairly
easily should you need to. (Full disclosure: I have not tried this yet, but I have ruined
a few boards while trying to get the pins out...)
Anyways, put the teensy 3.2 on top and solder the pins/wires into place. (top and bottom)
Later, we'll cut or bend the pins to make sure they aren't in the way.
When you're done, it should look something like this:
Pinout
Note: Pins marked with * are ones that you probably want to hook up to something. The rest of the pins are usually ignored.
Battery+ - 2.6 to 4.5 volt input, drives everything except the LEDs
Battery- - negative pad for LEDs, needs to be at same level as GND when both are connected.
GND - ground for electronics except LEDs. Note that GND is also available on short edge of the teensy. (See the teensy pinout for details.)
Speaker +/- - hooks up to speaker
Power / AUX / AUX2 Button- Hook up to closing buttons, or potentially touch buttons.
Blade ID / neopixel data - Normally used to measure the blade ID restor, and if it's a neopixel blade, feed out neopixel data. For a fixed non-neopixel saber, it could be repurposed.
LED 1, 2, 3 - Hooks up to negative side of LED (positive side of LED hooks up directly to battery.) These pads can handle up to 30 volts.
LED 4, 5, 6 - Like LED1/2/3, but requires FETs to be placed on the bottom of the board to function. Voltage is limited by selection of FETs.
Power 1, Power 2, Power 3 - These control the FETs which drive LED 1, 2, 3.
AUX LED 1, 2, 3 - These are hooked up to pads on the bottom which can be populated with FETs and used to drive additional LEDs. If the bottom FETs are not populated, these pins are free and can be used for any purpose.
Free pins - these are not used for anyting and could be hooked up as additional inputs or outputs. Pins marked with "PWM" have hardware PWM support which can be used to control the brightness of LEDs or drive servos.
Data In, Data Out, SCK, SD card select - these pins are used to communicate with the SD card.
SDA, SCL, Motion Interrupt - these pins are used to communicate with the gyro and accelerometer chip.
Battery Volt Sense - used to read battery voltage.
Amplifier enable - Used to control the amplifier.
5v - generated by the TeensySaber board.
3.3v - generated by the Teensy
Wire gauges
Most pads on the teensy will not need to carry any significant amount
of power and can use 30 awg (very thin) wire if you choose.
However, Battery- will carry the combined power of all your LEDs, and LED 1,2,3 (and 4,5,6 on the bottom) will carry a fair amount of power as well. It is recommended to use thicker wires, for these wires. There is no absolute rules for what wire guages are required, but here is a helpful chart. (See the "chassis wiring" column.) Keeping the high-power wires short helps as well.
Configurator
Select your configuration below. Note that while this tool can show many different configurations for the
TeensySaber V3 board, there are many many more possible configurations.
// Fire speed, valid values are 1 - 10
#define FIRE1_SPEED 2
// How long to wait before firing up crossguards.
#define FIRE1_DELAY 800
// Each of these have three values: A, B, C
// A = non-random intensity
// B = random intensity
// C = cooling
// The first two control temperature, and as we add
// A + rnd(B) to the base of the blade each animation frame.
// The second controls how rapidly the fire cools down
// This is used during normal operation.
#define FIRE1_NORMAL 0, 1000, 2
// This is used when a clash occurs
#define FIRE1_CLASH 3000, 0, 0
// This is used during lockup.
#define FIRE1_LOCKUP 0, 5000, 10
// Helper
#define FIRE1PTR(NUM, DELAY) \
StyleFirePtr<RED, YELLOW, NUM, DELAY, FIRE1_SPEED, \
FIRE1_NORMAL, FIRE1_CLASH, FIRE1_LOCKUP>()
Preset presets[] = {
{ "fontdir", "tracks/mars.wav",
FIRE1PTR(0, 0),
FIRE1PTR(1, FIRE1_DELAY),
FIRE1PTR(2, FIRE1_DELAY),
},
{ "fontdir", "track..wav",
StyleNormalPtr<RED, WHITE, 200, 300>(),
StyleNormalPtr<RED, WHITE, 200, 300>(),
StyleNormalPtr<RED, WHITE, 200, 300>()
},
{ "fontdir", "track.wav",
StyleRainbowPtr<300, 800>(),
StyleRainbowPtr<300, 800>(),
StyleRainbowPtr<300, 800>()
},
{ "fontdir", "track.wav",
StyleNormalPtr<CYAN, WHITE, 300, 800>(),
StyleNormalPtr<CYAN, WHITE, 300, 800>(),
StyleNormalPtr<CYAN, WHITE, 300, 800>()
},
{ "fontdir", "track.wav",
StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(),
StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(),
StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >()
},
{ "fontdir", "track.wav",
StyleFirePtr<BLUE, CYAN, 0>(),
StyleFirePtr<BLUE, CYAN, 1>(),
StyleFirePtr<BLUE, CYAN, 2>()
},
{ "fontdir", "track.wav",
StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(),
StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(),
StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >()
},
{ "fontdir", "track.wav",
StyleNormalPtr<WHITE, RED, 300, 800, RED>(),
StyleNormalPtr<WHITE, RED, 300, 800, RED>(),
StyleNormalPtr<WHITE, RED, 300, 800, RED>()
},
{ "fontdir", "track.wav",
StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(),
StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(),
StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>()
},
{ "fontdir", "track.wav",
StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(),
StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(),
StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >()
},
{ "fontdir", "track.wav",
StyleNormalPtr<Gradient<RED, BLUE>, Gradient<CYAN, YELLOW>, 300, 800>(),
StyleNormalPtr<Gradient<RED, BLUE>, Gradient<CYAN, YELLOW>, 300, 800>(),
StyleNormalPtr<Gradient<RED, BLUE>, Gradient<CYAN, YELLOW>, 300, 800>()
},
{ "fontdir", "track.wav",
StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(),
StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(),
StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>()
},
{ "fontdir", "track.wav",
&style_pov,
StyleNormalPtr<BLACK, BLACK, 100,100>(),
StyleNormalPtr<BLACK, BLACK, 100,100>(),
},
{ "charging", "notrack.wav",
&style_charging,
StyleNormalPtr<BLACK, BLACK, 100,100>(),
StyleNormalPtr<BLACK, BLACK, 100,100>(),
},
};
// Hook up the main blade as normal.
// Hook up one of the crossguards like this:
// NEOPIXEL + <--> positive power (probably from charge port)
// NEOPIXEL - <--> LED4 pad on the bottom of the teensysaber
// NEOPIXEL data <--> Pin 7 on the teensy (through a 100ohm resistor)
// Hook up the other crossguards like this:
// NEOPIXEL + <--> positive power (probably from charge port)
// NEOPIXEL - <--> LED5 pad on the bottom of the teensysaber
// NEOPIXEL data <--> Pin 8 on the teensy (through a 100ohm resistor)
BladeConfig blades[] = {
{ 0, // blade ID resistor not used
// Main blade, 118 LEDs
WS2811BladePtr<118, WS2811_800kHz | WS2811_GRB>(),
// First crossguard, 26 LEDS, power on LED4, data on pin 7
WS2811BladePtr<26, WS2811_800kHz | WS2811_GRB, 7, PowerPINS<bladePowerPin4> >(),
// First crossguard, 26 LEDS, power on LED5, data on pin 8
WS2811BladePtr<26, WS2811_800kHz | WS2811_GRB, 8, PowerPINS<bladePowerPin5> >(),
CONFIGARRAY(presets)
},
};
Touch Buttons
Any of the buttons can replaced with a touch button.
To wire a touch button, simply hook up the corresponding wire to a metal surface. Note that in spite of the name, you don't
actually want anybody to actuall touch the touch buttons. The metal surface needs to be insulated, both from the
rest of the hilt, and from the fingers that will be "touching" it. In my case, I used a circuit-board clamp card in a Graflex
lightsaber, then I covered it up with tape to insulate it from everything else.
More details here.
Choosing Resistors
Calculating resistor values is fairly easy. Just look up how many amps the LED can handle and at what voltage it expects to achive that current. Then the resitor value we want is (BatteryVoltage - LedVoltage) / LedAmps. And the resistor needs to handle (BatteryVoltage - LedVoltage) * LedAmps watts. Example, if the LED wants 1A @ 3.2 volts, the resistor would be (3.7 - 3.2)/1 = 0.5 ohms, (3.7 - 3.2) * 1 = 0.5 watts.
Note that I use 3.7 volts for the battery in these calculations, while li-ion batteries tends to top out at 4.2 volts.
TeensySaber can compensate for this by using PWM to reduce the total amount of power and heat generated by the LED when
the voltage is higher than what it is rated for. This mode is efficient and seems to work well, but it is possible that it
will reduce the life of the LEDs. If you are not comfortable with this, you should use 4.1 or 4.2 volts in the calculations above.
AUX Leds and LED strings
The bottom of the TeensySaber board has room for three SOT-23 FETs, these are fairly easy to solder by hand, and can be used
to control three more sets of LEDs. This can either be used to control auxiliary LEDs, or to control segments of a segmented
LED string. Here is what I do to solder the FETs: Apply liquid flux to the pads, don't worry it it kind of goes everywhere. Put the FET in the correct place with tweezers or something. Apply a small amount of solder to the soldering iron tip. Use a non-conducting tool (or a sharpened chopstick) to hold the FET in place, then touch the soldering iron to one of the pins until the solder goes to the right place, which shouldn't take more than a few seconds. Repeat for the other legs.
Multi-battery setup
The FETs on the teensysaber can handle voltages up to 30v, so it's possible to do multi-cell setups. However, "Battery+" cannnot handle more than ~4.5 volts. So you would need a separate battery to power the teensy electronics. Another possibility would be to do two batteries in series, but only use one of them to power the teensy. Since the batteries would be discharged unevently, they would have to be charged separately. In the future, I hope to make "Battery+" handle a wider range of voltages, which would make multi-cell configurations a lot simpler.
Troubleshooting
If you're having problems, check out the troubleshooting page.
Problems? Questions? Suggestions? Check out The Crucible.
This page has been accessed 71,091 times since
August
31st,
2017.
Last modified:
March
29th,
2021
- Design by
Monica &
FredrikHübinette