Introduction: Cubecube: a Tangible CAD Interface.

Cubecube - an open-source hardware project - is a tangible, tactile interface for CAD (computer-aided design.) As open source design platforms continue to emerge, there is an opportunity to explore new possibilities in how we create. The Cubecube project aims to investigate the question: If there were a platform for using your hands to build three-dimensional computer models, what might it look like?

Essentially, I wanted to create a system that married one of my childhood passions - building tiny things with my hands - legos, constructs, etc - and my more recent obsession with creative coding and digital fabrication. So, this is a system that allows you to generate CAD geometry by stacking lego-like blocks!

Cubecube is open source. Source code for firmware and software, along with hardware designs and schematics, are available for free download on the internet. The current prototype is built completely around open-source creative platforms: its hardware is designed in Fritzing and connects with an Arduino Nano; its firmware is written in Arduino; its software is written in Processing. Full build instructions have been published on Instructables.com, which include step-by-step instructions with photos, a bill of materials, necessary files, and useful links to anyone interested in participating in this project.

Step 1: Concept and Design.

Picture of Concept and Design.

The system behind Cubecube is simple. Its building blocks each contain a tiny resistor, and as they are stacked in parallel over a voltage divider, a change in voltage can be read by a microcontroller. Four analog multiplexers break the Nano’s inputs out into 64 discrete channels. Each channel, arranged into an 8x8 grid, reads a changing voltage determined by the number of cubes in the stack. The current prototype supports up to 640 cubes.

The Cubecube firmware and software, written by Kavinath Laud, was built in Arduino and Processing. The Cubecube Processing app utilizes Marius Watz’s Modelbuilder libraries to facilitate export of STL (stereo lithograrphy) format files. This makes it easy to interface directly with any 3-D printer system, and allows a user to extend Cubecube’s functionality with third party CAD environments.

The back-end of Cubecube is versatile. While designed as a CAD interface, it can be modified for any number of hardware-interface projects or experiments. Because it is designed with accessibility in mind, Cubecube can easily be hacked, iterated, appropriated or otherwise repurposed. The open source framework it was built around gives anyone the tools to make Cubecube their own.

Cubecube makes creating simple 3-D computer models as simple as building with blocks. The simplicity of its front-end allows for anyone who can grasp and stack objects the ability to engage with digital fabrication methodologies, and the accessibility of its back-end provides a starting point for further experimentation in the realm of tactile CAD interfaces. Cubecube offers a different way of thinking about computer-aided design, and provides a strange but familiar platform for creating.

Step 2: Required Tools.

Before we get started, I'd just like to mention that as this project involves potentially dangerous tools, it is important to take appropriate safety measures (use a solder fan, wear safety glasses!) I'm safe. I'm set.

For this project, you will need:

- soldering iron ($22.00 from Adafruit, here)
- solder
- solder wick
- tweezers ($2.73 from Amazon, here)
- Small fillips-head screwdriver
- Jeweler's saw ($24.56 from inventables, here)
- M2 tap ($20.03 from Amazon, here)
- Computer capable of running latest version of Processing (see system requirements here)
- "Third hand" soldering stand ($6.00 from Adafruit, here)

Additionally, it may be helpful to own or have access to:

- 3D Printer (ideally with a .4mm or smaller diameter nozzle)
- Laser cutter
- Soldering Flux
- Sandpaper

If you don't have access to a 3D printer, you might consider ordering prints from an online service. See "Step 6: 3D Printed Parts" for more information.

Step 3: Bill of Materials.

Picture of Bill of Materials.

To build Cubecube, you'll first need to aquire the following materials and components:


Electrical (build plate):

