MakerBot Print is our newest print-prepration software, which supports native CAD files and STL assemblies,
allows you to interact with all your printers via the Cloud, and many other exciting new features.

Download Now


Flexing battery holders with integrated spring

by enif Sep 9, 2014
Download All Files

Please Login to Comment

This is absolutely ingenious! I think it would be even better if you could thin the walls between the compartments from the current 3.5 mm down to 1 mm, like I did in my remix (https://www.thingiverse.com/thing:3724874) because I was tight with the space. It saves 7.5 mm in width for a 4 batteries pack!

You might also want to add 2 cable management holes per compartment at the anodes side, the same as you did for cathodes.

Thanks again for this great design!

4xAAA Battery Holder with Integrated Spring (narrow version)

I am new to 3d printing, could you please add 6 x AA. i don't know how to do it i tried to modify the scad and it says UI-WARNING: No top level geometry to render. if you can do it for me i will appreciate thanks

Ok, done!

Absolutely stellar design. Where can I send a paypal donation? Seriously.

Does anyone have an STL for a CR2 single lithium cell version of this design (like a CR123 but smaller) ?

Since you have the OpenScad source, you can easily create a module for any new size, e.g.:

module flexbatterCR2(n=1){

and add a line like

flexbatterCR2(n=3); // n is the number of cells in the package

at the end (and commenting out any other module call that still might be active).

I've now generated and uploaded an STL "flexbatter1xCR2" with the above parameters. Of course, not having a CR2 cell here, I could not test it, nor did I print it...

Thank you sir, many thanks for taking the time to help me out. I will test print one tomorrow and confirm it fits.
I use Sketchup Make myself, I did load up OpenScad a while ago and tried to learn it, but it's too alien for me to cope with I afraid without an instructor :)

Found an issue I could not fix (due to STL import errors in SketchUp). On the negative contact end, the end face has a rectangular section missing behind the contact face (that is different to you other STL's).

Strange, I don't know Sktechup, but reading after reading your comment I sliced the STL with Slic3r 1.2.9 and it does not show any anomality. You might want to try with a smaller extrusion width, or passing the STL through one of the many on-line STL repair tools, may be that helps...

OK this is a bit odd. Here's an image from Sketchup 17 with both the CR123 and CR2 imported (CR123 on the right). Slic3r 1.3.0 also looks the same (my goto slicer) and I extrude at 0.4mm. Maybe the hole is intentional ? but leaves little material behind the 'bump' if so.

On a side-note, how did you import those so cleanly? When I import a STL into sketchup, the objects are insanely busy with geometry. When I try to clean them up, they never have truly flat sides.

The trick for me was too tick the two clean up options available during importing in Sketchup (the Options button left of the Import button in that window), Merge Coplanar and Repair non solids...

Looking at your screenshot, I am not really sure what you mean by "insanely busy with geometry". What I can see is that you are displaying the surface edges of the triangulated object. On OpenScad and gmsh I turn these usually off, so that I only display the surface faces. That way the image shows a more realistic and "less noisy" view of the object. Is that what you mean? In this case, there are probably similar display options in sketchup...

Okay, now I see what you mean! :))) No, sorry, this "hole" is actually intentional. The "problem" is that when I tested and uploaded the CR2 STL, I used for this not the original OpenScad source file from thingiverse, but my current file here, which already incorporates some new featues and improvements. The missing rectangle at the positive(!) side is there to better allow hiding and covering the outside of the contact wires (which I normally cover up with a bit of ABS "slush" of the same color to electrically isolate it).

Sorry for the confusion! :)))

excellent job!
Could you please provide also the holder for the single little 14250 (1/2AA) that I see in your picture but not available in the zip file?

The short one in the picture i not a 14250, but a CR123A(i.e.16340). But for the 14250, you can simply modify the SCAD source by
adding a module liken (taken from module flexbatterAA() but with half the length):

module flexbatter14250(n=1){

and adding the line


at the end (and commenting out any other module call that might be active)

I have quickly done the above modification and uploaded the file flexbatter14250x1.stl. If the length does not fit exactly, you might need to modify the length (l=...) accordingly and regenerate the STL.

These holders are durable, look nice, fit the batteries tight enough, and the batteries can be removed without prying tools. And they are like 5 times cheaper than shop holders and can be incorporated into other parts of the device. I'll probably be using them frequently. Also, they work well with flat-top li-ion cells that some other holders don't make good contact with.

1x 18650 done, very fine design, the battery fits perfect,
Thank You!

Thanks for your kind words, and thanks for posting your "make"! :)

do you have the distance of the mounting holes?

The distance of the mounting holes depends on the cell length l, the cell diameter d and the screw hole diameter shd, so it depends on the cell size, as programmed on line 152ff in the OpenScad file flexbatter.scad:

// conical screw holes in corners

So the screw distances are (l-3shd-7) in X and (d-2sdh) in Y. To get the values of l,d and shd check the OpenScad file for the module flexbatterXXX() where XXX is the cell type, e.g. for AA cells you'll see:

