Ohm Sense Makes Sense Of Resistor Color Bands

[Alex Busman]’s first foray in iOS programming looks like a pretty useful tool. He came up with Ohm Sense, an iPhone app that will take a picture of a resistor and calculate the value based on the color bands. It’s a great tool that we wish we had when we were starting out. At 99 cents, the app is also much cheaper than the emotional cost of our relationship with Violet.

[Alex]’s used OpenCV for processing of the image data. The app works by scanning the image from the top-left corner and continuing until it sees a beige rectangle. After a bounding box is drawn around the resistor, the iPhone scans the image for columns of color. After a little interpretation, the value of the resistor is displayed on the screen. While it only works on resistors with beige plastic now, [Alex] says he’ll expand that in the future to include blue bodied metal-oxide resistors. [Alex] says the coding only took a week, so if anyone would like code a similar app for Android, be sure to tell us on our tip line.

This isn’t [Alex]’s first Hack A Day build. We featured his Handy Board project that uses an NES controller to play some chiptunes earlier this summer. Compared to the projects we’ve let slip over the last few months, it’s good to see someone did something productive with their summer.

[Alex] posted a demo of his resistor app on YouTube. Check it out below.

[youtube=http://www.youtube.com/watch?v=Nk0AEv8825U&w=470]

59 thoughts on “Ohm Sense Makes Sense Of Resistor Color Bands

    1. That depends. I, for example, have a form of red-green collorblindness (deuteranopic). Therefore it is for my almost impossible to read the values on resistors, because it becomes in my cause harder to see differences between red, green and brown if the colored surfaces become smaller. (I cab for example see the difference between a red and a green car because it is a large surface, but not that of a green and a red strip on a resistor).

      Normally I orden all my resistors very good, but if I orden them I must use my non-self-range multimeter, wich can be an enourmus job. So this is something great for me.

      p.s. sorry if my English is bad, it is not my native language!

      1. I agree. I suffer from a sort of shade blindness. Difficulty differentiating similar shades of colours.
        It only really has two implications:
        1) I can’t find the numbers amongst the coloured dots in those books the optician makes you look at when you go for an eye test (Ishihara Test);
        2) Reading resistor colours.

        So, yeah. But please release for Android.

      2. Me too =)
        I really only have problems when crawling behind computers to plug in headphones. One jack is pink and one is light green. When it’s dark, I can easily convince myself the green jack is pink etc, but if I move my head slightly, they suddenly switch as if the colors actually changed.

    1. +1 on this.
      Kudo to the programmer first of all,
      make it open source and for android now please.

      Paying for something is hardly what we (hackers) like to do,instead I’m pretty sure someone can code it on Processing and then it’s a matter of dbl-click to port it to arduino. I’m not much of a processing coder tho,if someone feel like it,you got all my support!

    2. :D AGREED and if yall havent checked this out for android its called electrodroid its really neat its got spec sheets for popular pin outs, calculators, law refrences, charts etc…

      but this is cool too

  1. This is excellent. I’m a newbie in hobbyist electronics, and I’m also colorblind, and so figuring out resistor values is a horrid experience for me. This app would certianly be useful, except that I don’t have (or want) an iOS device.

    Now they should just make an Android version…

  2. Violet! It’s been years since I remembered Violet! Will never forget the first time my wife heard that mnemonic.

    Seems to me like this tool would come in handy for the occasional hobbyist who just didn’t want to go to the trouble. Of course we could all “just think about it ourselves,” but we could also print Hack A Day in a daily newsletter and deliver it through snail mail channels.

    It might be even handier for those of us who are aging and can’t see those tiny bands of colors as well as we once could. Just reach for the phone instead of the magnifiers. More than once I have used a digital photo when I didn’t have a magnifier handy.

    As far as this being an ad for an app, I don’t see it that way. Seems to me like Alex has adapted a tool (smartphone) to do his bidding, and the writers are just passing on the info to people who might be interested in doing the same.

  3. This is amazing!

    Of course, it’s not all that useful to me, as it only reads the beige 4-band resistors which I can read without difficulty, but it can’t read those blue 5-band resistors, which I’ve never been able to figure out.

  4. Yet another reason SMT rocks, no silly magic ring decoding to do. Personally I’ve never understood why they can’t just print the damn number on them like they do for caps and most other things (yes, I realise cost is an issue but c’mon!).

    1. They used to do so in USSR. Our resistors used to have something like 2K7 5% written on them and the resistors thus were the easiest components to sort.

      Ring colour code is the most absurd thing that happened to electronics in all its history. Boycott it, use SMD :D

      1. I think there is a reason for color coding. Reading letters of a round cylinder gets harder and harder when the component gets smaller.

        Ever tried reading the voltage off of a small zener diode?

        Color codes are easiest to register, but decoding them is a matter of remembering the values/colors and reading a lot of resistors.

        (I’m lazy, just grabbing the DMM everytime)

    2. Bands can be read no matter what way the resistor is put in. Machines and low paid assembly workers don’t need to fiddle with resistors to get the oriented correctly, they can just jam them in.

  5. The app seems well-written and useful.

    I actually submitted this computer vision problem as a 6. Semester project, half a year ago. It was rejected due to its simplicity, e.g. there was not enough theory on choice of features, feature extraction, etc.
    I ended up doing a license plate recognition application with OCR, written completely in Java without the use of pre-written filters and methods.

  6. This is awesome, if im understanding it right it would help people like me who see certain shades of color wrong. Now if i could only afford an I device I would totally pay the buck for this.
    For me my resistors stay sorted , are used once , then go into a bin to be sorted by meter. I could see this making the whole process easier by making it scan over and over and just hold the resistor under the cam for a second and it spits out a value. +1 looking forward to continued development of the concept to a more useful Idevice-less interface I could afford.

  7. I have also submitted a bugfix to apple that will hopefully be approved sometime next week. It was crashing under one lighting condition. Also when I get back to school, I will have easy access to tonnes of different brands so it will work for everyone. I also then intend to get 5 and 6 band resistors on it.

    1. If you’re trying to read the value of a resistor in a circuit, a multimeter will also measure the resistance of any other components the resistor happens to be in parallel with. If that’s a semiconductor, all bets are off as to what value you’ll read.

    1. I’m one of those who sees large blocks of colour just fine, but has difficulty reading the tiny bands on resistors. I have problems distinguishing between black/brown/red (depending on the red), and between yellow/green if the colours are small.

      Have the same problem with some flight sim games – green dot is friendly, yellow dot is enemy – for isolated dots I can’t tell the difference and either blow up my own stuff or get shot down when I was expecting help.

  8. Another colour-blind hacker here…

    This app solves a problem DMMs can’t solve for me, situations where the resistor you’re trying to read is already in-circuit and there may be other paths for the current so the DMM reading can’t be trusted.

    Nice work – and genuinely game-changing for me. :-)

  9. When I was about 7 or 8 years old, one of the first things I learned about electronics, without even knowing what it was, was the list of E12 values: 10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82.

    The first thing I ever owned that was related to electronics was a credit card sized plastic thingy from Philips that let you rotate 4 discs inside it to select colors and see the values. I learned the colors from that.

    I’m fortunate enough not to be color blind, but with this knowledge I can read most resistor values even in bad light because in most cases I know what it must be: If it looks like orange-violet-brown I know it’s probably really red-violet-brown because 370 ohm resistors don’t exist (at least not with 5% or 10% tolerances), and 270 ohm is an E12 value.

    That just leaves the difference between red-red-something and orange-orange-something… I guess I could use it for that.

    But I was thinking this should really be part of a bar code reader app… After all, resistor codes are really just early bar codes…

  10. Weird how the software development enthusiasm for phones is so much greater than it ever was for computers it seems to me.
    Same for the rate at which the hardware is advanced, maybe I should finally get a smartphone and simply not use a SIM card and use it as a small wifi connected computer.
    Never apple for me though, too locked up and creepy.
    But google is getting worse and worse too though IMHO, sigh.

    Excuse me if I went a bit off-topic perhaps

    1. If you’re going to get a smartphone but without using a sim card, you can always go for those handheld tablets like the iPod Touch or a couple of Android tablets. They’re essentially what you’re looking for, and way cheaper.

      It’s just convenient to have programs being very portable in your pocket, that’s why there’s lots of enthusiasm. I think the fact that these phones use managed code as their default language is also another reason

      1. Hmm, but the tablets are not pocketable, and I know the ipod touch is but I don’t like the apple ways, and I’m not sure there are android type devices similar to the ipod touch, at least I don’t recall seeing them, smallest I recall is 7″ screensize.

  11. Great idea for an app I suppose, but when will people actually learn the resistor color code.

    My biggest confusion has always been the different colors for resistors besides beige. I got that blue is 1%, but what about when there are brown or something like that?

  12. We were talking about this at our own hack-space, and it prompted me to do a fruitless internet search for just such a program for my Android phone. I came across a number of comments by color-blind people wishing for this.

    There are two things I would add to your existing program; #1, put the photo of the resistor next to the version you simulate, so that you can compare them to check for errors. #2, add a multi-resistor mode, where you line up several resistors together as you take the photo. This would help when you are searching through a pile of resistors.

  13. W00H00!

    I know the colors, I know the BBROYGBVGW. I just can’t see the colors. So here is my $0.99! Totally worth it. Maybe now I can get some projects built without having to call my kids in all the time to read resistors.

  14. I actually came up with one more idea that would make the application itself hackable. Include a bluetooth interface that would allow someone to use the application in a robotic resistor sorter. I.e. A robot places a resistor at the correct spot for the photo, tells the application via. bluetooth to take the picture, and then the application reports the value back via. bluetooth.

  15. Does anyone else find it odd how many color blind people apparently read HAD? Probably something about seeing things in a differant way. Great project, Electrodroid for Android is also excellent. I would like to see something that would give me datasheets quick and easy on my phone.

  16. Bought the app, tried for 30 min to try to take a photo that was good enough for recognition, gave up

    The zoom control in the app is disabled, hence you cannot fit the resistor into the green box without having to go really really close to the component. So close that everything becomes a blur.

    Don’t buy it!

  17. For colorblind people like myself, this app is a requirement of life — I am not physically equipped to decode resistor bands, and I’ve been waiting for this app so long for Android it’s not even funny.

  18. Thanks for the reply Alex.

    I cannot use the zoom-scrollbar within the application. It works fine using the standard camera. However, from your app, when I tap the live-view screen, the zoom scrollbar turns visible. Yet I cannot drag the bar.

    Also, I can’t turn on/off the flash. Nor can I flip between the front and rear camera. Only the shutter button works from within your application.

    A restore of the phone has not solved the problem. For your record I have roughly 10 other camera apps that works just fine. I have an iPhone G4, non-jailbreaked, newest firmware.

    As for now I’m still stuck with an application that cannot be used for it’s main purpose.

  19. hello guys can someone help me write the same code but in matlab using digital image processing..The code should process the image and give resistance value …I have done half of it but i am stuck now…

Leave a Reply to agrahulCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.