Happy Halloween from Adafruit! Check out some scary #electronichalloween posts, the frightening Halloween section and spooky videos!

April 21, 2010 AT 1:09 pm

Resisty – Resistor CAPTCHA – solve the resistor values to post a comment!

Pt 2837
We are thrilled to release a solve-the-resistor CAPTCHA plugin for WordPress! This plugin will draw a random 5% or 10% resistor and four color band sliders beneath it. The commenter needs to match the colors on the sliders to the colors on the resistor. Commenters don’t actually need to know how to read resistors, but this will help them as they post comments on site that use this plugin. Random resistors are generated from E12 and E24 decade values (so there’s never something like a 4.6K Ohm resistor. Plugin created by: Adafruit Industries – Daigo Kawasaki, Limor Fried and Phillip Torrone. It’s open source, so please feel free to use it and improve upon it!

Our goal is to teach a little about electronics as people participate online. We’ll see how it goes! You can try it out in the comments on our site right now!


Check out all the Circuit Playground Episodes! Our new kid’s show and subscribe!

Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Learn resistor values with Mho’s Resistance or get the best electronics calculator for engineers “Circuit Playground”Adafruit’s Apps!



132 Comments

  1. Very clever!

  2. Awesome! There is one problem. If you don\’t have Javascript on, it doesn\’t work =(

  3. …but not really a CAPTCHA. It can be trivially solved by a machine. Actually, poses a bigger problem to humans! (Blind? No scripting?)

    (What it really needs first thing: don’t force scrolling, but allow me to just click on the right color!)

  4. @EllisGL – it’s not a problem, you posted! :) if you don’t have javascript on many parts of many sites will not work, we’re not going to work towards moving away from standards and features that 99% of everyone has – and for comments, no one is forced to comment – if you’re hanging out without javascript you can still get most everything here, according to our stats 99.99999999999999% of visitors have it.

  5. @hn – do you think someone is going to develop a machine just solve this CAPTCHA on only our site? how will a machine do the scrolling? we are doing this to have fun and teach folks a little electronics – this isn’t what some people will consider fun, if you don’t like it, don’t use it :)

  6. Very nice idea!

  7. Awesome!
    /me goes and works on a bot to solve it :P

  8. Cute for this sort of site, but considering a simple greasemonkey script could solve it (by just sending back the correct response) it’s not much of a CAPTCHA.

  9. It is a fun project but not really a bot protection as it would take probably 10 minutes to write a color sampling bot and submit the right response.

  10. Hi! I think this is WAY cool, but I have one request. On the documentation on the plugin page it doesn’t say how to make it appear. I’ve “activated” it in the plugins page, but when I attempt to post as an anonymous person it doesn’t appear. Any ideas?

  11. @Adam Shea Congratulations, you’ve just explained how to break every CAPTCHA that requires you to respond with a correct response…. Of course, coming up with that correct response is often less trivial. In this case it could probably be done by examining the image, extracting the color(s) because the locations don’t change, then knowing which value that would apply to. Because the returned html/javascript gives no indication to what the correct answer should be.

  12. What’s wrong with Recaptcha and its nice black & white text?

    I have poor colour vision and have to ask friends to read some CAPTCHA’s for me as it is, This will be another one I cant see.

  13. Very cool idea! I love that I had to go get my mouse and plug it in to comment… I know, I’m a freak some times. :D

  14. hahah after seeing this on twitter i had to stop by and leave a comment. Just because :)

  15. @concino – if you really want to devote your time to breaking something we made to help people learn resistor values please reconsider participating here, just because you can solve the resistor value does not mean we’re going to stop moderating comments that aren’t helpful or positive – we’re doing fun stuff, this is cool – we will always review all comments, solved by humans or not :)

  16. @john – Recaptcha does not teach electronics, it’s also not very fun for us and our site, we want to teach and have fun on our site. you posted a comment here, so obviously you figured it out.

  17. awesome

  18. WOW that’s cool

  19. Very cool idea…too bad it’s just wordpress…i’d throw this on my blogger based page in a heartbeat. I think a math based one would be nifty too…just no differential equations…or maybe that would weed out the retarded trolling…

  20. @danny, @thedude, @echelon and others – thanks guys! this was a lot of fun to make!

    we think this will inspire other science and engineering related CAPTCHA that teach when as people comment on sites.

  21. This is an awesome idea :)

  22. Absolutely marvelous. I may have to put this on LetsMakeRobots.

    My only request would be a “Can’t read this one? Click here to load another resistor” thing. Because I’m not positive I got those colors matched right (we’ll see, if this actually posts)

    (it didn’t, try #2 looks much more promising)

  23. this is AWESOME, great learning tool!

  24. not spamming, just practicing ;)

  25. I love it, thanks for being creative.

  26. Bah, I don’t think that last comment went through correctly… let me try again…
    I agree it’s a cool and novel idea and I do think you’ll have to continue moderating comments because like a few of us have said, it’s not a terribly effective CAPTCHA. Not to mention when you say “please make a bot that does this, we

  27. This. Is. Awesome.

    Does it work in a text-mode browser though (eg without JS)? You should make it fall back to text boxes (if the user is leet enough to use a text-mode browser they probably know resistor codes by heart :p)

  28. Bah, it keeps cutting my comment short I give up on trying to get my point across.

  29. Ok, I didn’t give up completely, just gave up trying to get my point across here, read the full comment here: http://losinggeneration.homelinux.org/2010/04/21/adafruits-captua/

    And damnit! That was not an incorrect resistor value!

  30. Whoa Harley, calm down.

    I’m sure that Adafruit will continue to monitor comments for spam and inappropriate or offensive posts.

    And anyway, if someone does decide to make a bot to crack it, who cares? It’s not like breaking the Resisty captcha means you can suddenly launch the ICBMs or something.

    In the end, it’s just a little bit of fun.

  31. @del — I’d love to see it on LetsMakeRobots!
    Also, this is fun. I spent a few minutes pressing F5 and matching the randomized E12/E24 resistors.
    -John

  32. nice

  33. @johngineer Exactly. I never said any different did I? I was frustrated at wordpress for not posting the entire comment for some reason (and one time for the CAPTCHA saying I was wrong, when I’m 80-90% sure I was correct.) The point about breaking the Resisty was because they said “we’d love to see that” so someone /will/ break it for that fact alone.

  34. Hah! It gave me 1K, which I have about 6 lbs of in a box next to my desk. This is way better than a hard to read swervy texty nonsense captcha.

  35. This captcha is da Bomb.

  36. Just tried this on my blog and it doesn’t work. The resistor image it attempts to call as with yours is in the path plugins/Resist/resistorImage.php whereas the plugin installer places all the files in plugins/resisty/ ?

    It’s a great fun captcha but broke as it stands for me?

  37. @harley

    Actually, I’m not sure what you were trying to say, because it appears that wordpress was cutting your comment short. You should look in to that — could be a problem. ;)

  38. Gokhan Koralturk

    Perfect! Makes you want to post a comment just for the fun of it :) Someone should to a system tray clock application to replace standard Windows clock. (hardware one I read about: http://hackaday.com/2010/01/15/know-your-resistors-tell-the-time/)

  39. since you’re all part of our beta – we are going to fix some bugs later today. feel free to bang on it while we do.

    harley, this likely isn’t for you – it’s for people who want to have a little fun while they post on our site.

  40. Great Idea. But I thought, you get a value like “220k , 5%” and have to set it and not only copy the colors

  41. @johngineer obviously you missed comment 30. You know, the one *directly* above yours. BTW, and this is just FYI, I was/am calm. I can be slightly annoyed/frustrated and be totally calm (who knows maybe I’m alone in this one.) Also, how do you suppose I look into the problem? I can only get so much information from the client side as to why it was cutting off my comment. I didn’t see anything that stuck out as strange from looking at the request/response. It’s also strange that it quoted my comment on return, but didn’t unquote it when it put it back in the comment box. So I’d guess it’s a WordPress issue.

  42. Nifty! I don’t have much to say other than “Nifty”, but it’s so nifty, I felt compelled to comment just so I could use it.

  43. @adafruit Are you being serious here? Now I can’t tell if you’re joking or just haven’t read my comments. Perhaps I was unclear so let me summarize my points for you:

    1) I like the idea. It’s a cool plugin.
    2) As a CAPTCHA it’d be fairly easy to programatically break.
    3) Someone will break it because you specifically asked them to.
    4) It’s already failed me perhaps once
    5) WordPress failed to submit my whole comment, so I had to post the full comment elsewhere.
    6) Someone who’s color blind may be unable to post, perhaps you should consider putting the numbers on the color bands for them.

    I didn’t think I was being unclear (except for when 4 & 5 made it unclear which I consider out of my control)

  44. @harley – CAPTCHAs are serious business, we’re very serious, this likely isn’t for you :)

  45. nifty!

  46. Just had to try it out!

  47. woot 68MΩ+/- 5%

    there is one of them floating abound my desk somewhere

  48. As a serious CAPTCHA I believe you’ll fail. In all honestly, unless you make some major changes, I’d say stick with saying it’s a learning tool and a fun toy for electronics enthusiasts.

    I believe that only because you openly asked for someone to break it will it happen sooner rather than later. I doubt any spam bot authors will take to cracking the CAPTCHA for some time, but that’s only because it’s so new and only a very few people are currently using it.

    And would you please quit saying “this likely isn

  49. Another try for finishing comment 46: (it appears the quote I copied directly from your comment 43 is what caused the issue while submitting the comment)

    And would you please quit saying “this likely isn’t for you”? I’m here, I’m commenting, and I’m trying to give you constructive criticism. I didn’t, after all, just wonder to an open source hardware site on accident.

  50. Time consuming, but I like it.

  51. “As a serious CAPTCHA I believe you

  52. @harley – see all those people who like it, we made it for them, as we said in our post it’s a fun way to learn resistor codes – they’re enjoying it. it’s likely not for everyone, it might likely not be for you :)

  53. AWESOME! needs to be one for PHP BB as well :P

  54. @Opiboble – we’re going to do one for php BB later, once we work out any bugs with this one and use for awhile.

  55. @adafruit *facepalm* I’m not sure how much clearer I can be when I say “I like the plugin.”

    At least you’re doing like I said, and saying it’s a “fun way to learn resistor codes” and that it’s not a serious CAPTCHA to deter spam. I stick by what I’ve said about it not being a good CAPTCHA to prevent spam bots or automatic posting bots of any kind.

  56. @adafruit @johngineer In case you didn’t notice in my comment 47: the problem I was running into (and it appears Ed Davies hit too) was copying text from the above comments that includes a single quote that is pasted in the “leave a comment” box. It’s a bug somewhere in WordPress that it’s either not sending the value correctly or not writing the value correctly to the database (hope it’s at least properly quoted in php so that SQL injection doesn’t happen) or somewhere in between. Hope that helps in your attempts to track down the issue.

  57. I have to say that I really only want to install this capcha for the fun of it. I get a ton of spam comments every week (I currently have no capcha) but the Akismet plugin does a damn fine job filtering all that crap out. So, basically, I’m not terribly worried if there’s a script that breaks it, and every spammer has a copy, and uses it routinely. Multi-layer protection is the key.

  58. THinking is amazing

    I think this captcha is amazing!

  59. testing quickie update!

  60. Better yet would be to have it only have the resistor and you have to type in the correct response. or vise versea

  61. Wouldn’t the fact it is color coded make it is to write a bot?

    Ironically I (a fully accredited human being) was not able to pass the test. I assume it was the tolerance. Being slightly color blind I have a hard time distinguishing between the 5% and 20%.

  62. This is a great idea!

  63. In response to #5. Yes someone will write code just to break you site. They wrote a custom script to spam mine and it has 1/10000 the traffic of yours.

    They don’t need to script. I assume you are passing the value back as a hidden html form parameter. The spammers will just fudge the form.

  64. @Archeious. wow! that is not how the code works, it’s open – so please go look at it, it’s all up there :) oh, for and everyone here who continues to think this is about spam – it’s not. we review every comment. we spend a lot of time to make this a good place, spam free and we’re also not celebrating negativity , so be kind to each other and keep it positive.

  65. This is clever and fun. However, I must say that the creator seems to overreact to constructive criticism. Pointing out potential flaws isn’t necessarily negativity – rather, it indicates an active interest and a desire to collaboratively improve a project. Telling everyone who comments in a less than fully positive way to get lost comes across as childish.

  66. @ratastic – (phil here) no one told anyone to get lost – we did say (and we’ll say it again) – this type of fun way of commenting isn’t for everyone, we know that and it’s clear that it isn’t for a few people here. we want to set a good tone for everyone, beginners to advanced – not everyone is security & spam experts, they just think this is fun – we’re not going let a few cranky people ruin it for everyone. ideally, there would be a balanced amount of contributions than just criticisms – but that’s now how web or web comments work.

    we did need to delete some comments from people who 1. spammed and 2. personal attacks on other commenters. as always – be kind to each other and keep it positive here.

  67. Think of the colorblind.

  68. The only children here are the complainers. Adafruit NICE WORK this plugin is awesome installing it now! I am considered color blind and let us see if my comments goes through.

  69. heh, more hurdles to go through just to add my two cents.
    not worth the effort for me.

  70. i’m posting a comment just use the slider.

  71. This is totally worth writing a comment for (not that one actually needs to submit…).

  72. Now this looks like an interesting idea :D

  73. Color blind for 47 years. No problems here.

  74. Nice job :D

  75. awesome. just awesome

  76. Got here via Hackaday.

    I think I worked out how to hack this. I got the meaty bits taken care of, but I’m not motivated to glue it together into a script tonight.

    I used wget 10 times to get a sample of the resistor images.
    I found that the color of the bands were located at the following pixel locations:
    45×40
    80×40
    110×40
    150×40

    Ran those through ImageMagick like so:
    convert png:resistorImage.php.3[1x1+45+40] txt:
    convert png:resistorImage.php.3[1x1+80+40] txt:
    convert png:resistorImage.php.3[1x1+110+40] txt:
    convert png:resistorImage.php.3[1x1+150+40] txt:

    That spits out the correct RGB codes like so:
    $ convert png:resistorImage.php.3[1x1+45+40] txt:
    # ImageMagick pixel enumeration: 1,1,255,rgba
    0,0: (100, 50, 0,255) #643200 rgba(100,50,0,1)
    $ convert png:resistorImage.php.3[1x1+80+40] txt:
    # ImageMagick pixel enumeration: 1,1,255,rgba
    0,0: ( 0,255, 0,255) #00FF00 lime
    $ convert png:resistorImage.php.3[1x1+110+40] txt:
    # ImageMagick pixel enumeration: 1,1,255,rgba
    0,0: ( 0, 0,255,255) #0000FF blue
    $ convert png:resistorImage.php.3[1x1+150+40] txt:
    # ImageMagick pixel enumeration: 1,1,255,rgba

    So the outputs are nicely machine readable into RGB values.

    From there we have to match the RGB codes to the form, the form values resist1,2,3,4 are set to match the number shown in the slider. These don’t change so we can swipe them once and get the 0-9 values.

    Then we actually have to calculate the resistance and populate the hidden ohms and perc values using the code in the JS function getResistance().
    resist = parseInt(resist1 + resist2) * Math.pow(10, resist3);

    document.getElementById(‘ohms’).value = resist;
    document.getElementById(‘perc’).value = resist4;

    Now that we have resist1-4, ohms, and perc we can then fill in the standard WP form values and submit our post.

    I wonder how it can be made better. Maybe using an actual product image of a resistor, so take a catalouge image of a 47K Ohm resistor and then show that to the user. Rotation of the image and varying the angle or width of the bands.

    Its a neat and educational CAPTCHA. I had fun roughing out a script to get around it.

    D’oh! Write this whole post and forgot to actually do the CAPTCHA the first time!!

  77. Resistance is futile!

    For all those who are complaining about color blind. Just do it in reverse. Give a value and make people give the code. Problem solved!

    Blue Red Red / Gold / Red

    What is the value of that resister?

    Want to trip up the hackers. Change the order, or say don’t give the tolerance.

    Just a cute little hack. Oh and it IS a hack as it IS using the resister color coding for something other than giving you the value of the resister (i.e. granting access to a site).

    Bunch of cry babies! I swear, how did you ever reach adulthood.

  78. Test test…

  79. For those who are seriously concerned about the colorblind (guys, most likely), but still want to play with Resisty on their blog, may I suggest b/w pixel patterns and/or greyscale as an option. Otherwise, place DMM probes onto the resister leads and take a reading. ;)

  80. Awesome, I was just searching references for resistor color coding. Now I don’t have to compute by hand :P

  81. 33k 10% where to use them??

    may be it would be mor save against bots if you use real photos of resistors… you could rise a donation rus so every one submits resistor photos and you get a huge db

  82. testing

  83. This CAPTCHA is scary. I thought it was something super-complicated, having to do with electronics (which I never “got”), but you just have to match the slider on the color from the band.

    I’d hate to scare my users with a CAPTCHA like this.

  84. human by a 160KΩ resistor

  85. Nice captcha, I must test it :)

  86. uber g33ky – I love it! :)

  87. ohmsresistance

    Great Captcha ! Love it!

    Any chance you also made a widget out of it?

  88. Bas je sranje. hahaha.

  89. Had to try it. It’s fun!

  90. Dances With Bikers

    Great stuff! I like the way you think.

  91. Magical

  92. Great

  93. Haha nice

  94. testing

  95. OMG XD awesome :D

  96. Very clever!

  97. what if you are color blind or you have color problems on your monitor?
    I don’t like this idea at all

  98. @matt – bummer, it appears you did not read any of the comments here or look at the code. you can review the code, there’s colorblind option and colorblind commenters haven’t had any problems. aside from that, it might not be for you if you don’t like it – it’s for the people who like this sort of thing :)

  99. Clever idea :)

  100. Killer app for this: Mash it up with reCAPTCHA, as a tool to help people with giant boxes of unsorted resistors.

  101. I am colorblind of red green. I will see if it works for me too. If I fail it proves I am a computer. Good day sir.

  102. Testing this out lol.

  103. super easy to use!

  104. Ha!…Pretty brilliant though.

  105. This is the best thing ever! Well, the best thing I’ve seen in the past 10 minutes…. Love it.

  106. interesting!

  107. testo

  108. nice

  109. hehe… nice one! i like it. and helps me regaining my lost knowledge about resistor values ^^

  110. testing

  111. wow nice thing man

  112. i just want to test this new comment thing move along, nothing to see here.

    what about color blind people?

  113. @cyrus – please read any of the comments or look at the source code. there’s a color blind option and also, people who are color blind have commented here as you can see.

  114. I love it!

  115. n1

  116. This. Is. Genius!

    It would be super cool if there were other puzzles. Like an odd-one-out with, for example, two SMD components and one PTH, or two passives and a logic gate.

    Maybe even some simple math problems (like xkcd does on forum registrations, just more EE-themed) — “What’s the total resistance of an XYZ ohm resistor and an ABC ohm resistor in series?”

  117. cool!

  118. Yay I’m human!

  119. Awesome!

  120. GENIUS thing .)

  121. amazing!!!

  122. Wow, coooooooooo…l!

  123. Daniel W. Dugger

    This is amazing. Preventing spammers and helping people learn electronics at the same time.

  124. I need this for my dorkbot website!

  125. coool!!! xD

  126. another time xD

  127. Had to test it

  128. To all the comments about ‘bots solving it’, it is actually trivial to solve for a bot, don’t kid yourself that it isn’t.

    As for whether it would be worth their time, the question is self fulfilling.

    If this is shown to stop spam, more will use it, so it then becomes increasingly attractive to solve automatically, until it’s broken.

    I’d also point out that it’s not possible to use if you’re using a text reader and that it cannot be used on US governmental websites because it would violate disability grounds; it’s hard to use for someone who doesn’t have at least reasonable motor dexterity, and I’d also note that at least 10% of the US populace is considered to have a vision impairment.

    It’s not a bad idea, but over time it’s not entirely workable.

  129. great!

  130. nice Captcha!
    良いキャプッチャですね!

  131. Hmm, it would be trivial to circumvent this, how about getting a huge stack of photos of actual boards with components on them and ask people to identify value of “The resistor in the top-left corner” or “second from the right”.

    That would be *much* harder to crack.

  132. Good plugin!!!.

Sorry, the comment form is closed at this time.