module flexbatterAA(n=1){

so l=51.6, d=14.4 and shd=2.5, which means the mounting holes are spaced 37.1mm x 9.4mm.

Just a beautiful thing. Nice Design

Thank you very much for scad file. I was needing 6 pcs AAA and AA.

Hey, I printed the 4 18650 holder and I struggle to take the 18650s out. Is there any way that is easy? Please answer fats. Thank You, very nice design. I have printed in PLA.

I usually push the cell from the + side towards the spring and then lift it.

But if you have a look at the new version of this project ( https://www.thingiverse.com/thing:941081 ), you'll see that I have added there a center grip cavity, exactly to make the removal of the cells easier.

Flexing battery holders with 2- and 3-cell compartments
by enif

Brilliant! Thank you very much!

Dude, this thing is freakin' awesome. Don't know how many times I've need a battery holder for a project at 1 A.M. and naturally nothing is open. Nice design with well thought out features. Just printed an 18650 and it works prefectly.
Thanks from sharing this!

Any video on how to wrap the wires around the terminal bar? been trying to do ir with tweezers but i can only get 1 sometimes only 2 wraps...

No, sorry, I don't have any video. The important point is to strip at least 5cm more wire than what is actually needed for wrapping, so you will have enough wire to handle it. Also, if I use stranded wire, I tin the first 1-2cm so that it gets stiff and I can use it like a needle. For very small cells (e.g. AAA) I put a toothpick between the spring halves so to have a larger gap to insert the wire while wrapping.

Great design, Wanted to say that PETG is an excellent material for this. It's flexible but durable and very easy to print. I printed a 5-cell version, works great.

Thanks for letting us know that! :)

Would be nice to make this Modular, side by side


love the design very much - just printing out a battery holder for a single18650.
I have realized that the meshes dont seem to be watertight/manifold and wonder if nobody has run into troubles yet ? Have attached a screenshot of meshlab.

The STL were generated with OpenScad under Ubuntu and they always worked for me. But I remember other users (see way below in the comments) have made similar observations. I hope that you are able to print the holders anyway :)

I was able to print the holders and I really love the design :)

I played around a bit with the openscad file and managed to entirely get rid of the non manifold edges in the sline module (module sline(angle,radius,i,w,h)) by adding a tiny overlap to the single arcs and cubes that get joined together, as the original author (Heinz Spiess?) already did in two instances. So now the edges merge together nicely.

This is the difference in the code in the sline module:

-    if(a)arc(r-w/2,r+w/2,0,a,h=h);
-    else if(r>0)translate([-w/2,-r,0])cube([w,r,h]);
+   if(a)arc(r-w/2,r+w/2,0,a+0.1,h=h);       // tiny overlap! 
+   else if(r>0)translate([-w/2,-r,0])cube([w,r+0.01,h]);  // tiny overlap!

I have attached a file that shows the problematic places in a lila color.
There are still some places in the code that produce some manifold edges but this was the place that I could not fix with meshlab alone.

Hi Quirxi!

Thanks for looking into this so carefully - I don't think that any other user ever looked at my source code in such depth :)

It is true that overlaps are often needed to make the objects "waterproof". So I will investigate this using your suggestion for my current version of snakeline.scad and try to "clean" it. (Since this flexbatter project I used my snakeline approach for many other projects, and it evolved quite a bit in the mean time.)

Thanks again!

could you make a cr123a with 3 batteries in series? thats would be awwwwwesome!

It's rather easy to modify the SCAD file yourself, just add a line
at the end of the file (and comment out any other uncommented lines in the last section, if any). But I have quickly generated and uploaded STL files of 2- and 3-cells versions of the CR123A holders.

