Category:

Resisting Mantis

In a certain song, it is claimed that “the last step — it’s the hardest one.” And so it is…

Sometimes, you stumble across a DIY enthusiast online who has built something really cool and useful. Everything seems fine, but… They’ve built the “thing,” yet skipped the “last step.” So what was once a cool and useful creation just remains… a “thing.” A prototype, an experiment, or, as they like to call it, “just fooling around.” Arduino enthusiasts are particularly prone to this. They slap something together on a breadboard, blink some LEDs, and that’s it. Out of ten projects, at best, two will ever be completed.

I’m no saint myself in this regard, but I do try to make sure that, in the end, I create something practical for everyday use rather than just another “experiment.”

Take, for instance, how the other day I finally got around to digging through my stash of electronic components, trying to bring some semblance of order — or at least a system — to it.

The saddest part of this effort revolved around the archaeological layers of resistors. And that’s precisely what I’ll be talking about next.

I’m not exactly the most organized person, and the principle of “put it back where you found it” just doesn’t work for me. Here’s how it usually goes:

Woo-hoo! Time to shove this little LED into action!

Here’s this pretty one, such a wonderfully transparent color. If we’re lucky, it’ll light up blue. Let’s see… It needs a resistor to pair with. Which one? Hmm… Interesting. What voltage is this LED rated for? Who knows — the bees must have dropped it off from the sky onto my desk.

Alright, let’s grab a heftier resistor, just in case it doesn’t burn out. This one, perhaps… Hmm… It’s not lighting up at all — resistor’s too hefty. Let’s set this resistor aside and grab another… Oh, something’s starting to glow… Set this one aside and grab another… Better, but not quite there… Set this one aside and grab another… Ahhh, my eyes! Too bright!!! Set this one aside and grab another… Set this one aside and grab another… Set this one aside and grab another…

There — now it’s just right. Ah, perfect… Hmm, why is there such a pile of resistors on my desk? I wonder which one came from where and what value it is? Let me just scoop this mess into a jar for now — I’ll sort it out later…

Sad, isn’t it? But it gets even sadder when that infamous “later” finally arrives, and I try to sort through that jar of resistors, now holding a good hundred or so, dividing them by value. That’s when a new kind of hell begins:

Alright, the pile… Let’s handle it… So… There should be markings on these… Stripes… Like on this one, for example… Do I read them left to right or right to left? Supposedly, by the standard, the gap before the last stripe should be wider… Or was it the other way around?… Hmm… Oh well, doesn’t matter — bless those wonderful folks in China — the gaps are all the same anyway… Okay, let’s try to guess.

Alright, let’s say this stripe is the first one. It’s red… Or maybe brown… Or orange… Probably closer to red… Bless you, China… The second stripe is blue… Or purple… Or green… You know what? Let me grab my multimeter!

Alright… Doesn’t read on the 2 range… Click over to 20… Still doesn’t read… Click… Click… Damn it, the crocodile clip fell off! Let’s start over… Oh! It’s reading now… 380.42K… Wow. What do I do with this? Clearly, it’s just rounding errors, so it’s probably 360K… Then again, it might be 400K… Let me borrow my friend’s lab-grade ohmmeter, the one that’s “accurate to the king’s whisker!”

Alright… Whoa, fancy! It does the selection automatically, no fiddling with the dial. Cool! Let’s see, let’s see… Ah, here we go: 380.416732K… Wow… And what do I do with that?… Damn it!

Fine, let’s just say it’s 400K. Decision made. Into the 400K box it goes. One resistor from the pile sorted. Only a godzillion left… Or maybe I’ll just dump them back into the jar? I’ll deal with it later…

I think I’ve managed to lay out the full depth and essence of my deeply personal drama with resistors.

Then again, maybe this drama might feel painfully familiar to someone else? I mean, I can’t be the only one, after all… So, if that’s the case, welcome to my club of Anonymous Mess-Makers. Let’s tackle this head-on!

Alright, let’s begin…

Hello. My name is Jim. I am a mess-maker. My life was full of chaos, disorder, and despair. I lost everything! My inspiration, my motivation, my restful sleep, the bees… But then, I invented the amazing AUTOMATED TWEEZER OHMMETER “RESISTING MANTIS”! My life turned around instantly! Inspiration came back, good vibes returned, I slept like a baby, Elvis Presley made a comeback, and the Pokémon… they came back too…


