![parametric battery holder (9V default) / OpenSCAD custom container generator](https://3dcrawler.ams3.digitaloceanspaces.com/thingiverse/4630999-parametric-battery-holder-9V-default-OpenSCAD-custom-container-generator-2274296239.jpg)
parametric battery holder (9V default) / OpenSCAD custom container generator
Description
I wanted a custom 9V battery holder so I developed a parameterized container generator in OpenSCAD. The program is generic and is useful for other sized containers (such as to accommodate other types of batteries or for organizing beads, screws and nuts, SD cards, etc) with some simple parameter changes. I uploaded a bunch of battery holder .stl files of varying width and lengths generated from OpenSCAD code for convenience but it is also straight forward to do yourself. If you don't know about OpenSCAD, give it a try. It is a very powerful tool. Also, to help people that may be interested in modifying this code for other battery sizes, I quickly measured batteries I have. I have not checked these measurements against official specifications and there will be some variation so double-check yours also if you can. If you utilize these measurements, be sure to add in some tolerance (such as an additional 0.5mm). I also understand that some rechargeable type AA batteries may have a slightly larger diameter also. Type of battery / Diameter (mm) / Height of main cylinder not including positive terminal bump (mm) AAA / 10.25 / 43 AA / 14.1 / 48.25 C / 25.5 / 47 D / 33.1 / 58.25 CR2 / 15.3 / 25.8 The default OpenSCAD code is sized for 9V batteries (three AAA batteries will also fit into a 9V slot). A square slot will also accommodate cylinder shaped batteries when properly sized. I added an additional 0.5mm to the x and y slot length dimensions beyond my own physical battery measurement which has worked out great. For example, to convert the default (8) 9V battery holder into a (24) AAA battery holder, change the following lines of code from: num_slots_x = 4; num_slots_y = 2; slot_length_x = 17.7; slot_length_y = 26.7; to: num_slots_x = 6; num_slots_y = 4; slot_length_x = 10.75; slot_length_y = 10.75; Notice that I have added in 0.5mm from my own AAA battery diameter measurement listed above and it turned out perfect for AAA batteries. Below are some other battery dimensions with tolerance included that I printed and verified are suitable for my batteries. 9V slot dimensions: slot_length_x = 17.7; slot_length_y = 26.7; -- AAA slot dimensions: slot_length_x = 10.75; slot_length_y = 10.75; -- AA slot dimensions: slot_length_x = 14.6; slot_length_y = 14.6; -- C slot dimensions: slot_length_x = 26.1; slot_length_y = 26.1; -- D slot dimensions: slot_length_x = 33.6; slot_length_y = 33.6; -- Also, for just a simple parametric box without dividers (such as for a cover or tray), simply set num_slots_x and num_slots_y both equal to 1. A cover can also just be a second print of the same battery holder flipped upside down and placed on top of the batteries assuming there is enough batteries to support a cover. The dividers will line up and hold the batteries securely. The default divider thickness is 3 times my 0.4mm nozzle width (1.2mm). The thin walls are still acceptably stiff so I think this value saves time and filament. Thinner walls also makes the print slightly more compact. If wider dividers are desired, such as to make AAA batteries easier to grab, or for added stiffness for heavier items or larger containers, I advise setting the x_divider_width and y_divider_width to 1.6mm (4 times the typical 0.4mm nozzle width). I have updated the default divider widths as follows: divider_width_x = 1.2; divider_width_y = 1.2; -- I wanted to build a battery box inside an existing (slightly warped) container I had so I chose shapes that would allow as many batteries to fit into that rectangular space as I could fit. With a little more tuning it is possible to make a perfect rectangle which could possibly be printed all at once or super glued together. The OpenSCAD generator displays the outside box dimensions for reference so it would be relatively easy to tune all the dimensions to fit together perfectly before printing anything. I included the .stl files I used in the pictures of the assembly I came up with. I hope you benefit from this arrangement. The assembly holds: 24 AA batteries 25 AAA batteries 8 C batteries 6 D batteries (8+2) 9V batteries Also, it is interesting to note that using these slot dimensions there are other possibilities which add flexibility such as: (1) 9V can slide snuggly into a C slot (3) AAA can fit onto a 9V slot (1) AAA can fit loosely into a AA slot (5) AAA can fit into a C slot (1) C can loosely fit into a D slot (2) 9V can fit tightly into a D slot (recommend making the D slot slightly larger to fit better) I hope you enjoy your new battery container(s). Good luck and have fun! last updated: 10/25/2020
Statistics
Likes
15
Downloads
0