- [x64] 1x2 Pin 0.1" Female Header ($0.05 from mdfly, here)
- [x3] 200 ohm 0603 SMD resistors ($0.10 from digikey, here)
- [x64] 499 ohm 0603 SMD resistors ($0.43 from digikey, here)
- [x1] Surface-mount RGB LED ($0.50 from Sparkfun, here)
- [x1] DC Barrel Power Jack ($0.95 from mdfly, here)
- [x1] Slide Switch ($0.75 from Sparkfun, here)
- [x4] SMD 16-Channel Analog Demultiplexer (from Digikey, here)
- [x1] SMD tactile switch ($0.75 from Digikey, here)
- [x1] 5v SMD voltage regulator ($0.74 from Mouser, here)
- [x1] SMD indicator LED ($0.46 from digikey, here)
- [x3] SMD 1x10 Pin 0.1" Female Header ($0.75 from Sparkfun, here)
- [x1] SMD 1uf capacitor ($0.46 from Digikey, here)
- [x1] SMD 10uf capacitor ($0.49 from Digikey, here)
- [x1] Arduino Nano (or compatible) micro controller board ($16.50 from Amazon, here)
- [x1] 12v 1A DC power supply ($5.20 from Amazon, here)
- [x1] Cubecube Circuit Board ($103.00 from Fritzing here - See 'Step 5: Fritzing Printed Circuit Board' for more info)


Electrical (Building Blocks):

- 2.2k Ohm 0603 SMD Resistor ($0.43 rom Digikey, here)
- 1x2 Pin 0.1" Female Header ($0.05 from mdfly, here)
- 1" Tall Female Stackable Header ($1.60 from hobbypartz, here)

Hardware/fastening:

- [x7] 16mm M2 standoffs ($4.69 from Ebay, here)
- [x7] M2 bolts ($4.80 from Amazon, here)
- [x4] adhesive-backed rubber feet ($2.79 from Amazon, here)

Building Materials:

- ABS plastic filament for printing components ($28.00 from Amazon, here)
- 3/16" Acrylic sheet ($5.99 from Inventables, here)
- Double-sided solder breadboard PCB ($5.12 from Amazon, here)

Printed/fabricated Components:

- [x1] Cubecube Array Plate

- [x1] Cubecube bottom base plate
- [x?] Cubecube building blocks (however many you wish to make!)

See 'Step 6: 3D Printed Parts' for more information on printed components.

Step 4: Files to Download.

All of the files for Cubecube (designs, schematics, code) are completely free and open source. You'll need them if you'd like to build a Cubecube! You can find links to everything you'll need below:

Cubecube circuit board (made in Fritzing):
http://fritzing.org/projects/cubecube-v01

Cubecube design files (to be 3D printed and/or laser cut):
http://www.thingiverse.com/thing:321759

Cubecube software and firmware (Processing Source Code):

https://github.com/alter3go/Cubecube/releases/tag/v0.1


Step 5: Fritzing Printed Circuit Board

Picture of Fritzing Printed Circuit Board

Cubecube was designed in Fritzing, a free and easy-to-use PCB editor. In addition to allowing you to output SVG and Gerber files to fabricate your own boards, Fritzing offers a PCB fabrication service.

While I make a lot of my own prototype PCBs, this one would be tricky as it has very tiny traces and incredibly small vias. So the best route for me was to simply order a board.

The board costs around $100.00 and ships from Germany. It is high quality and arrived in excellent condition in just over a week from the time I placed the order.

To order, simply follow this link:
http://fritzing.org/projects/cubecube-v01

And click on the "Fabricate This..." option. Fritzing will take you through the rest!

From there you can also download the Fritzing design file, in the event you'd like to check it or modify the design!

Step 6: 3D Printed Parts.

Picture of 3D Printed Parts.

Cubecube is comprised partly of 3D printed parts. These include the array plate (the plate you build upon), the bottom base (though in this build I use a laser cut part for this), and the cubes themselves (the Cubecube building blocks.)

I printed these parts on an Up! 3D printer, as well as on a homebrew Prusa i3 reprap printer. You'll want to make sure your using a .4mm diameter nozzle, as anything larger will most likely fail to yield the resolution you'll need for these tiny parts.

Alternatively, if you do not own or have access to a 3D printer, I suggest trying out a 3D printing service like Shapeways or Ponoko. These services allow you to upload a 3D model, and for a fee it will be printed and shipped to you.

