Thursday, April 9, 2009

multitouch examples

Webcam just arrived and omegabob was kind enough to send me some filters to play with before I purchased! Thank you sir! I'm hoping I'll now have everything I need for this weekend to get some good blobs. It is easter so we'll see how much time I have to tinker.

I still need to find a place that sells mirrors and experiment with some compliance surfaces, but the good news is VoMTouch has a similar setup to what I am looking to do and has some great videos in this post. I'm using different LEDs than he is, so I'll need to see if I can get a good response out of them before I purchase the final strands. Also, I need to do make some diagrams to see if I can fit everything under a coffee size table (18"-24" tall).

Hopefully I'll have some new pictures and maybe footage up this weekend.

Sunday, April 5, 2009

multitouch phase 1

So I haven't been on here in a while, but I just read this article about multi touch DIY projects and discovered the NUI forums and have started a multi touch screen project using FTIR! The goal is to create a coffee table (18"-24") that has a 50" multi touch screen built in. That is a very short throw for that height table, but I think it is possible.

I decided I didn't want to buy my own LEDs and solder them all together. Recommended from the NUI forums is a company called environmental lights which sells ribbons of IR lights which are perfect for this application. They have 850 nm and 940 nm LEDs so I decided to purchase the IR LED Ribbon Delux Sample Kit to give it a test. As they mention on their site, the 850 have a slight reddish visible glow, but produces brighter IR from what I can tell. The red tint is faint when looking directly at the LEDs, and from along the acrylic it is almost impossible to see. I am leaning towards ordering a whole real of these LEDs in the 850 nm range.

I also stopped at Tap Plastics and picked up some random sized 3/8" and 1/2" acrylic sheets to test with. I didn't realize how many types of acrylic there are! Fortunately very few of them come in sizes over 1/4" so I just grabbed whatever was in the bargain bin. I also picked up an acrylic scraper as the first step to polish the acrylic edges. I also picked up some poly-urethane sheeting to test as a diffuse layer for the projection screen.

Last I hit up home depot and picked up some aluminum "C-channel" or "U-channel" and some sanding/buffing supplies. I noticed that people on the NUI forum (this thread, and this thread) had a hard time finding "C-channel" but there was a great section (in isle 19 hardware) at home depot which had good prototyping materials. I say good "prototyping" materials because the aluminum channels were a bit warped and blemished, but they worked well for my initial testing. In the kit from environmental lights there was some examples of the 1/2" and 3/8" channel which they sell and it was much nicer than anything I found at home depot. It also felt like it might have been anodized because it looked scratch resistant and more robust. Also, the LED strips fit nicely into the 1/2" channel from env lights where as the home depot 1/2" is just a bit small for the special connectors that came in the kit.

After getting home I spent some work cleaning the edges of the acrylic. I ran some tests with and without cleaning the edges and the polished edges produced better blobs. I drilled some of the C-channel to a wood board, I placed one of the LED strips in the channel and then the acrylic on top. After powering the LEDs, I used my video camera (web cam I ordered is still in the mail...) in night vision mode (IR band reject filter mostly removed) and then touched the acrylic. I had to press pretty hard, and you can see the blobs I was able to create below. (Yay for physics!)



























I also tried spraying some acrylic frost on part of one, and scratching the surface (sand paper) to create different surfaces (diffuse layers). Both of them worked, but they scattered the light on any objects close to the surface. I'm going to have to see if this will work with the image detection software (touchlib) once the web cam arrives. I also want to see how I can reduce the amount of force needed on the screen to create the blobs.

I am currently waiting for the web cam and projector I won on eBay to arrive which should happen next week. Once they come in I'll hopefully be able to post some better images.

TODO:
Hook up the web cam and see if the software can recognize my blobs.
Determine where to place mirrors under the table to get the lowest profile table at 50" diagonal with the projector.
Determine a good touch surface to create a zero force effect.
Find a cool use for my new toy....

~cmos

Saturday, November 29, 2008

It Works!

So the API isn't supported but still seems to work.  Found some interesting behavior that only about 8 bytes of data default are read from the buffer on each callback even if you are streaming a bunch of bytes on the serial port.  Seems that this can be fixed by setting the defaults or if you don't care about where it ends, just doing continual reads.

As for the Atmel program, Hyperterminal to the rescue! I now have a program that just copys back whatever is sent over the serial line.  I just modified the example uart program from winavr that writes to the LCD and to the uart (I don't have an LCD hooked up at the moment).  Java app seems to send data fine to the serial port and read it back, even if it is chopped up in 8 byte segments.

Going to work on sending a square wave and triangle wave and just streaming them from the Atmega 16 (based off of a button press? or maybe a command from the java program over the serial port) and graphing the streamed data from the MCU.  Not sure what type of data we will need to stream yet, but will probably write some utils to put 16 and 32 bit values on the line in addition to the 8 bits I am currently streaming.

Writing to the Serial Port

Decided to go with Java for this project (mostly because the tools I'm using are free).

First Roadblock - Apparently the Java support for javax.comm has been EOLed per this thread. I found a link to an older version of the jar file at Rick's Blog, but and it seems to work for Windows XP, but doubt that it will work in future versions of Windows. I found a good reference to get me started understanding how to use the API. Circuit Negma had good information on getting the javax comm libaries working.  If this doesn't work I'll probably either read more on the RxTx website or try to just write my own implementation for Windows. Another HOW TO Serial with RxTx.

It appears that if I am going to write my own implementation I would have to use JNI and write it in C or C++ for windows, here is a thread that describes the win 32 apis. Here is an example from the MSDN. Awesome implementation - http://www.codeproject.com/KB/system/serial.aspx. Another interseting link - http://www.fogma.co.uk/foggylog/archive/140.html.

Monday, November 24, 2008

Coding Environment for the Atmel MCUs

Getting my computer setup with development tools. I decided to go with Eclipse CDT and found a good resource to getting the AVR plugin's setup from the FriendlyARM Blog. I'm also using tortoise.svn with subclipse plugin as my SCM for this project. Hosting the source files on a MyBook World Edition hacked to run apache SSL and the svn mods. Should make it easy if I decide to share this project in the future.

Environment
tortoise SVN 1.5.5 - http://tortoisesvn.net/downloads
Maven 2.0.9 - http://maven.apache.org/download.html
Java 1.6.0_10 - http://java.sun.com/javase/downloads/index.jsp
Eclipse IDE for Java Dev - http://www.eclipse.org/downloads/
- SVN Plugin - http://subclipse.tigris.org/update_1.4.x
- CDT - http://download.eclipse.org/tools/cdt/releases/ganymede
- Maven - http://m2eclipse.sonatype.org/update
- AVR - http://avr-eclipse.sourceforge.net/updatesite

I have found that the CDT and avr plugins are so awesome.  They generate the makefiles and will actually auto discover the type and speed of the MCU and download the files directly to the MCU as well.  Great stuff!

First Post

Thinking about blogging for a while now and just read IK1ZYWs blog while looking for an example of driving an IR transmitter with an attiny before I head to the Jameco to pick up some parts. I thought it could be useful for others to read about my adventures and might help motivate me to stop slacking on my projects (with the added benefit of documenting my work).

Anyway, off to circuit design and I'll be back after my trip to Jameco.

~bigcmos