Astable Multivibrator: Battery Base for RGB LED

Collecting the battery dimensions into a table should make it easier to generate new holders for astable multivibrators:

//- Battery dimensions - rationalized from several samples
//  Coordinate origin at battery end with contacts, key openings downward

T_NAME = 0;
T_SIZE = 1;
T_KEYS = 3;

BatteryData = [
  ["NB-5L", [45.0,32.0,8.0],[[-0.82,4.5,3.5],[-0.82,11.0,3.5]],[[2.2,0.75,2.0],[2.2,2.8,2.0]]],

echo(str("Battery: ",BatteryName));

BatteryIndex = search([BatteryName],BatteryData,1,0)[0];
echo(str(" Index: ",BatteryIndex));

BatterySize = BatteryData[BatteryIndex][T_SIZE];          // X = length, Y = width, Z = thickness
echo(str(" Size: ",BatterySize));

Contacts = BatteryData[BatteryIndex][T_CONTACTS];         // relative to battery edge, front, and bottom
echo(str(" Contacts: ",Contacts));

ContactOC = Contacts[1].y - Contacts[0].y;                // + and - terminals for pogo pin contacts
ContactCenter = Contacts[0].y + ContactOC/2;

KeyBlocks = BatteryData[BatteryIndex][T_KEYS];            // recesses in battery face set X position
echo(str(" Keys: ",KeyBlocks));

A new boolean, RGBCircuit, adds a second pair of wire strut bases and punches holes in them:

Astable Multivibrator Battery Holder
Astable Multivibrator Battery Holder

Which looks about like you’d expect in real life:

 Astable - NP-BX1 RGB holder
Astable – NP-BX1 RGB holder

The lettering, of course, doesn’t come through clearly, but it suffices as a hint for which battery to use.

The four vertical struts will support three astable multivibrators, each driving one color of a common-anode RGB LED. It remains to be seen if there’s enough room for all the parts along the sides of the battery pack.

The OpenSCAD source code as a GitHub Gist: