posts tagged with the keyword ‘openscad’



I recently prototyped a device to read cards (physical cards with printing on them) for a project. I used five SparkFun Digital Line Sensor Breakout Boards attached to a 3D printed mount and wired up to an Arduino.

Card and Sensors

The cards have five blocks at the bottom, which are either black or white, representing 1 or 0. Using ones and zeroes allows us to create a binary encoding scheme, so with five positions we use 1, 2, 4, 8, 16 for the values and can represent any number from 1 to 31.

Sensor Mount

I started by grabbing the image of the sensors from the SparkFun product page and dropping them into Inkscape (sized appropriately) so I could design the barcode part of the card, and so I could design the mount for the sensors.

Sensor Mount

Once I had a 2D design in Inkscape I exported it as a DXF file and used the linear_extrude command in OpenSCAD to create a 3mm tall plate, and then added another plate. It wasn’t perfect, but it was fast. I started the 3D printer while I got to work soldering…



Sensors all soldered up, mounted to the plate with 3mm screws, and wired to an Arduino via a breadboard. All of this is still prototyping stage. It doesn’t look pretty, but it worked and it was enough to test things out and do a demo.

Cards with Barcodes

Here’s an example of some card templates. Can you determine what number is being passed by reading it in binary? Since we’ve got 5 positions we can have 31 different cards… If you needed 63 cards, you would need 6 positions (and one more sensor.) 127 cards? That would be 7 positions and two more sensors. Any more than that and you might consider using the SparkFun Line Follower Array which has 8 sensors on a single board.

Card and Sensors

The total time to create this prototype was just a few hours from starting a design in Inkscape to 3D printing a piece, soldering up and mounting the sensors, and writing the code. (I also wrote a simple Processing application which read the serial output from the Arduino to display the card data on screen.)



Typically when I model 3D object with OpenSCAD I tend to create things that are simple and functional, but I had to create a piece that had some extra decoration to it, and wow did it slow OpenSCAD to a crawl!

I know about the special variable $fn, but I didn’t know about $fa and $fs, so I’ll have to start using those as well to see if they can speed things up. (I usually use $fn to go between “low res” and “high res” when it comes to rendering.)

OpenSCAD probably isn’t the easiest modeling software to use (unless you like writing code) but I like the fact that it’s open source, gets updated fairly often, is parametric, has lots of great info on using it, and there are a ton of free libraries for doing interesting things.

I was using Rhino quite a bit earlier this year, and while the Mac OS X version is now ready, it’s $300 for a limited time, and $500 after that, and is somewhat crippled compared to the Windows version. It can do some amazing things, so I’m still contemplating a license for it… Or I may find something else (open source, perhaps?) that fits the bill.

(I’ll probably be post more about 3D software in the near future.. Stay Tuned!)


Button Guard

While plenty of people tend to print baubles and trinkets with 3D printers, I tend to focus on solving problems by designing and printing usable things. A few weeks ago I designed these Lenovo IdeaCentre Power Brick Mounts and this week I created some button guards.

Button Guard

I was working on an audio player at the museum and Kathy mentioned that it was too easy to lean back and hit your head on a button which would either restart your book, or start another book, so I made this simple guard to put on the buttons before screwing them into place. Luckily we had filament that matched the color of the enclosure, so it looks pretty good.

Button Guard

If you’re using any of these buttons and need a guard, check out Thingiverse or Youmagine. The OpenSCAD code is fairly simple, so it should be possible to modify it for other buttons if needed.



A few years ago I mentioned Rahulbotics’ BoxMaker, and I’ve used it plenty over the years when I needed to laser cut an enclosure, but when someone has a good idea, eventually someone else decides to implement their own version. (This is good!)

One of the other box making sites I’ve used recently is MakerCase, which has a few more features than Rahulbotics does, including a choice of edge joints, specifically t-slot, which lets you create cases that can be assembled with nuts and bolts, though the choice of nut & bolt sizes are a bit limiting. Still, it’s a good effort, and I use MakerCase quite often.

make-a-box is another one I’ve taken for a spin. It didn’t offer much in the way of special features, except for the fact that all the Ruby code is in github ready to be forked. (Of course if you prefer Java, look at Rahulbotics’ BoxMaker code instead. Or, check some of the other boxmaker code.)

If you’re looking for non-web-based solutions, supposedly 123D Make has a beta out with finger joints. But it’s been nearly a year and I still don’t see that option in the software. I’ve also tried this BoxMaker for Inkscape, but it just gives me errors and fails to work.

I’ve long wanted a box maker for OpenSCAD, and I did find Parametric box maker for lasercut on Thingiverse, and it’s definitely something worth playing with, though on my creaky old laptop it’s not speed demon. Still, I really like the idea of code I can download and run rather than relying on a web site to generate a box.

I’ll continue to explore box making options that work well with laser cutter and other CNC machines, but if I’ve missed an option you know about, please let me know!


Wheel 1-Up

We’re planning a Nerdy Derby event at Maker Faire Milwaukee, and like last year, I wanted to 3D print a bunch of wheels, and yes, it is fun designing strange wheels. Most of my designs this year are refinements from last year, and I wish 3D printing were as simple as hitting “print” and walking away, but that’s not always the case.

Wheels 4-Up

I found that if I printed one object, it worked fine. If I tried multiple objects, things were failing, either with one or more objects, or everything. I’d try to print two wheels at once, and one would work, the other would fail. Slic3r allows you to generate the G-Code needed to print files, and has an option to print multiple objects, either by printing them all at once, or one at a time. Both of those options just weren’t working for me, for whatever reason. (My 3D printer is a RepRap I built myself, and yes, it has issues now and then.)

But you know the old saying… if you can’t fix it in hardware, fix it in software! So I did… You’ll notice that the image above shows four wheels with a small square connecting them. I ended up pulling an STL file into OpenSCAD (my favorite 3D modeling application) and then duplicating it four times and adding a small 1mm tall square between them to connect it all into what the printer would see as one single object.

Wheels Printed 4-Up

It worked! I’m now seeing much more success with printing, and getting sets of 4 wheels connected with a thin piece of plastic that’s easy to remove. Oh, I should also mention that our friends at Inventables were kind enough to donate some filament to this cause, so if you have fun building a car with 3D printed wheels at Maker Faire, be sure to stop by the Inventables booth and thank them for making it happen.

(BTW, MegaMag is printing way more wheels than I am, and going 40-Up!)

« Older Entries |

buy the button:

Buy The Button

top recent artists: