
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!
Adafruit publishes a wide range of writing and video content, including interviews and reporting on the maker market and the wider technology world. Our standards page is intended as a guide to best practices that Adafruit uses, as well as an outline of the ethical standards Adafruit aspires to. While Adafruit is not an independent journalistic institution, Adafruit strives to be a fair, informative, and positive voice within the community – check it out here: adafruit.com/editorialstandards

Adafruit is on Mastodon, join in! adafruit.com/mastodon
Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.
Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7:30pm ET! To join, head over to YouTube and check out the show’s live chat and our Discord!
Join us every Wednesday night at 8pm ET for Ask an Engineer!
Join over 38,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord
CircuitPython – The easiest way to program microcontrollers – CircuitPython.org
New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — New Products 9/25/2024 Feat. Adafruit I2S MEMS Microphone Breakout – ICS-43434
Python for Microcontrollers – Adafruit Daily — Python on Microcontrollers Newsletter: Adafruit Grand Opening, Profile MicroPython Memory and More! #CircuitPython #Python #micropython @ThePSF @Raspberry_Pi — Classic editor
EYE on NPI – Adafruit Daily — EYE on NPI Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey
Adafruit IoT Monthly — IoT Vulnerability Disclosure, Decorative Dorm Lights, and more!
Maker Business – Adafruit Daily — A look at Boeing’s supply chain and manufacturing process
Electronics – Adafruit Daily — When do I use X1?
Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at
AdafruitDaily.com !
Sorry, the comment form is closed at this time.
“As a serious CAPTCHA I believe you
@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
likelynot be for you 🙂AWESOME! needs to be one for PHP BB as well 😛
@Opiboble – we’re going to do one for php BB later, once we work out any bugs with this one and use for awhile.
@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.
@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.
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.
I think this captcha is amazing!
testing quickie update!
Better yet would be to have it only have the resistor and you have to type in the correct response. or vise versea
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%.
This is a great idea!
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.
@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.
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.
@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.
Think of the colorblind.
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.
heh, more hurdles to go through just to add my two cents.
not worth the effort for me.
i’m posting a comment just use the slider.
This is totally worth writing a comment for (not that one actually needs to submit…).
Now this looks like an interesting idea 😀
Color blind for 47 years. No problems here.
Nice job 😀
awesome. just awesome
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[1×1+45+40] txt:
convert png:resistorImage.php.3[1×1+80+40] txt:
convert png:resistorImage.php.3[1×1+110+40] txt:
convert png:resistorImage.php.3[1×1+150+40] txt:
That spits out the correct RGB codes like so:
$ convert png:resistorImage.php.3[1×1+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[1×1+80+40] txt:
# ImageMagick pixel enumeration: 1,1,255,rgba
0,0: ( 0,255, 0,255) #00FF00 lime
$ convert png:resistorImage.php.3[1×1+110+40] txt:
# ImageMagick pixel enumeration: 1,1,255,rgba
0,0: ( 0, 0,255,255) #0000FF blue
$ convert png:resistorImage.php.3[1×1+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!!
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.
Test test…
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. 😉
Awesome, I was just searching references for resistor color coding. Now I don’t have to compute by hand 😛
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
testing
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.
human by a 160KΩ resistor
Nice captcha, I must test it 🙂
uber g33ky – I love it! 🙂
Great Captcha ! Love it!
Any chance you also made a widget out of it?
Bas je sranje. hahaha.
Had to try it. It’s fun!
Great stuff! I like the way you think.
Magical
Great
Haha nice
testing
OMG XD awesome 😀
Very clever!
what if you are color blind or you have color problems on your monitor?
I don’t like this idea at all
@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 🙂
Clever idea 🙂
Killer app for this: Mash it up with reCAPTCHA, as a tool to help people with giant boxes of unsorted resistors.