All of the designs and STL files for these parts can be found on thingiverse:

http://www.thingiverse.com/thing:321759

Step 7: Soldering SMD Components.

Most of the electrical components in this build are a surface mount (SMD) package. That means they are tiny, and often tricky to solder. I highly recommend watching this video from Fritzing, where they go over in detail tips and techniques on soldering these tiny and intricate circuits. This video taught me everything I know about SMD soldering... and the host has an awesome German accent to boot.

SMD soldering takes a bit of practice, especially with the really small components, but is definitely something I notice I keep getting better at!

Step 8: The Voltage Regulator Circuit.

Picture of The Voltage Regulator Circuit.

The first step of populating the Cubecube circuit board is the voltage regulator circuit.

I started by soldering the slider switch, barrel jack and regulator, then added the capacitors. Take care to make sure the caps are properly placed and oriented, like in the photo here!

For the most part, Cubecube can run directly from the USB port on my laptop. The external power supply is an extra precaution (that I highly recommend) to keep the system from hogging too much of your computer's precious USB power.

The regulator circuit consists of a surface-mount 5v regulator chip, and two electrolytic filtering capacitors (these keep electrical noise around the analog circuitry to a minimum!) A DC barrel jack connects to the power supply (I recommend a 6-9v supply - the one I mention in the Bill of Materials works great!) and the slide switch opens and closes the external power circuit.

Step 9: Tacticle Switch and Indicator LEDs.

Picture of Tacticle Switch and Indicator LEDs.

Next up: soldering the indicator LED and the (very minimal) button interface.

The indicator LED just confirms that the board is getting power. The RGB led and tactile button are for additional functionality that will be added later as the Cubecube project develops (for example, to toggle different "types" of blocks).

Step 10: Arduino Nano + Headers.

Picture of Arduino Nano + Headers.

'Making' the headers:

It was tricky to source SMD female headers in the right configuration for the arduino Nano, so I made my own!

I purchased 10-position headers from Sparkfun (see Bill of Materials) and cut them with a Jeweler's saw.

Be sure to cut slowly - it will help you stay steady and means less time trying to clean up your cuts with sandpaper.

Soldering the headers:

Once your headers are cut, and you've made sure they line up properly with the pads labeled "MICRO" on the cubecube board, you are ready to solder.

With the female headers pushed onto the male headers on the Nano, place the Nano over the correct pads on the Cubecube board (see image).

Solder the outside leads, then (carefully) remove the Arduino Nano from the female headers so you can solder the inside traces. When all is soldered, relplace the Arduino, and you're ready to move on!

Step 11: Quick Test Run...

At this point a good portion of the board is complete and you are ready for a test run. Follow the video here. If the indicators on the Cubecube board or the Arduino Nano don't light up, check your solders joints and make sure you didnt forget to solder any leads!

Step 12: Analog Mux Chips

Picture of Analog Mux Chips

To break the Arduino Nano's pins out to 64 analog inputs, I used four 16-channel surface-mount multiplexor/demultiplexor chips (often referred to as a "mux" or "demux".)

Buildr has a great writeup about these chips - this is where I began my experimentation with them! I highly recommend it:

http://bildr.org/2011/02/cd74hc4067-arduino/

These can be very tricky to solder, so I recommend following along slowly with the Fritzing video from 'Step 7: Soldering SMD Components'.

Step 13: Voltage Divider Resistors.

Picture of Voltage Divider Resistors.

This is where the magic happens on the Cubecube board. These resistors create a voltage divider between the blocks and the analog inputs on the Cubecube array. That means that by stacking blocks, which basically add resistors in parallel to the divider, we can read a change in voltage to the analog input. Cubecube takes that information, and maps to to display a changing number of blocks on the computer! Simple, yet precise.

Each spot on the grid needs its own 499 ohm resistor, so you've got 64 of these to solder! By the time you're done you'll be a SMD-soldering pro.

Step 14: Assembling and Soldering the Cubecube Array.

The Cubecube 'array' is very simple to construct. After printing the array plate, simple populate it by inserting the *regular length* two-position female headers into the slots of the plate. See the video here for more information.