At first, I scoured DIY forums and blogs in search of help. In the overwhelming majority of cases, I stumbled upon something along these lines:

It’s not just this particular person — it’s the same with everyone. Seriously, everyone! I mean, maybe there are some rare gems in the vast DIY jungle who don’t follow this pattern, but I’ve yet to stumble upon one…

At best, these projects are on the level of, let’s say, a middle school soldering lab experiment. But in this common state — as it is for all of them — it’s absolutely useless for easing the life of a chronic mess-maker like myself. And that’s where all those musings at the start of the post about the “last step” came from.

It became clear that if this “last step” was ever going to happen, it’d be up to me to make it. Naturally, I went through all the necessary stages:

  • Denial: It can’t be that no one has already done this.
  • Anger: Are you freaking kidding me?! The idea is right there, plain as day!
  • Bargaining: Maybe I can search through Amazon, Alibaba, or wherever. I’d even pay triple the price if I could find what I need.
  • Depression: It’s nowhere. Not for any amount of money. Nobody needs this. So I’m the only idiot, huh? Why did I even get into this? I could’ve been drinking like a normal person. What has DIY brought me? A mess in my room, a dog rolling in sawdust, and a cat who’s developed a taste for flux straight from the jar? Everything’s pointless…
  • Acceptance: Oh, screw it! I’ll have my own amusement park! I’ll clean up the mess. The dog looks great covered in sawdust anyway. The cat’s happy too.

Bring me Autodesk Inventor and Fritzing on my desktop! Kekeke! It’s time to think some big thoughts!

The idea:

  • This needs to be a highly specialized device designed for one single purpose: sorting resistors. Not for precisely measuring their values. Not for calculating the celestial signs of OmOhm-Ra. Only and exclusively — sorting.
  • The device should not only display the actual measured value but also the nearest “standard” value from the E12 and E24 series. Resistors in these series are used in 99.9% of my DIY projects. E6 is inherently pointless, and E48 or higher is excessive for my needs.
  • The device must not only identify the resistor’s value but also serve as a sorting tool. Ideally — a pair of tweezers. You grab a resistor from the table, determine its value, and immediately place it where it belongs.
  • It should be a durable device for regular use. The solution must be robust and long-lasting.
  • Arduino, of course. It’s the most accessible option for quick implementation. This isn’t the kind of project I’m willing to dedicate years of my life to. It needs to be quick, efficient, and completed in no more than a week of evening work.

Next comes the usual process of modeling and designing, with the goal of merging a hedgehog with a boa constrictor — without inadvertently unleashing yet another world-ending “whatever-virus.” Or at the very least, preserving some semblance of intelligent life within the confines of my own home.

When it comes to electronics, everything was invented long before I came along. The circuit itself, along with an explanation of how it works, can be found with a quick Google search. The only minor difference in my circuit compared to the ones you’ll find by the dozens on any Arduino forum is the use of an OLED display instead of an LCD and the addition of extra control buttons:

All components can be roughly divided into five distinct groups.

Battery + Switch

The switch is just a simple toggle — nothing fancy. It’s wired directly into the power line to turn the device on and off.

As for the battery… I didn’t want to mess with any compact lithium-ion setups. The space you’d save with them would inevitably get eaten up by the charging circuit anyway. And, honestly, I’m not a fan of that whole ordeal: monitoring charge levels, recharging, fiddling with those flimsy USB connectors. I find it much easier to just swap out a battery. Especially since a regular 9-volt battery will last for years with this kind of low power consumption.

The only hard rule: no crappy “tails”! I hate those things with the fire of a thousand suns. It’s an instant rage trigger — pure, unfiltered loathing. They’re an abomination. Any device with a 9-volt battery sporting one of those sad, flimsy “tails” immediately drops in value for me to the level of “chuck it at the inventor’s face until death” followed by desecration of the corpse and grave.

Unfortunately, sometimes there’s no other option with store-bought electronics, and my hatred for those “tails” only deepens because of it.

The path of a true samurai on this planet is a proper, solid battery holder securely mounted to the case. None of that shameful spaghetti mess.

Arduino

Nano. That’s it — that’s all there is to say about this “device group.” Sure, you could use a Mini, but what’s the point? The other components dictate an overall size that could practically house a server room with air conditioning and a diesel generator. The 9-volt battery alone takes up enough space to qualify as a brick.

The Probe

This group consists of PNP transistors (in my case, the universally beloved 2N3906) along with their supporting circuitry. This is essentially the ohmmeter itself. The principle behind its operation, when paired with the Arduino, is well documented in the project link I provided earlier. Here’s the link again, just in case.

For this “device group,” I had to fabricate a dedicated PCB. Point-to-point wiring just wouldn’t cut it here. I went old-school and used a laser engraver to make it. Ordering from the Chinese manufacturers takes too long these days, plus their minimum order quantity is three to five boards. Why would I need more than one?

The PCB is single-sided and simple enough to make in a single session using any accessible method — laser engraving, CNC milling, or etching — in about an hour or two.

However, if anyone feels inspired to replicate this project, I’ll include a complete archive at the end of this write-up. It will have everything, including the Gerber files for this PCB. Whether you want to laser-cut it, CNC-mill it, etch it, or order it from China, the choice is yours.

Display

OLED. A “dual-color” model (the first 16 lines of pixels are yellow, the rest — blue).

Why? Well, first of all, I personally find it brighter and more legible than the LCD displays commonly used in such projects. Secondly, it’s more compact, yet it can display just as much — if not more — information at once. Thirdly, it supports i2c communication with the Arduino out of the box, whereas with an LCD you’d either need an onboard or external controller, or an absurd number of wires connected to the Arduino, making it act as the controller itself. And fourth… well, I happen to have about a dozen of these OLEDs lying around in my stash. As for LCDs, I’ve got just one — a large, four-line, gorgeous piece with an i2c controller onboard. It’s all shiny and fancy, and frankly, I couldn’t justify wasting it on something this trivial 🙂.

Buttons

These are more of a “luxury” feature that came about during the later stages of the design process, once it was clear that everything was going to work and exactly how it would function.

The first button toggles the display format of the resistor’s value between “classic” and “modern.”

To keep it brief, the “classic” format would show something like “2.2kΩ,” while the “modern” format displays the same value as “2K2.” The modern format emerged because not all beloved manufacturers from China include the ohm symbol in their printers’ character sets. Or maybe they’re just unaware of its existence. So, on schematics, diagrams, and packaging, they came up with using letters like R, K, and M in place of the decimal point. It’s more compact, doesn’t require the ohm symbol, saves ink, and optimizes production — all that good stuff.

In my stash, the resistors that are still somewhat sorted are kept in their original boxes, which are labeled in both styles depending on when, where, and from whom I bought them. To minimize mental strain and sort resistors by just glancing at the screen, it’s convenient to switch the display format to match the labeling style of the boxes I’m currently working with. It’s a small, pleasant, and genuinely helpful feature. Why not?

The second button toggles between E12 and E24 “selection tables.” Why, you ask? Well, here’s the thing… Of course, like every other DIYers, I first built everything on a breadboard:

And the results from that breadboard setup were so unimpressive that I almost abandoned the project altogether. The variance was ridiculous!

The measurement accuracy was such that I might as well have been measuring resistors using coffee grounds. It didn’t even come close to the E24 resolution. With E12, it worked maybe 80% of the time, if I was really lucky. Essentially, it was the classic case of “the game’s not worth the candle,” as every second comment on forums about this topic suggests. Because very few people move beyond this stage. Unfortunately, those who do usually refrain from online battles, smirk knowingly, clearly understand something, but remain silent.

I decided to trust those knowing smirks, assuming the issues were due to poor connections and a janky setup. And, as it turns out, I was right! The finished product, built on a proper PCB with good routing and soldering, not only handles E24 perfectly but could even venture into E48 territory with decent accuracy.

But when I started working on the breadboard version, I could only speculate about this. So, the initial Arduino code only included a short E12 table, which was enough to debug everything at the start. Later, after assembling the proper PCB, getting bald from sheer joy at the results, joining the ranks of the knowingly smirking, and adding the E24 table to the program, I thought, “Why delete E12?” Might as well leave it in. I’m not exactly sure why, but there was plenty of memory left on the Arduino, and the case had a perfect spot for a second button… So, why not?

Formally, I even designed and routed a tiny PCB for the buttons. You’ll find the Gerber file in the archive too. Use it however you like.