Since you mention that you need them in series, you might also look at the new version of this project
(https://www.thingiverse.com/thing:941081) which supports multiple cell compartments, this way you have several cells in row (=serial) without the need of wiring one cell to the next. I have added 1-, 2- and 3-cell versions of CR123A there, too.

Flexing battery holders with 2- and 3-cell compartments
by enif

Very nice design ! Can I remix the .scad and make it customization creation ?

As long as you comply with the license terms, of course you can do that.

Very nice. Thank you.

Just printed the 2x18650 so far, but it's very nice. The fit and feel turned out great, and I appreciate all the cable routing and screw mounting holes.

Awesome project! Can you post one for A28PX type batteries please?

If you know the diameter and length of that type of cell, you can easily include it into the provided SCAD source file.

Whoa, this is cool! I don't see documentation for some of the parameters to the flexbatter module, like hf, shd, xchan, and eps. Should I just not specify them and assume sensible defaults?

You could use the new version of this project (https://www.thingiverse.com/thing:941081) which is linked to at the end of the summary description. That new version is an extension that does everything this version does, but also allows more than one cell per compartment. And there, the parameters the parameters you mention are indeed documented:

hf=0.75, // relative hight of cell (1=full diameter)
shd=3, // screw hole diameter
xchan=[1/4,3/4], // relative position of traversal wire channel
seps=0.28, // extra diameter space

Flexing battery holders with 2- and 3-cell compartments
by enif

Hi. Can you tell me what parameters did you use to print this model ? ABS or PLA ? What temperatures and infill ? I'm trying with ABS, but all attempts are fails - bottom corners are go up from hotbed...

As written in my description, I use ABS. The extrusion temperature is 230 Celsius and the hotbed is at 120 Celcius. Infill is usually something like 35%, but it's not critical. But all of this is not specific for this design, that's what I use for all my prints.

Probably the most important thing to avoid warping (corners bending away from the bed) is to use a good hotbed at the right temperature. I used to print on a clean mirror polished with lemon juice. That worked well, but needed regular cleaning. Now I use a 4mm FR4 board, on which the objects stick much better, and come off by themselves when the bet temperature drops below 40C.

Absolutely the best battery holders I have seen on here. You did a great job, and are incredible for updating with all the many requests you have been getting. Truly one of the most useful things I have printed and will print over and over as I make new projects!

Thank you for your kind words! :)

Just opened these up and seriously, THANK YOU.

Printed this today an love it. Solid design. Has anyone tried battery clips? Or are people just wrapping their own contacts?

I went to a local hobby/craft store and found in one of the craft sections sheets of thin copper (I think they use it to emboss images on with scribes and or punches), I used sheers and cut them into thin strips that were as wide as the battery contact slots. I then bent them into a U shape and inserted them into the slots, I bent the upper one up so that I would have a soldering point and the bottom one I bet up also to capture the copper contact into the print. Copper makes great contacts but you can also using some solder and tin that area the battery will touch to make a better contact that won't tarnish as quickly as the copper will especially if this battery holder is used outside where humidity is an issue.

Let me know if you find a good solid option. The wrapping is hard and I worry about it coming loose.

The wrapped contacts won't come loose if you give tin them with a drop of solder.

Could you please post an upclose pic of such a wrapped contact made? It’s hard to tell/understand from existing ones...

There is nothing special about it, just look at the pictures 7, 6 and 8 which show the contacts. As you can see there, these are just wires stripped from the insulation and wound around the cylinders at the poles. Once the winding is finished, I quickly heat the wires with my soldering iron and add a drop of solder, so that the contacts can not get loose and will not corrode.

Could you please make a version for the 18500. These are reclaimed from Canon DSLR batteries. They are the same as the 18650, but only 500mm long

Never mind. Installed OpenScad and edited your script. It was so well documented I had an STL for a 18500 in minutes.


Can you post the 18500 (50mm) example? I was looking for a 1 and 2 cell version. Or even an idea on how to edit the files. Thanks!

Just put a line like


at the end of the flexbatter.scad file and make sure that there are no other uncommented lines after the line "// uncomment as needed:"

Use n=1, n=2 ... for having different number of cells. To finetune, the result you can also change the length (l=50.5) and/or the diameter (d=18.4) of the cells. To generate the STL you need to open flexbatter.scad in OpenScad and do Design/Render (F6) operation and then File/Export/STL to export the object as STL file.

Hi there! Good idea with the flex spring, this looks like a great battery holder.
I would like to connect three (or maybe two) AAA batteries in series. Ultimately I need to produce something that will power a 3 - 5V diode, so I believe three batteries would do this. However in the pictures it looks like all the batteries are connected in parallel, with the batteries facing the same direction.
Can the model be modified to connect batteries in series instead?
Can you please describe in detail how to go about wiring something like this?

As TuxMan already replied, you can wire the cells however you like. There are wire channels and passing through holes cut out in in the bottom of the holder for pacing the connection wires. If you look at the pictures showing the empty holders, you can see examples of the series wiring.

Also, check out the version this project with multi-cell compartments ( https://www.thingiverse.com/thing:941081 ), there you can put 2 or 3 cells in a row which gives you in series connection without any additional wiring.

Flexing battery holders with 2- and 3-cell compartments
by enif

I have seen your comment.
The connections are made by wiring. I would just wire the plus to minus of the next battery and you have what you want without redesign. This could be done internally under the batteries or external under the holder whatever you like more.
An other possibility would be, if you just want to power a diode. Use one battery and a step-up module. Most of these modules are described to work from 2 V input upwards but I have some in my box working also with lower voltages and there are also some on the market (eg. AliExpress, banggodd, ...Amazon, eBay) available working with lower input voltage.

What about D-sized cells? Somebody asked for that already in May 2016, yet unanswered...

Is the scad code sizeable enough?

Or does the cells weight or size stand against it?

These are designed to be remixed, modified, etc with ease. If you need a D-size and it's not available, then open the file up in SCAD and simply resize the parameters to the likeness of a D cell.

No problem to generate D-size holder. In the SCAD file, just copy module flexbatterC() into a new flexbatterD() and adjust therein the l= and d= parameters to the values corresponding to the D cell. I don't have any D cells at hand, that's why I didn't include them (yet).

Make the ends with conductive filament.

Conductive filament doesn't have the amperage rating that some projects require, especially with the high output capabilities that the lipo batteries can give if needed. Not that it's a bad idea at all but it just wouldn't work in all application.

Very nice design, thank you!

老铁没毛病,双击666 (づ。◕ᴗᴗ◕。)づ

Es necesario usar soportes al imprimirlos?

Very nice. I see you write the mah on your cells. Just got 1000 cells from a guy on eBay selling hoverboard batteries in 20 cell packs, going to be fun breaking down and resleeving those

Made a 4x AA last night. This is clever and well laid out, nice work!

I actually said WOW out loud when I saw this project. Can't wait to print a few out!

One of the most useful prints I have found. I forgot to order them, and a 1 hour print is much faster than waiting a couple days on Amazon. Plus you saved me a couple $. :) Thanks

Could someone make a CR123Ax3 holder? I would do it myself, but I'm not sure how with the provided scad file.

I've printed theese and they work incredibly well, really a good design. May I ask you a thing? Could you please upload or send me di STEP file of this: "FlexbatterAA x 2.stl". I'd like to include it into a design of my projcet for an estetic look but is really difficult to work with stl files.
I really thank you in advance.

Sorry, but I can't help you with this. I've never used STEP files and, from what I saw, OpenScad does not export to STEP format. I assume that there must be converter programs or on-line converters which might do the job for you.

All right no problem :-) thank you very much anyways. Have a nice day.

Try Meshlab, its free and converts just about everything to anything.
Going from STL to other formats, means parametric modeling is not possible, but you could import and build a new parametric model over the top. Im not familiar with step files, but stl is a mesh, and conversion to other formats will only produce another mesh in different format.

Thank you very much, you have been really kind, thank you again. I'll defentely check it out.