Once populated, the leds of the female headers will align perfectly with the holes in the Cubecube circuit board. Simply pop them through and solder!

Step 15: Cubecube Platform: Final Assembly.

Picture of Cubecube Platform: Final Assembly.

We're almost done with the Cubecube platform! It's time for finishing touches. You'll need: The bottom plate, your 16mm m2 standoffs, an m2 tap and some rubber feet.

First, thread the 7 holes in the base plate with your m2 tap.

Next, screw the standoffs' "bolt" sides into each hole.

The Cubecube PCB should perch nicely atop the standoffs. Mount in in place with your m2 bolts.

The last (and my favorite) step is adding your adhesive-backed rubber feet!

Your Cubecube platform is complete! Only thing left now is to make some cubes...

Step 16: Building Cubecubes.

Picture of Building Cubecubes.

The cubes are tricky, but something you'll get quite good at after making the first handful.

Creating the header:

I was unable to source a two-position stacking female header, so I again decided to make my own.

I instead bought 10-position stacking female headers and two-position "regular" female headers (see Bill of Materials). I simply removed the legs from each using a pliers, and swapped them!

This might seem like a waste - but if you take the time to put the unused legs back into the unused housings, you'll have some spare 10-position "regular" female headers for a future project.

Creating the tiny PCB

Next you'll need to cut a tiny little two-position PCB from your double-sided solder bread board (See Bill of Materials.) I used a Jeweler's saw to cut them apart - they saw through PCB like butter.

Soldering and assembling the cube:

Once the PCB is cut and placed on the female header's legs, you're ready to solder the 2.2k ohm resistors between the leads. I found it is actually easiest to solder the sides of the resistor along with the sides of the header. See the video here for a walk-through.

Step 17: Arduino Firmware.

Picture of Arduino Firmware.

