A few weeks ago, our friends Catie and David gave us an electronic lab kit (about to get rid of it in a yard sale). The kit came with instructions and parts to build over 300 different electronics projects. We were ecstatic. Heather and I have been looking for something like this for some time. As a kid I had basic kits like the one we received. However they were much simpler. We ripped through the packaging and started playing around with some of the projects.
It took us a little while to put something together. One of the problems we kept running into was decoding the resistor values. Granted the theory is very simple. But it takes some time to get use to. We found some resistor calculators online. Most of them got the job done. The calculators we found, you submit the resistor codes and it returns the value of the resistor.
Since the instructions tell you the resistor value, it would be much easier to enter the value and get the resistor color codes. Then a light went off. Being a web application coding geek, I deiced to build my own calculator. That night I finished the basic functionality of the calculator. At that point the application allowed you to submit what the color bands are on the resistor. Then the script would reload the page with the resistance value.
This morning I finished the project by building the reverse method of calculating resistor color codes. Now you can enter the resistor value, and it returns the color bands in the order they appear on the resistor. Pretty easy huh? I used a pure PHP script (no java script, no ajax) on this project. I wanted a server side only approach. It wasn’t the easiest thing I’ve ever written. But I had fun doing it. You can check it out using the link below.
Subscribe