Is there any way you could have them so they are linked side by side, end to opposite end? So that to wire them up in series all you have to do is run a wire from one side to the battery right next to it, instead of running a wire all the way to the other side of the case?

Of course you can fill in the batteries by alternating the polarity, there is no physical reason why the spring should always be the minus pole. And if the "+" and "-" signs on the bottom of the battery case disturb you, you can simply remove them in the SCAD source file.

I actually though of that after I responded. My brain has just always trained me that the '-' side has the spring.

However, in the Makerbot software, as I just found out, you can pull up the single "AA" battery three times, move them around on the build plate, and swap the middle one end over end, and you've got your holder that goes "+" to +-" next to each other.

That being said, the spring design is awesome! Works amazingly. Great design!

would it be possible for you to make one for 5 AA batteries please?

It's already there: flexbatterAAx5.stl

loll Yes indeed t is ,I don't know how, I didn't see it the first time around lol , Maybe I should be printing reading glasses instead! hahaha.

What kind of metallic contacts do you use?.
I have a Problem to get a nice contact to the 18650

I went to a local hobby/craft store and found in one of the craft sections sheets of thin copper (I think they use it to emboss images on with scribes and or punches), I used sheers and cut them into thin strips that were as wide as the battery contact slots. I then bent them into a U shape and inserted them into the slots, I bent the upper one up so that I would have a soldering point and the bottom one I bet up also to capture the copper contact into the print. Copper makes great contacts but you can also using some solder and tin that area the battery will touch to make a better contact that won't tarnish as quickly as the copper will especially if this battery holder is used outside where humidity is an issue.

As explained in the description, I use directly the wire end by stripping from it about 10cm of the isolation and the winding the wire around the pole cylinders. For the small cells it's a bit tricky to get in the wire from the outside between the two halfs of the plastic spring, but with some practice I got the hang of it. Also, once the wire is wound around the pole, I give it a quick dip with the soldering iron, to make the windings stick together so that they won't become loose.

Any special trick to stripping wire at the middle? It is easy to strip off ends of wires, but I'm not sure how to do it like you are suggesting. Any help would be very appreciated. Do you use some cool tools to do it? Any tool stripping recommendations?

Maybe I expressed myself not so clearly, what I mean is to strip 10cm from the end of the wire. But probably the misunderstanding stems from a typo in my above message, where it says "string", but should say "spring"... I'll correct that one.

I wish I had a 3D printer. I don't get why the negative looks so weird for no reason...

Great design! I printed in Hatchbox pla and it came out perfect. Is it possible that you could design one for dual extrusion using conducive filament?

Great design! I printed in Hatchbox pla and it came out perfect. Is it possible that you could design one for dual extrusion using conductive filament?

Great design! I printed in Hatchbox pla and it came out perfect. Is it possible that you could design one for dual extrusion using conducive filament?

I have no experience with dual extrusion and neither with conductive filament. But since you have the full OpenScad source, feel free to modify it and then post it as remix. (Personally I am afraid that the resistance of conductive filament isn't low enough for most practical applications.)

Your plastic springs are brilliant.

Thank you! :-)

Print it? Well, maybe once to see how it fits. I'm going to include it in other openscad designs. Thanks!

Print it? Well, maybe once to see how it fits. I'm going to include it in other openscad designs. Thanks!

Comments deleted.


Thanks, great design!
I need these for a project that's meant to last a bit longer. Does anyone have long term experience with the plastic springs? E. g. are the springs losing tension after a year or two/three?
How much force is left?

I'm planning on printing in PETG or PC.


Your question is a good one indeed.

I have started this project more than 2 years ago and have always been using only ABS. So far I have not noticed any weakening of the spring force, even on the oldest ones. But also, I use them mainly with rechargeable batteries, so there are much less taking out / putting in operations compared to disposable batteries.

Comments deleted.

is it possible for you to add a holder for 2/3AA Batteries?

diameter 14,2mm
lenght 30mm

Should be no problem. You just need to call module flexbatter(...) with the appropriate l= and d= parameters in the OpenScad source file. It's probably easiest to modify the call in flexbatterAA(), where you probably only need to change the l= parameter.

What version of OpenSCAD, and what slicer are you using?
Rendering to stl, then to gcode results in many unconnected points. My attempt to fix the stl found it needed to repair about 2000 faces ... and when sliced, leaves me with many missing parts and even whole layers. Viewing the exported stl file shows much transparency, missing walls and such. I'm using OpenSCAD version 2015.03-2 and am still examining what could cause this. Interesting is that OpenSCAD renders a correct view of the item, but seems to hickup exporting this to STL. Unfixed slicing to gcode results in a base layer which misses two springs (of 5, generating the 5x18650 case mentioned below)
I'm trying a different slicer now (skeinforge instead of slic3r) but my impression is that slicer doesn't cause the problem, instead it may hide or expose those to larger or lesser extent. (pre-slicer) admesh already reports problems with the STL.

I made some pictures of the resulting rendered files:

STL from OpenSCAD - already holes in it:

base layer unrepaired STL to gcode:

all layers unrepaired STL to gcode, showing the missing layers:

As the problem already starts showing in the STL file, slicer seems to merely aplify it. Therefore it appears to be an issue with OpenSCAD.

Currently I also use OpenScad 2015.3, but when I created the files it might have been an earlier version. I use Linux width SFACT/skeinforge as slicer and so far I have not had any problems. But as you can see in some of the comments further down, there are other people who had problems similar to yours, which they they could resolve using STL repair tools such as netfabb.

In addition to OpenScad, I also use meshlab to visualize my STLs - and so far I have not noted the "holes" which are shown in your pictures.