The firmware for Cubecube was written in - and runs on - Arduino, an open-source hardware platform and framework of libraries for creative coding (see http://arduino.cc for more information).

The arduino software is pretty straight forward - just plug in your Arduino Nano, open the file titled "cubecube_firmware" (from the cubecube_arduino.zip) in Arduino, and upload.

If it uploaded properly the RGB led should hold a steady RED.

Step 18: Processing Software.

Picture of Processing Software.

The software for Cubecube was written in Processing, an open-source hardware platform and framework of libraries for creative coding (see http://www.processing.org/ for more information).

The processing software uses Marius Wattz' "Modelbuilder" library, so be sure to move it into your processing library directory.

The only other step you'll need to take is to change the port number at the beginning of the processing sketch to the correct number (this will depend on the number of serial devices connected to your machine.) Mine was port 0.

With those two things checked, you're ready to run Cubecube!

Step 19: Output.

To output an STL file, simply press the space bar at any time while the Cubecube Processing sketch is running. A file named "output.stl" will be generated in the Cubecube software's sketch folder.

Watch the video in this step for more information on outputting from Cubecube and extending it's functionality with 3D printers and 3rd party modeling environments!

Step 20: Demonstration!

Picture of Demonstration!

I always loved building with Legos, and I've more recently found a passion for CAD. I couldnt have guessed how fun it would be to combine the two...

This project is still very much in progress... And I sincerely invite anyone interested to iterate, add to, and/or improve this design!

For more information, visit http://cubecu.be

Thanks for reading, and please vote for this instructable!

Comments

JON-A-TRON (author)2015-03-31

This is brilliant. I can't think of a better way to teach 3D modeling.

skearney (author)2014-05-08

Functionally, I wonder if you could have color-coded cubes that correspond to user-definable parts, i.e. PVC pipes; If each block had input/output on all six sides that could be really interesting (not that it isn't).

Bryan Cera (author)skearney2014-05-08

Yes! Assignable cubes would be too cool. And definitely, six-sided connections would be a huge improvement. Unfortunately this is tricky - maybe impossible - to accomplish using the voltage divider approach. The cubes may need to have more sophisticated electronics to communicate that kind of data. Any ideas? :)

samurai1200 (author)Bryan Cera2014-05-08

Well, your system would have to mechanically grow a bunch to accomodate the higher complexity electronics, but the first thing that comes to mind is a daisy-chained communications system (as opposed to a standard parallel system like SPI or I2C). This way, a device is addressed (to determine stack height) via its position in the daisy chain. Each voxel/cubelet/whatever could then be fully customizable with respect to its virtual representation.

Might be a simpler way to do this, but this is the first thing I thought of.

Bryan Cera (author)samurai12002014-05-08

@Samurai my thoughts exactly. Any insight on what sort of chip might do this? I've heard of old computer networks working like this...

samurai1200 (author)Bryan Cera2014-05-12

I made a cursory glance at google when I was writing that but didnt find anything that specific for cheap (for instance, daisy chain communication is common in battery pack management ICs, but are large, expensive, and would have too much unused functionality).
The obvious answer here is to choose a small, cheap microcontroller with something like two of the same peripheral (like two separate spi ports): one would face the previous block and one would face the next block. Then you write a little bit of management code to concatenate or strip messages traveling from one peripheral to the next. I think this functionality could be had for less than a dollar w.r.t. the microcontroller.

Bryan Cera (author)samurai12002014-05-12

I wonder if I can get that sort of functionality out of an ATTINY? With a soft serial library for comm. I'll have to play around with this over the summer!

samurai1200 (author)Bryan Cera2014-05-12

Possibly. The tricky part is having 2 identical comm peripherals that can be configured physically (e.g. by jumpers when you plug into a cube/have a cube plugged into you) and are on separate pins. For that reason soft serial is your best bet for minimizing cost per cube.

rtudeschini (author)Bryan Cera2014-05-08

Maybe you can get this sort of distinguishing by using different values of resistor for each color. The trick could be the use of prime numbers roots, to make unique combinations.

Bryan Cera (author)rtudeschini2014-05-08

Ah, If only stacking resistors in parallel yielded a linear progression! Even still, there would be the issue of sensing the order of "different" block types in a stack... though Kavi and I are currently working on a way of tracking that in software. Really good thought though, I might have to play with this.

tiorbinist (author)Bryan Cera2014-05-09

The easy solution is to add a simple switch in each block with a projection in the bottom of the next block up to break it. Then, in each block, one contact connects to the resistor, the other side of which is connected to the contact receptacle for the next block up, and the switch. The other side of the switch is connected to the return contact for the block below and the receptacle for the block above.

Plug the first block in: the switch is closed, so current flows into the resistor, through the switch to the return contact, one resistor, in series.

Plug in the second block: the projection breaks the switch in the block below. Current flows into the resistor in the bottom block, through the connection to the receptacle to the block above (and not through the switch, which is open) where it continues to flow through the resistor. That switch is closed, so the current continues to the return contact, through the return contact in the block below, and on to the return terminal of the measuring loop: two resistors in series.

If you mistrust the mechanical switch/projection, substitute a magnet for the projection and use a very small reed switch (NC, opens in Magnetic field) in the bottom of each block.

This allows a couple of resistor schemes, and doesn't rely on prime resistor values:

1) stick to the E tables. Chose a tolerance that your measuring system can differentiate without question. (Consider E6 for a simple example: these are 20% resistors, 100ohm, 120ohm, 130, 150, 160 etc. check the tables and info at http://logwell.com/tech/components/resistor_values...). E tables are designed to provide a standard value within the tolerance range on either side of any standard value, covering the entire range. So skip every other value, and you have a "guard band" between possible values. Now, assign one type/color/size/value whatever, to each value.

Since you can constantly read the stacks faster than anyone can add blocks, you can tell which block is added next: this requires that the user not pre-stack blocks.

2) Choose resistance values based on their tolerance, and your ability to turn the decimal digits within the tolerance into binary numbers. For 1% resistors, you can count on fifty values which fit within seven bits. Organize them based on leading digit into 7 classes, with increasing numbers of sub-class. For instance, if you have only one interconnect (pipe, wire, etc) assign that 1. Use 2 (which will only have one, because of the need to skip values for the 1% tolerance) assign another singular value, maybe ground? Power to 4 (plus and minus), semiconductor type to 8 (BJT, JFET, diode, 3-terminal regulator), capacitor to 16, resistor to 32, connector type to 64 (decreasing number of choices because you can't count to 127 and you're still throwing away every other resistance value). Probably a weak example, but with well-chosen values, you could make a radio!

Anyway, once you have the ability to stack resistors and ensure a return path without forcing an additional capping piece to keep track of, the rest is pretty much your own choice of encoding.

tiorbinist (author)tiorbinist2014-05-09

Clarification of last paragraph:

Once you have the ability to maintain a series connection of a continuously-increasing stack of resistors...

jwflammer (author)2014-05-10

Very Cool Project! If you could incorporate other shapes, that would extend the functionality and creativity. Try using an open source CAD programme like QCAD instead of Processing, the way you have presented this Instructable is very nice. Throw this on KickStarter, its totally worth it! I would love to pay and play with your prototype soon :)

