Years ago, I bought packs of resistors. They were all in one bag. I put them in drawers and thats where they stayed. As time passed, they became a tanngled mess. It took hours to find the correct resistor needed.
It was time to do something about it. I don’t have a huge collection, so I didn’t need labeled drawers, I was more after a filing type system.
The first step was to create labels for the zip lock bags. Making them individually would be teadious so I put together a script to do it automatically.
The code can be found at https://github.com/jcroucher/resistor-code
- resistor.rb – The main file for generating the color codes based on the values passed in. It can be called by using
require_relative 'resistor' values = Array["1.5M","1M","4.7M","10K","1.2K","5.6K","10","68"] resistor = Resistor.new() resistor_list = Array[] values.each { | face_value | resistor_list.push(resistor.convertValue(face_value)) }
- generate-list.rb – File for generating a PDF with each resistor card for the pre-defined list. The list can be updated by modifing this line
values = Array["1.5M","1M","4.7M","10K","1.2K","5.6K","10","68"]
- template.erb – The template for the PDF with each resistor card
- tests.rb – Test code for making sure the return values are correct for a set of pre-defined values
Simple usage is to update the array of values in generate-list.rb
Make sure pdfkit is installed gem install pdfkit
Then run generate-list.rb
chmod a+x generate-list.rb
./generate-list.rb
You should now have a new file in the same directory resistor-list.pdf ready for printing and cutting.
Next is for the box itself. The STL file is located at http://www.thingiverse.com/thing:1980222
It is a simple print, but takes quite a long time, around 15 hours purely due to the size.
As you can see from the final print, I should have had mine slightly larger. Adjust accordingly to match the number of resistors you are storing.