So I compared rendering results against a few more similar items, and the next I tried showed almost exactly the same problem. I went on comparing, and found that those two are the only implementations manifesting that strange behaviour.
Code didn't look like they were related to each other, but it's a reference point for determining the cause. Conversion of resulting STL to gcode with sfact/skeinforge resulted in a broken gcode gfile (depending on gcode viewer, I got either "error in file", or a segfault ...). It is my current impression that something triggers an obscure bug in OpenSCAD which results in creation of an incorrect STL files, which then propagates the error through slicers into gcode files.

Reading through the comments below, as you mentioned others with similar problems, I noticed that it's the configuration for 5 cells which appears to be troublesome. Same as mine, and likely another clue.

I find it remarkably that we seem to use very similar environments (Linux, printrun for pronsole, sfact/skeinforge - though I'm mostly using slic3r), but this problem seems to show only in mine. Where environments are likely to differ is that mine runs on a 64 bit ARM based machine, yours may be x86 based.

Thank you - this appears to be exactly what I need, for a mobile solder iron, preferred operation voltages 16 to 24 V, from 5 18650 cells. Given that scad source has been published, addition of a cover/lid should be close to trivial, keeping batteries inside and fluff, debris and especially small metal objects which happen to live inside my pockets out. Commited item to printer right now.

exelente aporte. justo lo que nesecitaba

Excellent model, Thank you Sir!

Would it be possible to upload an stl of a 6 cell holder?

As you don't say what size of cells you need, it's difficult to help you...

But since you have the OpenScad source, you can easily generate any number of any type of cells yourself: at the end of the file, just call the appropriate module "flexbatterXXX(n=YYY)" where XXX is the cell type and YYY is the number of parallel cells in the block.

Thanks! Just printed the 1*AA holder on PLA and it works well even though PLA is not too flexible it still works. You spring design is excellent.

it woud be greade with a 9 volt battery model

These look great, I often need custom battery holders for projects. I do have a suggestion for contacts.
I use copper tape. The smug repellent tape. It's sticky backed and can be soldered onto. And it's really cheap if you go to garden centres or if there's one nearby I buy from B&M bargains.

I originally bought a tiny roll of tape from maplin which cost about £5!

do you think aluminum duct tape would work? I bought a large roll recently for some other project.. I am now wonering if it might be useful for conducting electricity. I am also wondering about using cnc or lasor cuttur for cutting design or etching into it.

Aluminum won't take solder.

Thanks for your suggestion - good idea! May be you could even take a photograph of how you attached the tape and post it here as a "Make" of this object, for us to see how it's done ... Thanks!

Hey could you please add 18450?


You have the OpenScad source, so you can easily create your own variants.

Hi. This was a great idea and they work great. One exception is the five battery aa holder. I'm not sophisticated enough to figure it out but at about 40 percent my printer starts filling in where the battery should go and stops building the divider walls like it somehow flips.It starts filling in the spring section as well. I don't have problems printing any of the other ones they all come out good but the 5 bay one I think there is a glitch somewhere. But the rest work great.

Strange... I have now uploaded a different version of the 5AA object, called flexbatterAAx5c.stl. Maybe that one works better for you?

Thanks for the upload but it still didn't work for me. Did the same thing. I will try to get someone local that knows more about the programing and if he figures it out I will let you know what I found. If it prints out for you and everyone else its probably some sort of issue on my end I'll have to figure it out. Thanks for the good design though I think as a temporary fix I will print out the 4 bay and a single bay and stick them together. They print out and work perfect. I will post pictures and stuffs when its all done.

They work great for me. The only thing I did different was use aluminum foil as contacts. I wrapped the wire through the holes to make contacts and twist the wires together. Then I use the aluminum foil instead of soldering. It worked great and I can reuse my prints over and over. Thanks!

please clarify how you got conducting contact from aluminum tape to the copper wires. I am thinking the side with adhesive won't be good at conducting electricity.

Not aluminum tape. Aluminum foil. I left the wires bare for the ends of the batteries and just used aluminum foil against the battery and foil. The battery contacts the foil not the wire. The aluminum foil contacts the wire.

If it conducts electricity then I guess it would work. I just used what I had on hand aluminum foil.

This is so cool =D

this is very something to think of and make!

I love the included springs. This makes battery boxes so easy to add to any project.

Hi I like the design and I have printed some 4x and 2x 18650 holders and I am wondering an easy method for implementing the terminals, what should be used?

As I described in the text, I directly use the stripped ends of the connecting wires as pole contacts, by winding them a few times around the pole cylinder. Optionally I then use the soldering iron to put some tin on the contacts to make the windings hold together - but don't use the soldering iron for too long, otherwise the plastic might melt...

I am new to this so sorry but has anyone tried printing this on a da vinci jr ... when I use their slicer it slices it really funny and messes up the spring part.

I don't know about the da vinci jr printer, but I remember that some users had similar problems (see comments further down) and there was even some forum discussion about it at https://forum.lulzbot.com/viewtopic.php?f=8&t=2695 . IIRC they used something like netfabb to postprocess the STL file. My STLs are generated directly by OpenScadn and I use Skeinforge for slicing, never had any problems so far...

Great design, thanks so much! Any chance you'd make the .scad file available, so I can generate my own models? I love OpenSCAD, btw!

How about just looking through the section "Thing Files" and downloading the file called "flexbatter.scad"???

BTW all my "things" always come with the full .scad source...

Thanks! I see it now! I promise I'd looked up and down the list twice, looking for it before asking. Great code, easy to read. Again thanks!

I've spent some time with your source for use with another project. It's a very elegant design and the comments in the source are pretty great. I've run into a bit of trouble with the flexbatter() module though. Can you help me understand what all the parameters are?

Thanks for your help and for sharing your work!

Maybe you can elaborate:

n: Number of cells
l: Length of single cell
d: Diameter of single cell
hf: something to do with the flanges along the top edge of the holder
shd: Screw Hole Diameter 
eps: something to do with the rails along the length of the channel 
xchan: the location of the wire routing channel with respect to the overall length 
el: Extra length - Not quite sure what this does, but it appears to effect the length of the spring

Check out the scad file of the multi-cell compartment version (http://www.thingiverse.com/thing:941081) which is a newer version containing still all the code of this "thing", but also has improved comments regarding the parameter meaning.

You are correct as to n,l,d,shd and xchan. As to the others:
hf: relative hight of cell case (1=full diameter)
eps: extra diameter space - added to "d" for the cylindric cutout in the middle.
el: extra spring length (needed for some small cells to accommodate the radii of the spring)

Flexing battery holders with 2- and 3-cell compartments
by enif

Thanks for the help. I'll check out the new version as well. You've been most helpful!

Comments deleted.

Don't know if this was already asked or mentioned and I missed it, but what gauge wire are you using for the power cables / windings?

That depends of course of the type of cell you are using and the current that will be flowing. But usually something in the neighborhood of 24AWG should just do fine.

Can you make one for D size batteries? Thank you!

Super cool. I printed off the 18650 last night for a project I am busy with. The Li-Ion - 5V charger is small enough to be hot-glued to the side of this making it a very compact solution for Li-Ion powered 5V project :)

Great project! I needed a holder for a CR12600 cell so I added another module statement with its dimensions.
But I know less than zero about SCAD. How do I get the script to run and do something? The SCAD website says "Press F6"
which, of course, does nothing in the SCAD editor window.
--Lost and confused....

Clever design !

Unfortunately the script produces a poor quality mesh, non manifold and with self intersecting surfaces.
Could not be sliced correctly with simplify3d and slic3r.

I had the same problem, but then I ran the STL file through this website that repairs STLs for free: https://netfabb.azurewebsites.net/

And then slic3r was able to slice it perfectly.

Thanks for sharing love this desing

How about a design for multiple cells alternating the position of the positive ends? This way it would be easier to series connect the cells without having to run a wire the length of the cell to the next one.

Alternating the position of the springs will result in a kind of zig-zag form which I didn't like too much, but since you have the source file, you can do it yourself if you like. Note also that you can leave all the springs on the same side and just insert the battery cells by alternating their direction, so the +/- poles are alternating between spring and no-spring position.

Also, if you use the multi-cell compartment remix, you need to do even less wiring, since you only need to wire the poles at the end of the cell chain...

Brilliant! You have figured out a way to make the most difficult part of a 3D printed battery holder 3D printable! Great work!

I will definitely use this idea next time I need a battery holder for a project!

Thanks for your kind words! :)