l19bal (author)2014-05-10

Absolutely brilliant I love the way it works! Keep up the good work! :)

repkid (author)2014-05-10

Awesome project, I love it.

francisroan (author)2014-05-09

one of the most coolest innovative stuff I have ever seen... heads up. and BTW try it on kick starter.. along side with a 3d printer... it'll be sweet.

marty605 (author)2014-05-09

Awesome work Bryan! How about a Lincoln Log edition?

DoxxRoxx (author)2014-05-07

Dude!

You need to hook up with Minecraft publisher Mojang straightaway! I see some serious potential to implement your design into a physical based building platform to enhance Minecraft gameplay. Think Skylanders for Minecraft. Wow, my mind has been blown!

Nice job.


Bryan Cera (author)DoxxRoxx2014-05-07

My nephew is obsessed with Minecraft... I am hoping to do some user testing with him soon!

2bigbros (author)Bryan Cera2014-05-08

I may just make one and do some Minecraft mods with some friends to work with this. Great project I love it!!! Defiantly voted for you. Good luck on the contest.

PC-GUY (author)2014-05-08

good job. i wish i had your skills.

adamw ROX OUT LOUD (author)2014-05-08

Oh my God. This is the future. I'm not even kidding.

caltemus (author)2014-05-08

Imagine integrating this into legos, with molded in resistors that could work with one of the lego cad programs out there.

metrowave (author)2014-05-08

This is very clever and original. Well done!

Honus (author)2014-05-07

Wow- what an incredibly cool project!

critopadolf (author)2014-05-07

Exactly! If you did this for mine craft you would need pieces that act as different mine craft blocks, you could even make them look like the blocks themselves

Bryan Cera (author)critopadolf2014-05-07

Love your idea. 'Cubecube: Minecraft edition' has a nice ring to it!

critopadolf (author)2014-05-06

Awesome! Is it possible to do this with legos? And could you modify pieces so the cad software knows not to include them so you can have gaps in the 3D models?

ffcabral (author)critopadolf2014-05-07

Yeah, that's a great idea. Like, "black" pieces that when set, the software treats it as a hollow but will respect the space.

Bryan Cera (author)ffcabral2014-05-07

Agreed! Great idea. I am hoping, in the future, to add a feature that allows one to toggle through different block "types" - including your suggestion of the 'hollow' one. I included an extra button switch and LED on the board for stuff, like this, that can be developed down the line...

Jan_Henrik (author)2014-05-06

Very Nice!

versos-tk (author)2014-05-06

very clever, hat raised.

About This Instructable

36,909views

350favorites

License:

Bio: I love making stuff! Especially when it involves hacking electronics, DIY software and hardware, and digital fabrication. For more info about me check out my ... More »
More by Bryan Cera:PaperSynth: an 8-bit Synthesizer Made Out of Paper and Copper FoilCubecube: A Tangible CAD Interface.Making 'Glove One' - a 3D-printed, wearable cell phone.
Add instructable to: