Make: Projects

A Touchless 3D Tracking Interface

Create a 3D computer interface using little more than an Arduino, six resistors, and some aluminum foil!

Steps

Step #1: Making the sensor cube.

PrevNext
A Touchless 3D Tracking InterfaceA Touchless 3D Tracking InterfaceA Touchless 3D Tracking InterfaceA Touchless 3D Tracking Interface
  • For this project we'll need some cardboard squares (mine are approximately 12" square, but anything from about 8-12" is fine), alligator clips, an Arduino, shielded wire, aluminum foil, spray glue, and some wide tape. (3) 10KΩ and (3) 220KΩ resistors are also required (not shown).
  • Additionally, we'll need a soldering iron to connect the resistors to the cable.
  • Spray the glue onto the cardboard and smooth the foil onto one side. Work slowly and try to leave a small gap around the edge of the foil. It is important that the foil plates do not touch each other when we tape the three sides together. In a pinch you can use a glue stick.
  • I cut a small notch in the inside edge of the rightmost plate to make it easier to connect the alligator clips later on (see second photo).
  • Using tape, assemble the plates to form one half of a cube (see the third photo).

Step #2: Prepare the wires.

PrevNext
A Touchless 3D Tracking InterfaceA Touchless 3D Tracking InterfaceA Touchless 3D Tracking InterfaceA Touchless 3D Tracking Interface
  • Next we need to prepare the wiring. I bought a 6' shielded audio cable for this. It is important to use shielded wire so that the cable itself doesn't act as an antenna and skew the sensor readings.
  • Cut the wire into 3 pieces of equal length (2' or so) and strip off the outer and inner insulation (second photo).
  • On one end, trim off the shielding wire and connect just the inner signal wire to an alligator clip (third photo).

Step #3: Adding the resistors.

PrevNext
A Touchless 3D Tracking InterfaceA Touchless 3D Tracking InterfaceA Touchless 3D Tracking InterfaceA Touchless 3D Tracking Interface
  • On the other non-alligator end of the cables, twist together the 3 shield wires and solder them. The shield will be connected to the 5V pin on the Arduino. This will minimize the antenna effect of the cable on the circuit.
  • Referring to the schematic, connect the resistors to the three inner wires of the cables as shown and connect this to the ends of the three wires. The 220KΩ resistors all connect between the inner wire of the cable and 5V. The 10KΩ resistors will each be connected between the end of the cable and a pin on the Arduino. The circled area indicates that this wire should be shielded, with the shield connected to +5V.
  • Use a small piece of jumper wire to make the connection between the shield wires and the 5V output pin on the Arduino, as shown in the third photo.
  • In the picture, I have used some blue heat shrink tubing to hold the three wires together. You could also just tape the wires together.

Step #4: Connecting the Arduino.

PrevNext
A Touchless 3D Tracking InterfaceA Touchless 3D Tracking InterfaceA Touchless 3D Tracking Interface
  • Connect each of the 10KΩ resistors to pins 8,9, and 10 respectively. Connect the red wire to the +5V pin on the Arduino.
  • Attach each of the alligator clips to a foil plate. The clips should be attached in the following order: pin 8=left plate (x), pin 9=bottom plate (y), pin 10=right plate (z). Make sure that each clip is making good electrical contact with the foil and is only touching one plate.
  • When troubleshooting, check the connection between the plate and the pin with a multimeter to make sure the alligator clip is making a good electrical contact.

Step #5: Using the software.

PrevNext
A Touchless 3D Tracking InterfaceA Touchless 3D Tracking InterfaceA Touchless 3D Tracking Interface
  • Download the Arduino sketch and Processing sketch from GitHub. If you haven't previously installed Processing, get it here.
  • From the Arduino IDE, upload the sketch to the Arduino. Keep the USB cable connected to the Arduino, then install and load the Processing sketch.
  • It is important that your computer is plugged into the wall for this to work properly. If the circuit isn't connected to earth ground (at least indirectly though your computer) you may find that your computer itself will affect the circuit.
  • The next thing to be done is calibrate the software. With the Processing sketch running, hold down the left mouse button. Then move your hand from the far outer diagonal corner (i.e., the invisible corner of the cube closest to you) to the inner corner. Don't touch the foil, just move your hand through the space defined by the cube. Now release the mouse button. The path your hand traveled gives the software a chance to detect the range of motion your hand will make inside the cube.
  • Now move your hand around inside of the cube. There should be a sphere on the screen through which you can control and move to touch all 27 cubes inside the computer model. Pressing tab will change the color of the cubes.
  • This is the simplest form of capacitive sensing available. In the final section, we'll look at some alternative solutions and options to improve the system.

Step #6: Possible improvements.

PrevNext
A Touchless 3D Tracking Interface
  • Increasing the resistor values - the 220KΩ resistors form part of the RC network and it's worth experimenting with different values. Typical values are 200KΩ to 500KΩ. The responsiveness of the system will be affected by these values. You can also tweak the values in the "Normalize" tab of the Processing sketch to calibrate your particular configuration.
  • A more solid connection with ground. Since the Arduino is connected to the computer, and the computer is connected to the wall socket ground, this is generally good enough to provide a consistent reference to ground. If you have a house ground connection available you might want to connect this to the Arduino ground pin and see if that improves the response.
  • If you decide to connect anything to the house wiring, be very sure that it really is a ground. A good earth ground would be a water pipe.
  • The CapSense library is an excellent capactive sensing library for Arduino. The page includes some good information on configuring capacitive sensing circuits.
  • Terry Fritz (a well regarded Tesla Coil experimenter) put together a neat "vision" system for robotics called ThereminVision. It uses tuned oscillators and heterodyning to implement a theremin circuit. Definitely worth a look.

Conclusion

In this guide, we introduced the concept of capacitive sensing. Nearly all sensing of this kind depends upon how long it takes a capacitor to charge (known as the time constant). Placing an object within the electric field of a capacitor will affect the capacitance value and the corresponding time constant. See the RC time constant entry on Wikipedia for more information.

We hope you appreciate the cleverness of this project as much as we did and how relatively easy it is to get a very 21st century interface (however crude) out of some aluminum foil and a cardboard box! We'd love to hear of your experiences with the build (in the comment section below).

Steve Hobley

Steve Hobley

This week, I have been mostly working on...

I've been tinkering around with bits of technology since I was five years old. I used to take the telephone apart at home, just to see how it worked.

After a couple of years I could even put it back together again - and sometimes it would continue to work.


  • Michael

    You have to have all 3 files in a folder called “TicTacToe3D”. Bring up TicTacToe3D in processing and run it. It should behave as described in the instructions.

    The easiest way to download all of the files from GitHub is to click the “Downloads” link (upper right corner, about 3rd line from the top) then the “Download as Zip” button. That way you get all of the files in the right structure to load into the tools.

    • Chris

      when i open the processing tic tac toe, it has the three other files tabbed but when i run it it shows a blank cube. Why is that?

      • onders

        I as well am having the same problem. Could someone please offer assistance. Thanks in advance

        • emarinkovic

          I found that changing the value of the comport in the following snippet of code from TicTacToe3D seemed to help bring up the image of the cube

          “import processing.serial.*;
          import processing.opengl.*;

          Serial serial;
          int serialPort = 0; // << Set this to be the serial port of your Arduino – ie if you have 3 ports : COM1, COM2, COM3
          // and your Arduino is on COM2 you should set this to '1' – since the array is 0 based

          I am still struggling to get it to work properly though. Hope this helps

      • Brandon

        Hey you should run 1.5.1 i had the same problem and i was really upset but when i switched from 2.0.1 to 1.5.1 it worked. Hoped this helped if it didn’t i have a few other ideas.

    • Shane

      I have the processing and everything done that is needed, but I dont understand how to get the processing to work and show me the cubes. I could not find the download button you talked about and I am lost at the moment.

  • Brian

    and where is processing? sorry for the total noobage im just getting started! and thanks ill change the values!

  • Steve Hobley

    You don’t need to use the analog ports as this is measuring the time taken to charge to “full” (HIGH) rather than measuring individual levels.

    Processing is available from http://processing.org

  • quang nguyen

    I have the same error…

  • Michael

    Download processing processing.org, if you have not found it already (step 5 first bullet above)

  • Steve Hobley

    Although I don’t have the code with me right now I suspect it’s because the serial port you are using to connect to your Arduino is set incorrectly. IIRC there is an array that needs to point to the correct serial port. I think I made a comment in the code about it.

  • fe13ar

    This is great!
    Would this also work on another mc like AT89c51?
    If yes, will major changes be required in the code?

  • mohamed

    i have the same do you found a solution ?

  • Shawn Wallace

    Hi Sean:
    Take a look at the Arduino Leonardo; that will let you use this as a (very crude) mouse.

    • Nehad

      Hi
      I opened the processing and appeared to me an empty box… is that normal

  • Shawn Wallace

    Hi Mohamed:
    What error are you getting, exactly? Can you post the output here?

  • Shawn Wallace

    Rebooting is odd, but could be an indication of a short circuit that is pulling too much current from your USB port. Your Mac should be able to shut the USB port down in a case of a current overload, but maybe not in this case. I would try to troubleshoot by narrowing it down to getting a single plate working. Make sure your power to the Arduino is connected to the wall; they powering it from a separate wall wart first.

  • Shawn Wallace

    Either one is fine. The their behind the DIL version is that students who keep trying to drive motors directly from an Arduino pin can easily replace the chip when it fries (at least, when the pin fries). So, I guess the DIL version is more robust in that sense.

  • Andraz

    Thanks.
    (Sorry for late reply, I didn’t found the “reply” button :-)

  • Kyle Luiten

    im having the same problem!!! do i need a driver for the arduino or something?

  • Kyle Roberts

    The name Kyle must be cursed o_O

  • Clark Dalton

    In the same boat as Alfred. Anyone got any ideas?

  • Shawn Wallace

    I think there may be a problem with the code and Processing 2.0. Can you try it with Processing 1.5?

  • Shiva Nathan

    I solved the previous problem. Make sure that you’re using the most STABLE interface of Processing:
    1.5.1.
    DO NOT use version 2.0.3.

  • Shiva Nathan

    @ Kyle Roberts:
    Go to Terminal and type in the commands:
    sudo mkdir…sudo chmod

    This is for Mac, by the way.

  • Kyle Roberts

    I just fixed the problem… Try using a 32bit pc for it… i was using mac

  • Steve Hobley

    It still sounds like you have some issues with the Processing installation. Have you tried running some other sketches? Do they run OK?

  • omar ahmed

    ya the processing runs fine but the TicTacToe3D sketch says theirs an error cannot find class normalize the processing program runs fine im pretty sure its in the code

  • omar ahmed

    OK two of the sketches have error Normalize and TicTacToe3D on normalize it says- (nested type normalize cannot hide an enclosing type) and TicTacToe3D says- (cannot find classs or type “Normalize”)

  • felix

    did you ever fix this? i get similiar errors…

    Display 0 does not exist, using the default display instead.
    WARNING: RXTX Version mismatch
    Jar version = RXTX-2.2pre1
    native lib Version = RXTX-2.2pre2
    [0] “/dev/tty.usbmodem3a21″
    [1] “/dev/cu.usbmodem3a21″
    [2] “/dev/tty.Bluetooth-PDA-Sync”
    [3] “/dev/cu.Bluetooth-PDA-Sync”
    [4] “/dev/tty.Bluetooth-Modem”
    [5] “/dev/cu.Bluetooth-Modem”

    and nothing happens on calibration (the ball drops into the centre but thats it)

  • felix

    Nice!,,, i cant get this working with processing but i really want to tweak the arduino code to feed into Max MSP as a musical interface kind of thing, any tips or code you can send my way just to get some useful reading from each axis???

  • omar ahmed

    oh what you do is make sure you have all the codes: TicTacToe3D, Normalize, MoumentumAverage. all i one window

  • Roy

    Would love to see that code if you can post it!

  • zephyrin JG

    how could i do that?

  • Pritesh

    Today, I am trying with processing v1.5.1 but, it still shows,
    Display 0 does not exist, using the default display instead.
    WARNING: RXTX Version mismatch
    Jar version = RXTX-2.2pre1
    native lib Version = RXTX-2.2pre2
    And executes showing the boxes, but, doesn’t calibrates, shows just yellow ball at the top last corner and doesn’t shows any movement..
    I am using ATmega328 (duemilanove), will it supports?
    helpme..

  • Yash Kudale

    ya i am having the same problem did you find any solution ?

  • Yash Kudale

    dude just use older version of the software 1.5.1 (with java) and it worked

    • Pritesh

      @Yash Kudale
      Thanks for reply!
      But, still I got the same error!

  • Austin

    Use Processing version 1.5.1 instead of the latest version. I can get the other cubes to show up when I do this. I’m having trouble calibrating though.

  • Jim

    Got this working but also having trouble calibrating — getting very limited range of movement on the display. Any tips on that?

  • jake

    I get this in 64bit pc with processing 1.51 and arduino 1.5.2

    Display 0 does not exist, using the default display instead.
    WARNING: RXTX Version mismatch
    Jar version = RXTX-2.2pre1
    native lib Version = RXTX-2.2pre2
    [0] “COM3″
    Exception in thread “Animation Thread” java.lang.ArrayIndexOutOfBoundsException: 2
    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)

  • jake

    also what do i fill in here:
    int sen = 3; // sensors
    int div = 3; // board sub divisions

  • Nehad

    I have an arduino processing 1.5.1. Do I have to download the processing that is on ‘www.processing.org’??

  • Nehad

    The processing is not working on 64 bit . Is there an updated version??

  • Charles

    Which of the sketches do we add to the arduino breadboard. 3DInterface or TicTacToe3D

  • timmy

    where is the code and the progeam

  • http://www.facebook.com/Desai.Kartik Kartik Desai

    I am not able to download code… :(
    How to do it???

  • MatteoITA

    I’m really impressioned and I would like to adapt the software to a pic, where can i find the source code? Thank you ;)

  • Jason

    Can someone help me out on step #5, point 2: “From the Arduino IDE, upload the sketch to the Arduino. Keep the USB cable connected to the Arduino, then install and load the Processing sketch.” I was able to upload the sketch to the Arduino, but I don’t get the “install and load the Processing sketch” part. (I do have Processing) I have been stuck on this part for a while now. Help will be greatly appreciated.

    • Kelly

      Just wondering if you ever figured it out? I have the cube up but cannot get it to move. I suspect it is because I have done a step wrong.

  • http://www.miladavaz.com miladen

    Hey guys, great tutorial. I can’t seem to find the Arduino Sketch though? The link is not working here, as in it is not even active…?

  • http://www.daretobefoolish.net/ Angie Li

    I am having the issue with normalize as well when I use this code: https://raw.github.com/Make-Magazine/3DInterface/master/TicTacToe3D/TicTacToe3D.pde How many different files of code do I need to copy into the Processing?

    Note: I am using Processing 1.5.1

  • Paul

    I’m using Processing 1.5.1 and my Arduino is connected via COM3, but I’m getting the following error when running the TicTacToe3D program ArrayIndexOutOfBoundsException: 1. The Processing run screen appears, but it remains white. Any help would be appreciated, thanks.

    • Nicko

      I have the same issue. Did you find a solution?

  • Min

    Hi, I have done everything and I see TicTacToe3D screen with boxes and orange ball. but the problem is that the ball doesn’t move at all. It doesn’t react. Any advice? What could be a problem? Help me~

    • Robin

      I’ve got similar problem. The only difference is, the ball’s movin ariound in random directions

    • Kelly

      I am having the same problem. Did you figure out what was causing it? Thanks!!

      • Demece

        You can download the arduino sketch and the 3 processing
        Version 1.5 sketches off github. Search under
        3D Interface. You alsp need a mouse to calibrate
        the software, we have not been successful with
        a trackpad. Hope this helps!

  • Newermore

    Can anyone please write me what program this does step by step, i realy need this for my school project. Please e-mail me to [email protected] . I will be very gratefull.

    #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;
    }

  • Andrew
  • Nehad

    Hey!!
    I did everything, but the box is not moving. what’s the problem??
    Can anyone help me please??
    I made 220K ohm by two 100k series with two 10k … do you think this is the problem?

  • Nehad

    It worked thanks god.
    but the sensitivity is poor, it is not sensing my hands well.
    is there any suggestions????????

  • Abd El-Rahman

    please I want the link of the arduino sketch

    • Nacho

      have you got it? the arduino sketch?

  • Nacho

    I cant download the sketch for my arduino board, pls someone help me.

  • Nehad
    • Nacho

      thx a lot, i really appreciate it

      • Nehad

        You Welcome :)

  • Jazmin

    im trying to do this with labview using an Ni daq, i really hope it works, I`ll do all the programing instead of downloading it since i wont be using the arduino But before I start, is the Al foil sensitive enough?? cause if it isnt, itll be hard to see the variations first off.
    Thx

  • Moises Mejia

    i cant seem to be able to open he sketch, im using a mac book pro. can someone help me out

  • Rohtih

    i got 3d cubes in processing..but it is STATIC not moving.. can some pls held to trubleshoot this problem….

    • Nehad

      1-check the arduino ports with the arduino program, they must be the same.
      2-And change number of bits per second: control panel-> Device Manager->ports->double click on arduino-> port settings-> Bits per second=115200

  • Joshua All

    Hello everyone, I was curious about the possibility of increasing the size of the squares to 7 feet by 7 feet, and how would that work with this idea? Any help would be appreciated. Concurrently, what inside the hand is charging the compositors of the squares, and what else could be used besides a hand?

  • Somesh

    Pls can some one explain me the exact procedure….. I am unable to understand most of the part in here….. is the code given above ….the 3D tic tac toe correct???
    If not pls upload the one that runs correctly ASAP please

    • Brandon

      no the code is wrong when you run it the program says cant find sensors change the words sensors to sen hope this helps.

  • Damodharan

    Pls help me.
    How can i move mouse in windows using this project ?

  • George

    It says in Processing that sensors cannot be resolved to a variable what should I do??

  • Casey

    The links to download the program aren’t working for me. Could anyone tell me the url to the download page?

  • rashomon

    Hello everybody
    I’m using processing 2.0 and it seems is not working well?
    Do I need to use processing 1.5.1 with java 6?
    thxs

    • George

      You need to use processing 1.5.1 processing 2 has errors.

  • Ahmed Zacky

    Using a MEGA 2560 – as a 3d controller?
    Hi, I dont have a leodardo but successfully (or maybe not?) finished all my budget on this. But alas! I really want to know whether i can use this as a (maybe crude) interface for a 3d game made in unity, or better, a 3d controller for 3d programs like maya or 3dmax (or blender/cinema4d) I Would really like to know as soon as possible because i have to submit a project on thrusday and im clueless. Thank you. Any help would be appreciated!!

  • George

    My screen in processing keeps freezing on the center corner help!!!!

    • George

      I’m talking about the invisible corner.

      • George

        Also what type of jumper wire do you need? Mine is acting like a sensor instead of a wire.
        Any suggestions?

        • Ahmed Zacky

          Coaxial cable.. the one which you put to backyard antennas? (skew out the aluminium covering inside.)
          While calibrating, do not touch the ICSP, it will cause it to get stuck there :D

          • George

            Thanks

  • cwelsh

    does this project actually work, because some of the comments say otherwise.

    • Nehad

      Yes it works

  • Frank

    Hello everyone, I need help where can I download the sketch and I don´t know if its necessary any library from arduino, thanks

  • zalino

    please i’m cameroonian ,how to get arduino module for make it ?it is possible to facilitate me to get it?my Email:[email protected]

  • Demece

    Please link github files for Arduino and Processing tic tac toe 3D. Cannot find files in github. Have already made repo. Thanks…

  • Kelly

    Got it to work, what a cool project. I am going to use it in my middle school classroom as a fun way to talk about 2D vs 3D and coordinates. THANKS!!

  • Robert14

    Does it work on 64 bits?

  • http://gravatar.com/valismaili valismaili

    I get the error I’ve posted below on Processing 1.5.1 when I run the sketch. It opens the window with the cubes and stuff. I hold down the button on the mouse and it comes up saying defining boundaries which is good. But after I’ve done that part I can’t get the sphere to move, would appreciate any help :) Thanks

    WARNING: RXTX Version mismatch
    Jar version = RXTX-2.2pre1
    native lib Version = RXTX-2.2pre2
    [0] “/dev/tty.Bluetooth-PDA-Sync”
    [1] “/dev/cu.Bluetooth-PDA-Sync”
    [2] “/dev/tty.Bluetooth-Modem”
    [3] “/dev/cu.Bluetooth-Modem”
    [4] “/dev/tty.usbmodemfa1311″
    [5] “/dev/cu.usbmodemfa1311″

  • http://none razvan
  • jeffekind

    Where can i find the download???? plz help me!

  • Demece

    Please input link for the right Arduino and Processing (1.5.1) sketches – Github does not have the right ones for Mac. Please???

  • Brian De Guire

    When i hit go on the processing it says that it cant find a class or type named “Normalize” if anyone could tell me what to do that would be great.

    • Newermore

      Have you installed drivers for arduino ? Because this seems as no program is in it.

      • Brian De Guire

        I tried to do so but it wouldn’t let me. I have a macbook and it says that the driver is from the internet and that it won’t open it unless it is from the app store. any suggestions?

        • Newermore

          I have finished this project on windows 7 so im afraid that i cant help you with this. But i have found this video http://youtu.be/Xr_bGDuyGEE guide that might help you.

          • Brian De Guire

            thx for your help.

  • Pingback: Hard Copy World | A Touchless 3D Tracking Interface()

  • http://twitter.com/ApexPredation Patrick Ryan (@ApexPredation)

    Where are the links for the sketches? I see what looks like should be Links in step 5 but they are not click enabled. Is there another way I can receive them?

  • http://gravatar.com/thundereagle Scott Williams

    Sketches are at: https://github.com/Make-Magazine/3DInterface

    I’ve got this built. I have the right serial port selected in the TicTacToe3D sketch, I changed the mains constant in the arduino sketch to 60. In an attempt to ensure proper ground, I have a DC adapter plugged into the board.

    I’ve checked resistance through the whole system with a multimeter to ensure I don’t have a bad connection, including touching the foil.

    The only output I get from reading the serial port is always 0 0 0. Maybe I don’t have the right port? Seems strange. It is the 1.5.1 version of processing. The Arduino board is working according to the blinking_LED sketch. I’ve even loaded the empty setup and loop sketch to ensure things are cleared out, and then put the 3d interface back in.

    I’ve also ensured my com port (COM5) is set to 115200 speed.

    • http://gravatar.com/thundereagle Scott Williams

      I’ve discovered my screw up. I used 220 resistors, not 220K.

      • https://www.facebook.com/jeffreykcorporation Jeffrey Koopman

        LOL I did the same thing XD

  • daniel

    are you running the processing app in android or java mode?

  • Kevin

    How can i know in which position my hand is, to transmit that position to an transmiter RF?
    For example: for each position of the hand it makes a different action like turning on a led in 3x3x3 cube full of leds.

  • http://gravatar.com/crystaltong618 crystaltong618ystal

    What’s your opinion on making this project life size, and making the box 5 feet by 5 feet by 5 feet. Would it be posssible?

  • Daniel

    for some reason every time i try to run the sketch on my mac it just stays in one position but when i run it from windows it runs perfectly, any idea why?

  • juan

    Hi, when I try to run the processing sketch I get this message: “The function readStringUntil(char) does not exist”. that function is in the next line of code “String cur = serial.readStringUntil(‘n’);”. I asume that such function should be in the serial library but i don´t know what the problem is. I need your help plis.

    • chos

      You need to use processing 1.5
      that command has change in the latest edition

  • Pingback: Weekend Projects HOA – Touchless 3D Tracking Interface Live Today at 3:30pm PT/6:30pm ET | MAKE()

  • rami

    Hi all,
    I’m testing this with just one panel and using the test program (_3DInterface)
    if I’m shorting pin 8+9+10 it’s working but reports three outputs,I would like just one output and that pins 9 and 10 (on the arduino) will be disconnected.
    tried changing line for(inti=8;i<11;i++) pinmode(i,input), to for(inti=8;i<9;i++) pinmode(i,input)
    but it didn't work, each time i remove the short line between pins 8+9+10 the output stops.

    Please advise
    rami

  • Pingback: Il futuro ... | Th3graphicsTh3graphics()

  • Oscar Espinosa

    Hi, Im interesting in the proyect that you did, I want to try it, but I don’t know the order of the Processing programs, if you can help me I will appreciate :)

    Oscar Espinosa

    • http://www.rywestech.com Ryan Westcott

      Hello Oscar, all that you need to do is put the three different programs in three different processing tabs, and run the 3d tic tac toe program and they should work.

      Good luck.

  • Đỗ Minh Quốc

    Hi It looks very interesting, I would to build my own program like this, I want to know how you read the signal data, did you use ADC pin? And how to determine the position in 3D?
    Hope you help me answer these above question.
    Minh Quoc

    • Đỗ Minh Quốc

      You use like the capture feature and measure the time to get the rising edge or falling edge signal to determine the position, is this right?

      • Jahaal Mordeth

        Check out the code. Essentially he does the following (not exactly but here’s the gist):

        pinMode(pin, OUTPUT);
        digitalWrite(pin, 0);
        delay(1000);
        pinMode(pin, INPUT);
        unsigned long init = micros();
        while(digitalRead(pin) == 0){}
        unsigned long end = micros();
        Serial.print(end – init);

        Put that code into your void start(){} method. Make sure you connect the wires properly and choose a value for “pin” (you’re using the GPIO pins. 8, 9, and 10 are good bets). Connect a capacitor to the piece of the schematic that is supposed to go to the plate. Connect the ground lead to the ground pin on your Arduino. The serial monitor should then display how long it took for this capacitor to charge. He’s essentially doing this repeatedly.

  • Farid Lopez

    Hello, I am running MacBook Pro (2013) OS X Mountain Lion. I pull up the sketches for Normalize and MomentumAverage just fine but the TicTacToe3D will not run. Processing returns an error message “Can not find class or type Normalize” (it also highlights the line where a call to the Normalize sketch is. I comment out this line and the calls to the other sketches return the same error message, any ideas why?

  • chetan mistry

    hey i want to use this touch less interface as my project topic. but i want some application that i can build using this. as it is a one year project please suggest me some topics in which i can use 3d interface

  • Evan Greally

    Hi I was just wondering would it be possible to send this data to Pure Data

  • Adrian Santillan

    it says “Cannot find a class or type called “Normalize” and some else in the forums said something about three programs, isn’t processing and arduino the only ones?

  • Guest

    Hi I have been working on a code that i took from the internet and I have been getting this same error ” ArrayOutOfBoundsException” no matter what COM port I change to. Please help me I have been stuck of this problem for weeks.Anyone?
    //————————————————————————————————————————————————
    import processing.serial.*;
    import processing.opengl.*;

    Serial serial;
    int serialPort = 1; // << Set this to be the serial port of your Arduino – ie if you have 3 ports : COM1, COM2, COM3
    // and your Arduino is on COM2 you should set this to '1' – since the array is 0 based

    int sen = 3; // sensors
    int div = 3; // board sub divisions

    Normalize n[] = new Normalize[sen];
    MomentumAverage cama[] = new MomentumAverage[sen];
    MomentumAverage axyz[] = new MomentumAverage[sen];
    float[] nxyz = new float[sen];
    int[] ixyz = new int[sen];

    float w = 256; // board size
    boolean[] flip = {
    false, true, false};

    int player = 0;
    boolean moves[][][][];

    PFont font;

    void setup() {
    size(800, 600, OPENGL);
    frameRate(25);

    font = loadFont("TrebuchetMS-Italic-20.vlw");
    textFont(font);
    textMode(SHAPE);

    println(Serial.list());
    serial = new Serial(this, Serial.list()[serialPort], 115200);

    for(int i = 0; i < sen; i++) {
    n[i] = new Normalize();
    cama[i] = new MomentumAverage(.01);
    axyz[i] = new MomentumAverage(.15);
    }

    reset();
    }

    void draw() {
    updateSerial();
    drawBoard();
    }

    void updateSerial() {
    String cur = serial.readStringUntil('n');
    if(cur != null) {
    //println(cur);
    String[] parts = split(cur, " ");
    if(parts.length == sen ) {
    float[] xyz = new float[sen];
    for(int i = 0; i < sen; i++)
    xyz[i] = float(parts[i]);

    if(mousePressed && mouseButton == LEFT)
    for(int i = 0; i < sen; i++)
    n[i].note(xyz[i]);

    nxyz = new float[sen];
    for(int i = 0; i < sen; i++) {
    float raw = n[i].choose(xyz[i]);
    nxyz[i] = flip[i] ? 1 – raw : raw;
    cama[i].note(nxyz[i]);
    axyz[i].note(nxyz[i]);
    ixyz[i] = getPosition(axyz[i].avg);
    }
    }
    }
    }

    float cutoff = .2;
    int getPosition(float x) {
    if(div == 3) {
    if(x < cutoff)
    return 0;
    if(x < 1 – cutoff)
    return 1;
    else
    return 2;
    }
    else {
    return x == 1 ? div – 1 : (int) x * div;
    }
    }

    void drawBoard() {
    background(255);

    float h = w / 2;
    camera(
    h + (cama[0].avg – cama[2].avg) * h,
    h + (cama[1].avg – 1) * height / 2,
    w * 2,
    h, h, h,
    0, 1, 0);

    pushMatrix();

    // Due to a currently unresolved issue with Processing 2.0.3 and OpenGL depth sorting,
    // we can't fill the large box without hiding the rest of the boxes in the scene.
    // We'll use a stroke for this one instead.
    noFill();
    stroke(0, 40);
    translate(w/2, w/2, w/2);
    rotateY(-HALF_PI/2);
    box(w);
    popMatrix();

    float sw = w / div;
    translate(h, sw / 2, 0);
    rotateY(-HALF_PI/2);

    pushMatrix();
    float sd = sw * (div – 1);
    translate(
    axyz[0].avg * sd,
    axyz[1].avg * sd,
    axyz[2].avg * sd);
    fill(255, 160, 0, 200);
    noStroke();
    sphere(18);
    popMatrix();

    for(int z = 0; z < div; z++) {
    for(int y = 0; y < div; y++) {
    for(int x = 0; x < div; x++) {
    pushMatrix();
    translate(x * sw, y * sw, z * sw);

    noStroke();
    if(moves[0][x][y][z])
    fill(255, 0, 0, 200); // transparent red
    else if(moves[1][x][y][z])
    fill(0, 0, 255, 200); // transparent blue
    else if(
    x == ixyz[0] &&
    y == ixyz[1] &&
    z == ixyz[2])
    if(player == 0)
    fill(255, 0, 0, 200); // transparent red
    else
    fill(0, 0, 255, 200); // transparent blue
    else
    fill(0, 100); // transparent grey
    box(sw / 3);

    popMatrix();
    }
    }
    }

    stroke(0);
    if(mousePressed && mouseButton == LEFT)
    msg("defining boundaries");
    }

    void keyPressed() {
    if(key == TAB) {
    moves[player][ixyz[0]][ixyz[1]][ixyz[2]] = true;
    player = player == 0 ? 1 : 0;
    }
    }

    void mousePressed() {
    if(mouseButton == RIGHT)
    reset();
    }

    void reset() {
    moves = new boolean[2][div][div][div];
    for(int i = 0; i < sen; i++) {
    n[i].reset();
    cama[i].reset();
    axyz[i].reset();
    }
    }

    void msg(String msg) {
    //using 'text(msg, 10, height – 10)' results in an exception being thrown in Processing 2.0.3 on OSX
    //we're going to use the console to output instead.
    println(msg);
    }
    //—————————————————————————————————————————————————

    • Garrett Davidson

      I had the same problem at first. I realized that even though my port was listed as COM3, I only had one port set up on my computer. Thus, I changed the serialPort to 0 and everything worked fine.

      Hope this helps somebody.

  • Ocker Olivier

    Why am I getting the error? The nested type MomentumAverage cannot hide an enclosing type?

  • daivya

    hey,I’m like to do the project you did. Can i know the purpose of this project??

  • Jennifer

    I Can’t seem to get this to work. The coordinates sent are just 0 0 0. Is anyone else having this issue?

    • Jahaal Mordeth

      Yeah I’m having that issue as well. Did you ever find a fix?

  • Pingback: Electonic stuff. | computothought()

  • Zoom

    Hey where can i download the code ?

  • Lysia

    Hi I am trying to make this project . A newbie to Arduino and coding .

    I don’t get it , which code should I use ? Just 3DInterface.ino ?
    And why do they have a 3d tic tac toe code too ?

  • Yuri Kravchik

    You can use simpler and cheaper way to get better results https://github.com/paperpointer/editor

  • https://www.facebook.com/rajput.gaurav51 gaurav rajput
  • Giulio Ammendola

    doesn’t work. the serial is sending 0 0 0 values hence processiong is doing nothing. any fix?

  • rama krishna

    plz help me solve the java.runtime.exeption ….which i have faced while running the processing sketch of 3d interface…….

  • Mihai Gînța

    This is a complete bullhist, you cannot measure the charge/discharge time as long as the 5V pin is always on (and it is)

  • Pingback: Best of 2012: Weekend Projects - Make: | Make:()

  • Schaune Hannibal

    Hi, a group of us are trying to build the touchless 3D tracking interface. Its a very cool project that we are trying to get done for a school project. We ran into the problem where we were only getting a white screen for the process part but we got that resolved. Now it showing the image of the tic tac toe with the squares and the ball but the ball is stuck at the back corner when we run the process program trying to calibrate it. We saw that some other people have had this problem but I haven’t seen any post how they have got this resolved. Can some please inform me as to what we can do to solve this please.

    • Adam White

      did you ever find a solution? I am having the same problem.