3D print a fruit fly trap: jar, bait, tips
Fruit flies? A jar and a funnel are enough
In late summer one overripe banana in the fruit bowl is enough, and the next morning dozens of tiny flies are circling the kitchen. Fruit flies, also called vinegar flies, breed incredibly fast: a single female lays hundreds of eggs, and a little over a week later the next generation is on the wing. Sticky traps from the store help, but they cost money every year and end up in the trash. The most effective trap needs no chemicals at all: a jar with some bait and a funnel the flies can get into but rarely out of.
This generator makes exactly that funnel, as a lid you screw onto an empty jar. Jam jar, honey jar, pickle jar, mason jar or even a PET bottle: pick your jar from the list or enter the thread diameter you measured, set the funnel height and download an STL or 3MF file. The preview updates with every change, everything is computed in your browser and nothing is uploaded. The finished trap prints in one piece without supports.
If you would like to look around first, the examples show ready-made traps: from the trap for a jam jar and the large trap for a pickle jar to the trap for a PET bottle.
Why a funnel trap works
Fruit flies follow their noses. Fermenting fruit juice, vinegar and wine smell like food to them, and like the perfect place to lay eggs. The scent from the jar rises through the funnel and through the fine slits in its wall. The flies land on the lid, walk down the funnel wall and slip into the jar through the small entrance at its tip.
Getting out again is the hard part. Inside the jar the flies head up towards the light and the glass walls, not back to a hole only 3.6 mm across that hangs in the middle of the space. The deeper the funnel reaches into the jar, the further the entrance sits from the rim and the less often a fly finds its way out. A drop of dish soap in the bait makes sure that flies landing on the liquid don’t take off again.
The slits in the funnel are only 0.6 mm wide: enough to let the scent out, but too narrow for a fruit fly, which is a good 2 mm long. They make the trap noticeably more attractive, because the smell no longer comes only from the tiny entrance. If you want a quick print, or your printer tends to close fine gaps, just switch them off as in the funnel without slits.
Measuring your jar
For the lid to hold, it has to match your jar’s thread. Common sizes have presets; for everything else, measure quickly.
Thread diameter. Put the calipers around the jar neck right over the thread, at its thickest point, not below it. Enter that value as the thread diameter. On twist-off jars the number on the lid, such as “TO 63”, is the lid’s diameter; the glass thread is about one millimeter smaller. The presets take that into account, but manufacturers differ by a few tenths, so measure if in doubt.
Lugs. Turn the old lid over. Around the inside of its rim you will see small slanted hooks: the lugs. Small twist-off lids up to about 63 mm usually have four, larger ones such as 66, 70, 77 or 82 mm usually six. Your funnel lid gets exactly as many.
Mason jars don’t have short lug threads but one continuous thread. The presets for the regular (70 mm) and wide mouth (86 mm) therefore set the jar’s thread starts to one: the four lugs then sit staggered along that single thread, as in the trap for a regular mouth mason jar. Clip-top jars with glass lids have no thread and won’t fit.
PET bottles with a 28 mm neck are standardized (PCO 1881 on most water and soft drink bottles, PCO 1810 on older ones). Here the lid gets a complete internal thread like a screw cap, and the funnel is slim enough to pass through the bottle’s opening.
Jar depth. Once screwed on, the funnel reaches almost as deep into the jar as it is tall. Below it you need room for the bait, about a centimeter of liquid plus a few millimeters of air. The generator tells you how deep the jar should be inside. Low jars get the short funnel, tall ones the extra deep funnel.
Setting up the funnel
The total height runs from the lid face to the funnel tip. 55 mm fits most jam jars; for large pickle or mason jars you can choose 70 to 80 mm. A taller funnel is also slimmer and prints better, because its inside is steeper.
The entrance at the tip is 3.6 mm in the original. That is a good value: fruit flies get in easily but struggle to get back out. Below 2.5 mm it gets tight for them, above 5 mm more of them escape.
The rim width is the flat ring between the skirt and the funnel mouth, where the rim of the jar rests. 5.5 mm suits most jars; for thick-walled glass you can increase it a little. On PET bottles the generator checks that the funnel fits through the neck.
Under fit & grip you set the play between the jar’s thread and the lid, and you can add grip ribs around the outside that help when screwing the lid on and off, as on the trap with grip ribs. The ribs start with a 45° slope so they print without supports.
The right bait
The classic is cider vinegar with a drop of dish soap. Pour one or two centimeters into the jar, add a small drop of soap, swirl it once and put the lid on. Cider vinegar smells like fermenting fruit to fruit flies, and the soap takes away the liquid’s surface tension: flies that land on it sink.
A dash of red wine or beer, a piece of overripe banana or peach, or a splash of fruit juice work well too. White vinegar smells less fruity and attracts fewer flies. Change the bait every few days, at the latest when it turns cloudy or a lot of flies are floating in it. Rinse the lid with warm water.
Put the trap where the flies show up: next to the fruit bowl, the compost bin, the sink or the crate of empty bottles. Two small traps in different places often work better than one large one. And the most important step is still to remove the source: eat overripe fruit or put it in the fridge, empty the compost bin often and rinse bottles.
Printing tips
The trap prints just as it sits on the screen: the flat lid face on the bed, skirt and funnel growing upwards. No supports are needed. The inside of the funnel is steeper than 45°, the lugs are round, and any printer bridges the slits. On very large jars with a short funnel the inside gets flatter; the generator then warns you, and a slightly taller funnel fixes it.
Material: PLA is perfectly fine, as the trap sits in the kitchen and never gets warm. PETG copes with hotter dishwater. The color doesn’t matter to the flies, so pick whatever suits your kitchen.
Layer height: 0.2 mm is a good compromise. For clean scent slits a well-tuned extrusion matters: with too much plastic the 0.6 mm slits close up. If that happens, set the slit width to 0.7 or 0.8 mm, which is still too narrow for a fruit fly.
Walls: the 1.2 mm wall thickness is three lines with a 0.4 mm nozzle. Make sure thin-wall detection or the Arachne wall generator is on in your slicer, so the bars between the slits come out cleanly.
The chamfer at the bottom edge compensates for the first layer’s elephant foot, so the lid stays straight on the outside.
Doesn’t fit?
The lid won’t screw on: increase the play in steps of 0.2 mm or reduce the lug depth. Also check that you measured over the thread and not over a bead below it.
The lid slips or sits loosely: reduce the play or make the lugs longer with the lug rise. Older or unevenly molded jars benefit from a little more play and longer lugs, as in the looser variant.
The lid only grips on one side: the number of lugs is usually wrong. Count them again on the original lid.
The pitch of the jar thread hardly matters on twist-off jars, because each lug is only a short piece. The default 14 mm suits almost every jar. On mason jars, though, it matters: the presets take the value from the thread table.
If you are unsure, print a test lid with a short funnel first, about 30 mm tall. It is done in half an hour and shows you whether the thread fits.
Origin & license
This generator is a port of the model “Turn any jar into a fruitfly trap” by AnneVanLeyden, published on Printables, where it is one of the most popular models of its kind with over 2,700 likes. It is released under CC0 1.0, i.e. dedicated to the public domain. The funnel profile with its constant wall thickness, the thread lugs with rounded ends and the staggered rows of scent slits were rebuilt in TypeScript with the same parameters and defaults as the OpenSCAD file. The result is compared with the unchanged original: volume and dimensions agree to within a tenth of a percent.
New are the presets for twist-off jars, mason jars and PET bottles, the optional slits and the grip ribs. The mason jar thread data comes from the project’s thread table, the bottle necks from the public ISBT drawings. Many thanks to AnneVanLeyden for a simple and effective idea. All projects used are listed under licenses. Now it’s your turn: open the generator, measure your jar and get rid of those fruit flies.
All parameters
The numeric settings of the generator with their default values and allowed ranges. Text, fonts, patterns and colors are set directly in the generator.
| Parameter | Default | Range | Meaning |
|---|---|---|---|
| Jar | |||
| Thread Ø | 52 mm | 25 – 120 mm | Outside diameter of the jar’s thread, measured over the thread on the neck with calipers. |
| Lugs | 4 | 2 – 8 | How many small hooks sit inside the original lid. Small twist-off jars usually have four, larger ones six. |
| Lid inside height | 11 mm | 6 – 20 mm | Inside height of the lid’s skirt. 11 mm fits most jars. |
| Funnel | |||
| Total height | 55 mm | 25 – 150 mm | From the lid face to the funnel tip. The jar must be deep enough to leave room for the bait below the tip. |
| Entrance Ø | 3.6 mm | 2 – 8 mm | Hole at the funnel tip. 3.6 mm lets fruit flies in, and they rarely find the way back. |
| Rim width | 5.5 mm | 3 – 15 mm | Flat ring between the skirt and the funnel mouth, where the jar’s rim rests. |
| Scent slits | |||
| Slit width | 0.6 mm | 0.4 – 1.2 mm | Width of the scent slits. Below about 0.5 mm many printers close them up. |
| Slit height | 3 mm | 1 – 6 mm | Height of one slit. |
| Row spacing | 2 mm | 1 – 6 mm | Vertical gap between two rows of slits. |
| Slit spacing | 3 mm | 1.5 – 8 mm | Gap between the slits of one row. |
| Fit & grip | |||
| Play | 0.5 mm | 0.1 – 1.5 mm | Room between the jar’s thread and the skirt. More play helps with uneven jars, but the lugs grip less. |
| Wall thickness | 1.2 mm | 0.8 – 2.4 mm | Used for all walls; the funnel’s is measured square to its surface. |
| Bottom chamfer | 0.6 mm | 0 – 1.5 mm | Beveled outer edge on the bed, which makes up for the first layer’s elephant foot. |
| Grip ribs | 0 | 0 – 48 | Vertical ribs around the skirt for a better grip when screwing. 0 = smooth. |
| Thread details | |||
| Thread starts on the jar | 0 | 0 – 8 | 0 = one start per lug (twist-off jars). Mason jars have one continuous thread; the lugs then sit staggered along it. |
| Lug depth | 1.5 mm | 0.8 – 3 mm | How far the lugs reach inwards. |
| Pitch | 14 mm | 2 – 30 mm | How much the jar’s thread rises per turn. About 14 mm on twist-off jars; the exact value hardly matters. |
| Lug length (rise) | 0.8 mm | 0.2 – 6 mm | How much one lug rises along the thread; larger makes longer lugs. |
| Flank angle | 35 ° | 20 – 45 ° | Slope of the lug flanks. |
| Tip rounding | 0.7 mm | 0.3 – 1.2 mm | Radius of the lug’s rounded tip. |
Frequently asked questions
Which diameter do I measure?
The outside diameter of the jar’s thread, measured over the thread on the jar neck, ideally with calipers. Common twist-off jars, mason jars and PET bottles have presets.
How many lugs does my lid need?
Count the small hooks inside the original lid. Small twist-off jars often have four, larger ones from about 66 mm six.
Which bait attracts fruit flies best?
Cider vinegar with a drop of dish soap. The soap breaks the surface tension so the flies cannot escape. Refresh it every few days.
What are the slits in the funnel for?
The 0.6 mm slits let the scent rise while the flies cannot pass through them. Turn them off for a faster print.
Do I need supports?
No. The lid lies flat side down on the bed, the funnel grows upward and the lugs are rounded.
Origin & license
- Turn any jar into a fruitfly trap by AnneVanLeyden · CC0 1.0 · code ported – funnel profile with constant wall thickness, thread lugs with rounded ends, scent slits