For my project, I didn’t bother etching, cutting, or ordering this PCB. It’s just too primitive. Instead, I soldered everything manually on a small piece of protoboard:

If not for the intricate shape of the case, I could have gone fully “point-to-point” with heat-shrink tubing and hot glue. After all, these are just buttons. Here, the “principle of reasonable sufficiency” is perfectly acceptable…


With the electronics sorted out, it’s time for the infamous “last step,” without which this whole project would have been utterly pointless and indistinguishable from the countless others already done by so many others.

Just like with the electronics, the tool I envisioned can be broken down into several independent components.

The Instrument Compartment. This is the largest and most complex part of the tool, where all the electronics, including the battery, will be housed:

The “instrument compartment“ is mounted onto another part of the tool, which we’ll call “the tweezers” — because that’s exactly what they are:

The design and shape of the tweezers themselves are not my invention. This kind of construction was developed long ago by 3D-printing enthusiasts specifically for plastic fabrication and has been used in countless versions and modifications by DIYers. All I had to do was adapt the concept to the required size and shape.

The Pivoting Mount. A hinge-like mount connects the instrument compartment to the tweezers, giving it enough “freedom” to position the display at an angle that’s comfortable for viewing:

It’s clear that the tweezers in your hand won’t be held at a perfect 90-degree angle, nor will they align perfectly with the surface of the table from which you’re picking up resistors for sorting. To save you from having to contort yourself into strange positions to read the display — peering under your elbow, for instance — the screen can be adjusted relative to the tweezers, the table, and your line of sight to find the most convenient position.

The Probes. The third and most delicate part of the tool is the probes at the tips of the tweezers:

Despite their apparent complexity, the construction is fairly simple and addresses two critical aspects:

  1. Adjustable Tip Distance
    Resistors come in all shapes and sizes — long legs, short legs, large bodies, tiny bodies. Naturally, the probes need to be adjustable to handle varying resistor dimensions.
  2. Proper Tip Alignment
    The operating principle of tweezers of this type dictates that when the jaws close, their front tips must meet first, leaving a gap between the rear points. While you could squeeze the tweezers harder to force the back points together via material flexibility, that’s not the right approach.

To address this, the entire design of the jaws is engineered to allow fine adjustment of their parallel alignment. This ensures proper contact between the tips at any resistor size or lead thickness, using normal pressure on the tweezers without requiring excessive force.

These carefully considered mechanical elements make the tool ergonomic, functional, and versatile, while also ensuring it can handle a wide variety of resistors with ease and precision.


While the printer was busy extruding the first part, the electronics were assembled in their final, permanent configuration, exactly as they would be placed inside the case:

To neatly route the wires without any unnecessary loops or dangling tails, they were temporarily tied to the boards with “cable ties” during soldering. These ties were, of course, cut off afterward:

The solder joints where the wires connect to the boards were reinforced with hot glue. In my view — possibly mistaken but firmly held — this is the sole legitimate use for hot glue: reinforcing solder points, rather than assembling structural parts, as seen all too often on DIY channels and blogs.

The battery holder was a pre-made solution. These are plentiful and dirt-cheap on Amazon, so there’s no point reinventing the wheel:

And here’s how it all came together:

The bottom part of the “instrument compartment” case:

The switch had to be glued directly to the battery holder using cyanoacrylate adhesive:

I tried a lot of different ideas for mounting the switch, but each time I concluded that gluing it was the simplest and most optimal solution.

The buttons and the OLED display are soldered to the Arduino and integrated into the top cover of the “instrument compartment” case:

The assembly process itself went very quickly and smoothly, with no surprises. There wasn’t even a need for significant post-processing or adjustments.

The only thing that limited the speed of the entire process was the printing time for the parts. For instance, the “tweezers” took 8 hours to print with a layer thickness of 0.06mm (!!), four perimeters, four solid top/bottom layers, and a 45% honeycomb infill:

In terms of flexibility, it turned out absolutely perfect on the very first try.

I was also a bit worried that the relatively large and heavy “instrument compartment” sitting atop the “tweezers” might cause some discomfort during use, but those fears proved to be unfounded. Everything fits securely and naturally in hand:

The probe contacts were made using standard terminals. Here are all the steps involved in adapting one of them:

The terminals are crimped and glued into the tweezer tips:

The tips are then installed onto the tweezers:

Each pair of tips is connected with two wires — purely for reliability. Inside the “instrument compartment,” these pairs are combined into two main probe wires, as shown in the circuit diagram above.

Additionally, this setup makes it possible to adapt the tweezers for use with a bench-top laboratory ohmmeter (in that case, the “instrument compartment” is, of course, unnecessary). Bench ohmmeters usually require four wires for the probes.

In such cases, the pairs aren’t paralleled. One pair is for measurement, and the other is for calibration.

I don’t personally plan to use these tweezers in that capacity, but a friend specifically asked me to include the option. Apparently, if he likes how it turns out, he’ll ask me to make a similar set of tweezers for his lab setup. So, I made the provision. You’re welcome!


The Result of the Project:

Details of the Display and Controls:

  • The Icon: In the top-left corner of the screen, there’s a tiny (20×16 pixels) icon/logo depicting a fierce, “resisting mantis.” Use your imagination to picture it in all its pixelated glory.
  • Displayed Values:
    • R (Resistance): The actual value measured by the probes.
    • S (Series): The nearest value from the E12 or E24 series.
  • Modes:
    • NUM/RKM: Indicates the current display format.
      • NUM – Classic style (e.g., “2.2kΩ”).
      • RKM – Modern style (e.g., “2K2”).
  • Series:
    • E12/E24: Shows the currently selected series used for matching.
  • Buttons:
    • Top Button: Toggles between NUM and RKM display formats.
    • Bottom Button: Toggles between the E12 and E24 series.
  • Switch:
    • The Slide Switch on the Right: Power on/off.

Here’s how the tool looks in action:

Needless to say, I’m absolutely thrilled! I managed to sort through an entire jar of resistors in just fifteen minutes. Not all of them had their “original” packaging, so in the end, I simply found a tray with small boxes like this:

Вообще оно для бисера всякого и прочей такого рода рассыпухи, но общемировая электропаяющая общественность уже давно сошлась во мнении, что это – самое оно. По факту личного опыта – присоединяюсь к общему мнению.

Если чо, то на амазонах всяких спросите “Elizabeth Ward Bead Storage”. Их там несколько модификаций есть с разного размера коробочками (как и сами коробочки разного размера отдельно поштучно):

I’ve never had anything more convenient for organizing small electronic components. Well, maybe except for a “tower” made of matchboxes taped together with electrical tape.


Everything here is neatly organized into folders: schematics, PCB layouts, 3D models for printing, Arduino firmware, and so on:

The only non-obvious part of the firmware is located in the config.h file. Here’s the relevant snippet, found near the very beginning:

C++
define PRB A0 // Probe control pin
define PRB0_PIN 12 // 100 Ohm circuit control pin
define PRB1_PIN 11 // 1 kOhm circuit control pin
define PRB2_PIN 10 // 10 kOhm circuit control pin
define PRB3_PIN 9 // 100 kOhm circuit control pin
define PRB4_PIN 8 // 1 MOhm circuit control pin

const uint32_t res_table[5] = {
  99, // PRB4 actual resistance (Ohm)
  997, // PRB3 actual resistance (Ohm)
  10050, // PRB2 actual resistance (Ohm)
  101900, // PRB1 actual resistance (Ohm)
  969000 // PRB0 actual resistance (Ohm)
};

Defines are simply the pin numbers on the Arduino to which the resistors RA8-RA12 are connected (refer to the circuit diagram above). These can be left as-is if you’re using the same inputs/outputs as I did in my project. However, right after the defines, there’s an array directly linked to them.

In this array, you must specify the actual resistance values of the resistors in ohms.

For example, in my case, according to the schematic, the RA12 resistor is supposed to be 100 ohms. However, due to resistor tolerances (you should use resistors with 1% tolerance or better), its actual resistance is 99 ohms. Similarly, the 10 kΩ resistor’s real value is 10.05 kΩ, and so on.

Before soldering the resistors to the board (!!!), measure their actual resistance with a reliable multimeter or laboratory-grade ohmmeter. The more accurate the values you input here, the more precise your tool will be.

Apart from this, the firmware doesn’t require any additional configuration or tweaking. Well, unless you feel like adding something fancy yourself.

If you have questions, feel free to ask.


That’s how it is… Now the resistors scattered across the table and jars don’t stand a chance!

Stay healthy…