Nice design!
You should make it customizable.

Very well designed! Thank you.

What did you use for the metal end contacts?

As explained in the main text, the contacts are made by winding the stripped ends of the connecting wires around the contact bar.

What is with these cable jumper connector? Are they printable too?

No, these are standard crimp connectors - the white ones are JST-XH2.5 connectors and and the black ones are Dupont connectors.

Comments deleted.

Is there a 5 cell design of this? I have a TX that uses 4 AA Alkaline cells = 6V and when I use NiMH which are only 1.2 versus the 1.5 volts of the alkalines per cell I need to add another 1.2 cell to get a true 6 volts to the TX. Would be very helpful it's not too much trouble to upload a 5 cell version.


Great design by the way!

OK - done!

BTW the STL was generated simply by calling "flexbatterAA(n=5);" at the end of the SCAD file ...

I'm having a little issue. The 1-4 cell size AA files worked great. The 5 cell you recently added doesn't get converted correctly when sending to my printer. I don't see a way to add a picture in the comments that would explain easily. Did you get any errors with the 5 cell model?


What slicer are you using? I just ran the AAx5 STL file through the MatterControl/MatterSlice slicer and it slices perfectly. I know that some people have had problems using Slic3r (see some of the comments below) and had to "repair" the STL using "NetFabb" (which I have never used) in order for Slic3r to work correctly.


I have only worked exclusively in Sketchup, so wouldn't even know where to begin with working that out with SCAD file, so thanks again...

God, this will make my life so much easier! Thank you so much for these designs!

Thanks a lot for these things!
I'm just about to print the 18650x1 holder, but Repetier Host complains that the STL isn't manifold. No problems repairing with Netfabb, but perhaps you would like to check the file for future users?

Thanks for your comments! Strange, I generate all my STLs with OpenScad and never had it complaining about an object not being a valid manifold - in which case OpenScad actually refuses to save the STL. Also, I never had any problems when printing these STLs, but I don't use Repetier but Pronterface/SFACT.

I just have to ask, where is the 9Volt version ;)

It's for cylindrical cells only... But as you have the OpenScad source, feel free to modify as you like ;)

Thanks for this design! It's part of my first battery-powered project, now complete!

Keep up the good work!

great, awesome, easy, practical
Works great with PLA too

One of the best things here for electronic maker

Greetings from Munich

Danke, Michael! :)

Any chance you could add a AAAA? I'm currently designing a 3xAAAA case but I'd rather use yours because it is awesome.

You got the full source, so just download the SCAD file and call flexbatter with the corresponding dimensions. However, keep in mind that the AAAA cells are very narrow (only 8.3mm wide), so you would also need to reduce the spring wall thickness (ws) accordingly - but I am afraid that the resulting spring would not be strong enough... Anyway, why don't you try it and report back, best with a "Make" if you were successful :)

Very awesome! Thank you for sharing! =)

16340 which file is that/

It's the CR123A.

Very nice design. Printing as I speak, just needed this for a pencil sharpener of my daughter that works on other (bigger) batteries.
Thank you!

j'ai trouvé un truc pas mal pour faire les pattes de contacts électriques.
j'ai coupé des cosses et sa marche très bien :D
merci à l'auteur de l'objet ;)

photo: http://www.thingiverse.com/make:166803
video: https://youtu.be/D4oEZYRzkJM

Flexing battery holders with integrated spring
by gardien

exactement ce que je cherchais, merci :)

A very nice design indeed. I had trouble printing the AAA holder, though. My printer would only print the outer part of the plastic springs. The inner part, closest to the batteries, was too small, I suppose. My printer simply got ignored those inner parts of the spring. The printer just printed the first 180 degrees of the spiral arc. Any tips on that?

Strange... I doubt that this is a printer problem, I rather suspect it to be related to the slicer you are using. Have you verified if your slicer gave any error messages while processing the STL file? If the missing parts of the spring are not in the gcode file, it's not your printer's fault. Note that my STLs are optimized for 0.56mm extrusion width, if your extrusion width is much bigger, you might want to modify the "ew" parameter and regenerate the STL.

Cura does omit the parts in the gcode files. With a bit of tweaking most of the spring is printed. I wasn't able to print the holder so that the spring was attached to it. This was the best I could to tweaking Cura's settings: http://i.imgur.com/TV3veI1.png
I have no idea what the problem is. My printer is a Lulzbot Mini. The extrusion width shouldn't be too high.

I don't know Cura, so I have no clue what is going wrong here. But given that a lot of other people have successfully printed these battery holders (see the "Makes"), I think that my STL files should be okay.

I'm sure they're impeccable, just thought you might have an idea. I will post here if I figure something out with Cura. Maybe it gives me an excuse to try out Slic3r. What do you use?

I use Pronterface/SFACT.

In case you're interested, here is the thread about it on the Lulzbot forum: https://forum.lulzbot.com/viewtopic.php?f=8&t=2695

Brilliant design. I tried the CR123 and even in PLA it worked perfectly. Thank you.

How is this not a "featured design"? Brilliant .

Hello enif,
these are really perfect and smart holders for batteries.

But i have a batch of longer protected 18650 batteries and i dont know, how to work with openscad.
Please, can you make .stl files for 3pcs and 4pcs 18650 with dimension 70x18mm?

Thank you very much for that!

Ok - done! They are called flexbatter18700x{1,2,3,4}.stl .

Oh, man, thank you very very much!

Perfect work!

Great idea, was very keen to get it printed. Did it PLA and a spring cracked when i dropped it from 1.50m, and it didnt seem as convenient when held as something with a stronger spring. may have a go with ABS later out of curiosity. the stl and 3d design is very nice. just it feels totally impractical in PLA.

I am not surprised that PLA did not work, it's much to stiff and cracks too easily.

As I mentioned in my project description, this project really needs a material like ABS to achieve the required elasticity.


Thanks for a very nice design. This is the smartest battery holder available! clamps nicely and no special clips needed. I have printed the double AA version. I use 0.4mm solid wire for the contacts and a small strip of aluminium tape underneath the wire for an even contact surface. I have combined this design with the customizable box (http://www.thingiverse.com/thing:189264) and Adafruit powerboost (http://www.adafruit.com/products/2030) USB 5V supply to make a USB power supply. It's now powering my Raspberry Pi/Hifiberry.


Customizable Round Box with Lid
by Arvin

Very nice and clever work. Thanks for your effort! I tried printing several other people's battery holder designs and they didn't work out. Some were just too thin. Ones with "arms" to hold the battery in place didn't work because the arms are not very flexible and they break off when you try to remove the battery.

I'm using a Davinci printer. Initially, the 1 AAA holder I tried to print didn't print correctly - the "spring" end was completely missing. I then ran the STL file though a "cleaner" at this site: netfabb.azurewebsites.net. This is a free Microsoft site, but you do have to register. You upload a file, it crunches it, and you can download the "fixed" STL file. The holder now prints correctly. I've used this site before to successfully fix prints with missing features.

Also, I didn't have much luck winding the wire contacts. I was using 22ga solid wire. What I am using now is a thin, pure nickel, strip normally used to connect battery cells. These strips are typically spot welded to the battery terminals. I found these on ebay about a year ago and used them to rebuild a DeWalt battery pack. I just soldered the strips to the batteries since I don't have a spot welder. The strips are about 8 mm x 5 cm and very thin. They fit perfectly in the 1 AAA holder that I printed and would not pull out when I tugged on them. Although I haven't tried this yet, I plan to epoxy the strips in place and solder a wire to them.

I got my strips from "glad2bactive" on e-bay, purchasing a pack of 30 for about $6.50 plus a shipping charge. You can probably get them locally at a "Batteries Plus" store or other battery store that rebuilds battery packs.

Thanks for sharing your findings!

The AAA holder being the smallest is indeed also the most demanding in terms of printing quality and winding the contact wire at the minus pole. I also use solid wire there, because it is easier to insert (as the spring leaves only little space) and haven't had any problems yet.

just a question. But what are you using at the ends of the battery box to make contact with the battery itself ???

Thanks Steven

As is said in the text, I strip the insulation from the wire at the end and wind it around the "cylinders" at the + and - sides of the battery holder. I usually strip about 10cm and do 5-6 windings, then cut off the remaining bare wire. I then "tin" the windings at the battery side with a bit of solder to insure that they don't unwind - but be careful not to stay too long with the hot soldering iron, you don't want the plastic to melt ;)

BTW you can see how I do it on photos no. 7 and 12.

My compliments on your brilliant design and execution!

It is my desire to use your SCAD code as part of a current project where your battery holder is merged into the mounting frame to hold a number of PCBs.

With that in mind I would like to make a request. If you could pass the overall outside "cube" dimensions in a global variable that would help people like myself carve out and merge your design into our projects. And also the dimensions of the springs so we can be sure there is a proper opening around them. Thank you for considering adding this to your great source code!

Thanks for the compliments! :)

As for your idea about passing back the global dimensions (and position, I suppose), I could see the use of it and I am quite open to implement such a suggestion. However, I really don't know how to do this within the limitations of the OpenScad language (BTW nor how you would use these values after the object already having been constructed...). As far as I know, it's not possible in a module to assign values to global variables which are then passed back upwards to the calling module. So, could you please be more specific about the parameter passing mechanism you have in mind?

understood. let me explain the goal and recant my suggested implementation.

this project starts with a cube (sheet) that has 4 holes in the corners for mounting. everything else is union() with that sheet. i need the overall height to be as short as possible. your battery holder must now be part of that sheet, and the bottom surface is at the same elevation as the bottom surface of my sheet.

to accomplish that i must handle the interferences of your "part" and my "part". first i must cut a hole just smaller than the body of your holder so the union causes the two to properly merge and not fill in any of your object features. then there are the springs. the bottom of the springs need to touch the build plate AND i must cut a hole for them (in my part) to move freely.

hopefully you see what is going on. if i have the holder dimensions then i can code that into my code and even change the battery/configuration with the code handling the merging of the two. otherwise i have to author code in which i play around with numbers to make it work, and avoid making any changes after that.

another idea might be, and i do this on my modules so far in this project, is center the final object on the origin for each and every module() output. then we know where it is: [0,0,0]. next would be provide two functions for the "cut and paste" into a parent object with their RELATIVE coordinates also centers on [0,0,0]. thus, i use the same offset values with all three of your objects making coding easy, and i properly select the right ones for the difference() and union() parts of my object.

in effect i cut a "T" into my sheet. the top of the "T" is where you springs are, it is a big hole. the vertical of the "T" is just smaller that your holder and thus caused you holder and my sheet to completely union.

does that make sense?

thanks again for considering adding this to your work!

Ok, I do understand what you would like to do. What I still don't see is how exactly you propose that my OpenScad module should return position and the overall dimension... your reply doesn't say anything about this. As far as I know OpenScad does not allow to pass any variables upward to the calling module, and also global $variables wil only be passed to lower levels. The only (admittedly not so elegant) way I can see how to obtain the desired position/dimensions you need, would be to output them in my module with an "echo" statement, which you could then need to cut&paste into your code. If you have any concrete idea how to pass these values more directly within the OpenScad framework, please let me know.

in my last post i took back ("recanted") my original request.

at the end of the post i made a dfferent suggestion, seperate functions to return object of the necessary sizes and placed in space at the same location as the holder. thus offsets applied are the same for all and also apply to changes in the holder setup.


Do you mean that one should provide in addition to each module which generates an object also a corresponding function to return an array with the overall size and location? The problem I can see with this is that this function would not have access to the local variables of the corresponding module...

Why don't you explain your idea with a small OpenScad example that shows the mechanism you propose for a very simple case?

Sorry to be so slow on the uptake :)

Very nice... very creative... I am gonna make these for my 18650's !

Thank you! :)

Now that I look at the picture a bit closer, I see what you are doing with the wire end wrapped around the plastic (nice!) and I agree that is better. The problem with putting the battery in the other way is human error: I'm trained to put the negative end against the spring every time. Perhaps an alternating ring shield around the wire end to keep the flat (negative) end from making contact on the side that should be positive?

May I suggest an option to place the spring at the opposite end on alternate positions in order to make the wiring of series battery packs a bit easier? Especially if you add a slot between the walls so that a bit of metal sheet can be clipped and bent to fit between the negative end of one battery and the positive end of the next.

You can easily do the alternating orientations in the SCAD file by changing line 108 from




However, personally I don't like the look of the alternating springs and the gaps between. I see your idea with the metal sheets, but I think it will be difficult to make them hold firmly in position.

Also, you could leave the springs as they are and just insert the batteries with alternate orientations, so that the spring is alternately on the plus and the minus pole...

Nice work, perfect for what I was looking for....

idk why, but my slic3r hates this. it's just makeing stringy crappy slices

Strange! I use pronterface with SFACT and I have no problems - as you can see on my pictures...

enif, i like your design, it's really clever design, but is it possible to add a 2 x 26650 size battery holders to your list? i had problem with your scad file, i use catia, so...

I have now added STL files for th 26650 type cells. As I don't have such cells here, I could not test them, but had to rely on the dimensions given in http://en.wikipedia.org/wiki/List_of_battery_sizes .

got it, thanks mate

Excellent design - Wish I'd thought of this before buying 60 sprung battery terminals!

This is one of the greatest things I've seen. And I've looked at nearly everything in the Thingiverse.
Also I was in need of a 3 battery holder, nicely timed too.
(Which also might be affecting my perception of "greatest" but I stand by my original statement :-D )

Thanks, Bill - I appreciate your kind words! :)