Resistor Sorter


Issue 27, October 2019

This article includes additional downloadable resources.
Please log in to access.

Log in

Sorting through resistors can be quite a task, especially in poor light, but Andrew found an easier way.

Reading colour codes on resistors can be difficult if your eyes are failing you, you’re colour blind, or you are working in a dimly lit workplace. Sure, you could buy a magnifying glass or use a digital multimeter, but then you need to juggle the probes and make sure they make proper contact with each resistor leg.

One of our readers came across an Arduino-based resistor sorter so he decided to make one for himself and share his project with us. We caught up with Andrew to find out more.

Can you tell us a little about yourself Andrew?

I am a metallurgist/process engineer/materials engineer who has been teaching High School since 2002 in Industrial Arts, and train high school teachers in C++ and Arduino on a voluntary basis for our teacher association.

Wow! Sounds like you have a busy schedule. What got you involved in training teachers about Arduino?

All students are now required to learn text-based coding in high schools, and the Institute of Technology Education (which I volunteer for) has trained approx 200-300 teachers in delivery of Arduino-based projects to assist in meeting this demand.

That’s music to our ears. We love the idea of kids learning to code. Please tell us what motivated you to make this resistance meter.

After teaching each session, I have approximately 100 loose resistors to sort through, and was looking for an easy way. I saw this project online and realised it would be quick and easy to make, as well as being convenient.

Trying to sort resistors by their colour codes can be difficult and time consuming, particularly 5-band metal film resistors under poor lighting. Where did you discover the circuit?

I found the circuit on the Arduino Project Hub, designed by Federico Vivaldi. Here is the link: https://create.arduino.cc/projecthub/federico-vivaldi/sorting-resistors-the-lazy-way-ceb557

Complete build by Federico with component sockets built into the front of the case.
Andrew used the same LCD screen as per Fererico's design. CREDIT: Federico Vivaldi

The project hub is great for project inspiration. We notice your project build is slightly different from Federico’s. Can you tell us about the differences?

The circuit is similar but with extra resistors to improve accuracy. The screen is identical and the library drove it fine.

We also notice that your unit has jumper leads to connect the resistor so you don’t need to bend the resistor legs to measure them, which is a nice touch. How did you go about choosing the resistors to improve accuracy?

Initially, I set up the resistors so they roughly doubled in value to improve the accuracy of the unit. My original plan was to use 10/20/47/100/200/470/1000Ω etc… up to 1MΩ. I originally had 20/200/2k/20k/200k resistors soldered to A1/2/3/6/7 on the Nano, and configured the nano to read these as an input. The results, however, proved unreliable. I think the internal resistors on the analogue pins within the nano potentially interfered with results on the A0 pin.

The final prototype used the resistors that were left, basically 10/47/100/470/1000Ω etc. to 1MΩ.

I should also point out that I did not use pin 13 as it has an inline resistor soldered on the pin on the circuit board to reduce voltage to the onboard LED. This inboard resistor would also have dramatically altered the accuracy of the project.

Your design does look physically smaller than the one online. Can you tell us a little more about the design?

I just wanted a unit as small as possible (and could have even made it smaller in retrospect.) I bought my nano board without the header pins soldered, which reduced the size of the unit considerably. I quickly drew it up in Solid Edge 2019 (free.) It took approximately 15-20 minutes to draw the housing using a set of verniers to get it to fit tightly. It was then 3D printed in ABS.

We like that you have made the Nano and screen friction fit so there’s no need for mounting hardware. How does your build perform and what are the limitations?

Thank you.

It measures values repeatedly. The most it can measure is approx 1.5MΩ. The resistance might be more accurate if I measured resistors when the ratio of the resistance in the voltage divider is as close to 1:1 as possible, but given it’s a rough sorter, the 3% error is acceptable.

That’s certainly accurate enough for your sorting task. Please tell us about the code. Were there any modifications you needed to make?

Not really. I simplified it a bit with a couple of ‘for’ loops.

Initially, the code was written to stop measuring values when it got its first value. This gave the resistance of a 220Ω resistor repeatedly as 178Ω. I changed the code to cycle through all values and record the maximum value.

The values of resistance used in the program were actual measurements of the resistor used with a multimeter to improve accuracy. This is the reason for the precise numbers used in the code. I have provided the code for your readers.

Thank you. We will make the code and your 3D print files available on our website for readers to download. If you were to design it again would you do anything differently?

I would mount the screen vertically which would have made the unit smaller again. I would also set up a chromed paperclip as the contact and have magnets pull the resistor legs onto the contact to make it hands free.

That would be a handy solution to make it quicker and easier to use. Are you working on any other projects?

I work with Arduino daily, being a High School teacher involved in STEM and Industrial Arts. Students in our classes make projects that include distance measuring, alarms, robotics (including the MeArm robot as well as home-made ones,) Segway, etc. I run an advanced after-school interest group too.

We appreciate you taking the time to share your project with our readers, and thank you for teaching more up-and-coming makers.


High School Industrial Arts Teacher & STEM Educator