Update: a much more thorough explanation of this project is available from Make Magazine. It might be easier to follow their instructions, and I think their code is more up to date.
The basic goal here was to make a 3D hand-position sensing system that most people can build, while still preserving some semblance of functionality. To get an idea of possible applications, check out the demo video. If you think you can build one that is simpler and equally accurate, or slightly more complex and more accurate, share in the comments!
DIY 3D Interface: Tic Tac Toe from Kyle McDonald on Vimeo.
Remove these ads by
Signing UpStep 1: Materials
Tools
- Arduino
- Processing
- Wire cutters
- Soldering iron
- Box cutter
Materials
- (3) 270k resistors
- (3) 10k resistors
- Solder
- Wire
- Aluminum foil
- Cardboard
- Tape (e.g.: scotch)
- Shielded wire (e.g.: coaxial cable, ~3')
- (3) alligator clips
- 3-pin header
- Zip-tie
- Shrink wrap tubing or hot glue













































Visit Our Store »
Go Pro Today »




I did everything, but the box is not moving. what’s the problem??
Can you help me please??
I made 220K ohm by two 100k series with two 10k ( behind each other) … do you think this is the problem?
I'm trying to make this work, and it isn't working.
I loaded the code to arduino, and i load the processing code and run it, and all i get is a blank white screen. Please tell me what im doing wrong!
#define resolution 8
#define mains 50 // 60: north america, japan; 50: most other places
#define refresh 2 * 1000000 / mains
void setup() {
Serial.begin(115200);
// unused pins are fairly insignificant,
// but pulled low to reduce unknown variables
for(int i = 2; i < 14; i++) {
pinMode(i, OUTPUT);
digitalWrite(i, LOW);
}
for(int i = 8; i < 11; i++)
pinMode(i, INPUT);
startTimer();
}
void loop() {
Serial.print(time(8, B00000001), DEC);
Serial.print(" ");
Serial.print(time(9, B00000010), DEC);
Serial.print(" ");
Serial.println(time(10, B00000100), DEC);
}
long time(int pin, byte mask) {
unsigned long count = 0, total = 0;
while(checkTimer() < refresh) {
// pinMode is about 6 times slower than assigning
// DDRB directly, but that pause is important
pinMode(pin, OUTPUT);
PORTB = 0;
pinMode(pin, INPUT);
while((PINB & mask) == 0)
count++;
total++;
}
startTimer();
return (count << resolution) / total;
}
extern volatile unsigned long timer0_overflow_count;
void startTimer() {
timer0_overflow_count = 0;
TCNT0 = 0;
}
unsigned long checkTimer() {
return ((timer0_overflow_count << 8) + TCNT0) << 2;
}
serial = new Serial(this, Serial.list()[serialPort], 115200);
Please help =) thank you!!
at TicTacToe3D.setup(TicTacToe3D.java:57)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)
this is what it said at the bottom of the processing
I installed processing and arduino software. I upload sketch to arduino and copied Tic Tac Toe 3D to sketch folder in processing. I'm running processing and I can see window with dimensions of 7x7cm, however I don't see any any points inside the square and I'm not sure how to initialize it. Could you pls help me out? Am I missing something? Thanks a lot for any help!
its exactly the same
I have
[0] "/dev/tty.usbmodemfa131"
[1] "/dev/cu.usbmodemfa131"
[2] "/dev/tty.Bluetooth-PDA-Sync"
[3] "/dev/cu.Bluetooth-PDA-Sync"
[4] "/dev/tty.Bluetooth-Modem"
[5] "/dev/cu.Bluetooth-Modem"
from Processing.
I upload to /dev/tty.usbmodemfa131 in Arduino successfully and get good numbers out of the serial monitor there.
When I use a [0] variable for the serial port in Processing however, I get a lot of interference on the serial monitor - not gobbledygook, just weird strings of numbers if varying lengths. I just see the grey cube and nothing else happens.
When I use a [1] variable i get the following error:
RXTX Warning: Removing stale lock file. /var/lock/LK.012.018.043
gnu.io.PortInUseException: Unknown Application
and lots more.
Am I doing anything wrong?
Nice work!
I have some problems with the step 5:
I have a _3Dinterface.ino loaded in my arduino
Here if I open my serial monitor I only can see letters running
Then I open Processing program and then I open the TicTacToe3D.pde and the other 2 opens automatically. then I export my application and this creates an application with the name TicTacToe3D, when I open the app I can only see a grey screen with anything.
I'm using a Macbook pro with Mountain Lion
Can you help me please?
Thank you very much!
that's a really great example, thanks a lot!
I am trying to control 2 such controllers from one arduino, I changed interface3D.ino by adding to void loop() 3 additional lines (without really understanding, what they mean). Serial monitor now shows 5 parameteres, but the sixth one not. What does that binary number means and how could I make it work with 6 plates?
Here is the code:
void setup() {
Serial.begin(115200);
for(int i = 2; i < 14; i++) {
pinMode(i, OUTPUT);
digitalWrite(i, LOW);
}
for(int i = 8; i < 14; i++)
pinMode(i, INPUT);
startTimer();
}
void loop() {
Serial.print(time(8, B00000001), DEC);
Serial.print(" ");
Serial.print(time(9, B00000010), DEC);
Serial.print(" ");
Serial.print(time(10, B00000100), DEC);
Serial.print(" ");
Serial.print(time(11, B00001000), DEC);
Serial.print(" ");
Serial.print(time(12, B00010000), DEC);
Serial.print(" ");
Serial.println(time(13, B00100000), DEC);
}
Thanks for your answer!
it will be very kind from you if you respond me actually i have done all steps thanks god and i upload the code to arduino and i am now in calibarating step i try more than one time but no response it this may be because of iam using small aliigator clips= less contact area ???
the contact area between the clips and the plates shouldn't matter. they just need to be touching.
you might want to also check this tutorial, which is for the same system but rewritten more clearly http://makeprojects.com/Project/A-Touchless-3D-Tracking-Interface/2233
serial = new Serial(this, Serial.list()[serialPort], 115200);
Has anyone solved this yet?
If you were getting that error from the serial line, you have to make sure that the serial variable at the top is the correct serial port. If you look above the error, it should show the serial port that you are using. Mine was com4 so it showed:
[0] "COM4"
Therefore in my situation I had to change the serial variable to 0.
I also got that error randomly sometimes when I would run the program. I think that came from the board sending data before the program starts receiving it and then the program starting halfway through a line. To fix this I just made sure to hit the reset button at the same time I hit run on the processing code and it solved my problem.
Hope that helped :)
WARNING: RXTX Version mismatch
Jar version = RXTX-2.2pre1
native lib Version = RXTX-2.2pre2
[0] "COM3"
Does anyone know how to fix the RXTX Version mismatch ???