Preventing shorting the battery when blade is disconnected

I have a Proffieboard V2.2 mounted in a removable chassis that uses a pogo pin connector/PCB pair to connect internally to the rest of the hilt. The positive pins connect directly to the battery, and the negative pins are connected to the Proffieboard in the standard neopixel blade configuration.

Because the chassis is removable, I’m concerned with accidentally shorting the positive and negative power pins on the connector, particularly if the power button is pressed and the saber is activated while the chassis is removed. Is this a danger, and if so, is there some way to prevent the negative pins from being active when a blade is not connected?

It is definitely a possibility. If you have an extra pin, you could use blade detect to detect when nothing is connected and direct the NO_BLADE section to a preset that can’t be turned on. (Like StylePtr<Black>())

If you don’t have an extra pin, you might be able to use blade ID instead, but you would probably need to add a pull-down resistor to make the blade ID low when nothing is connected. Also, blade ID is only calculated on boot, so if you turn the saber on and then eject the chassis, then you still have a risk of shorts.

FInally; make sure to use protected batteries, as that will save you from most catastrophic issues if a short occurs.

1 Like

If you don’t have an extra pin, you might be able to use blade ID instead, but you would probably need to add a pull-down resistor to make the blade ID low when nothing is connected. Also, blade ID is only calculated on boot, so if you turn the saber on and then eject the chassis, then you still have a risk of shorts.

I had planned to use Blade ID to solve this problem, but I didn’t realize Blade ID wasn’t polling continuously, or at least regularly, when the saber was booted but not ignited. That leads to another issue: the entire point of ejecting the chassis is to access the removable battery. I wasn’t planning on using a kill switch or other method of rebooting the proffieboard once the battery is inserted. Is it even possible to change blades without cycling power on the ProffieBoard? Would using the Blade Detect pin solve that problem, or do I still need to cut the power every time I change blades?

Blade detect would certainly help, but there are other ways to do this.
One way is to make it so that blade ID is checked every time you switch presets.
Another would be to tie a button press of some sort to check blade ID.
It require’s a little bit of coding I think, but I can help.

I appreciate the offer, but it sounds like blade detect might be the most elegant solution here. I can alter my chassis to include it, I think. Does blade ID get triggered whenever the blade detect pin is connected/disconnected, without having to power cycle anything?

Yeah, when blade detect changes, blade ID is re-triggered.

What’s the best way to format the no_blade config? I see examples along the lines of:

{ NO_BLADE, WS281XBladePtr<0, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), CONFIGARRAY(noblade_presets) },

But could that middle part be omitted entirely? For instance, would this work?

{ NO_BLADE, , CONFIGARRAY(noblade_presets) },

No, it cannot be omitted.
Also, a WS281XBladePtr with zero pixels might cause problems, so I wouldn’t recommend that.

You could use something like SimpleBladePtr<NoLED, NoLED, NoLED, NoLED, -1, -1, -1, -1>() though.

1 Like

You could use something like SimpleBladePtr<NoLED, NoLED, NoLED, NoLED, -1, -1, -1, -1>() though.

Will that work if the other blades are neopixel blades? For instance, can I do this?

BladeConfig blades[] = {
 { 0, WS281XBladePtr<122, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), CONFIGARRAY(blade_presets) },
 { 56000, WS281XBladePtr<1, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), CONFIGARRAY(bladeplug_presets) },
 { NO_BLADE, SimpleBladePtr<NoLED, NoLED, NoLED, NoLED, -1, -1, -1, -1>(), CONFIGARRAY(noblade_presets) },
};

Yes, a simpleblade with no leds won’t do anything, but it will still count as one LED, so the styles won’t break or anything.

Wait! I can change the blade definition between cases? I can have a value for NPXL, another for a TriCree and a third for NoLED? The preset will just adjust by blade order?

Yes, that is the whole point of blade id after all. (At least if I understood your question correctly.)

1 Like