# Detecting the placement of my finger on an invisible grid

Yes, a similar question was asked before, but mine is different. Let me explain what I am thinking of.

Suppose I have an invisible 3 x 3 grid on my desk, is there any way I can detect which square I place my finger on? To clarify, when I say invisible, I mean I cannot see it, but the computer knows it is there, and I have a general idea where the 9 squares should be.

If it makes it any easier, imagine the grid is drawn on a piece of paper, and I need to detect which square I place my finger on without attaching anything to the individual squares.

The way I thought I could accomplish this task is to use one of those distance sensors, one for each row (or column). So I have three distance sensors, and depending on how far away my finger is from the sensor corresponding to row which my finger is on, it gives me a reading to indicate the exact square. This method seems simple, but the drawbacks for me are that the device will be too bulky if I use the commonly known HC-SR04 sensor (is there a smaller one?), and would be a nuisance to extrapolate to, say, a 20 x 20 grid (not to mention expensive).

Is there a cheap method I can apply to measure distance or position somehow on an invisible grid?

• Isn't a capacitive grid an option? Sep 5, 2012 at 23:00
• @BrunoFerreira Hi, that sounds interesting. Can you tell me some more, and give me a link to more information? Thanks. Sep 5, 2012 at 23:58

This would be an ideal situation to try a variant of the method pioneered by Johnny Lee using an IR led and a IR (infrared) camera, e.g., found inside a Wiimote or bought off ebay for \$25-30.

Any IR camera can be used, but the one from the Wiimote is superb for this because it's tiny and yet has a high resolution (1024 X 768) and a 100 Hertz update rate, better than even most standard (visible-spectrum) webcams.

The camera tracks X-Y coordinates of a basic infrared LED in its view region, so you can get creative on where you place the camera. As far as the infrared LED/marker, you can wear it your moving finger/hand.

Alternatively, if you don't want to wear an LED on your finger, you can have an array of several infrared LEDs sitting in a fixed position, emitting radiation which is detectably reflected by your finger if you put a piece of reflective tape around your finger (works rather effectively). Lots of flexibility.

You can watch Johnny Lee's video demo 1 and video demo 2 of something similar to this; the demo is rather impressive given the minimalistic setup.

Also, take a look at his original writeup.

For this method, three pieces of software that might come in handy:

• I think you meant to link to this video Sep 6, 2012 at 22:49
• Oh wow, this is amazing. You guys have all given me amazing ideas, thank you. I especially like this one, and Dave's. Sep 7, 2012 at 0:50
• @BenVoigt: updated Sep 7, 2012 at 2:56
• I'm curious though, because IR does not fall in the visible spectrum, can this method pose any hazard to my eyes as I won't know how bright the array would be? And (in case you know), what kind of software would I use to process the images from the IR camera? Would something like OpenCV (mentioned in Dave's answer) be appropriate for this too? Thanks. Sep 7, 2012 at 11:32
• If you use the IR camera from the Wiimote, it directly outputs the X-Y coordinates of the four brightest IR points it locates and their intensities, @100Hz data rate, so your work is done. For other IR cameras, you can use OpenCV, yes. IR camera is not very different than visual camera; it just filters specifically IR-frequency light. And no hazard. Your TV remote uses IR. Sep 7, 2012 at 13:14

Use a webcam, and some software (such as OpenCV) to define the "touch areas".

Entire "virtual keyboards" have been built using this technology.

• Hey that keyboard is cool, I've seen it before. Do you know how they project that keyboard onto the surface like that? Is that something a hobbyist could achieve? Thanks. Sep 5, 2012 at 23:59
• Also, thanks so much for that link to OpenCV. You have no idea how excited I am now, I have so many projects in mind which could use this technology. Sep 6, 2012 at 0:01
• As far as I know, the keyboard image is generated by a laser diode and a hologram. Sep 6, 2012 at 2:02

You can use a PCB with copper squares, or rectangles to sense capacitance. This would require minimal hardware and very simple software.

I already tried it and it works quite well.

You will need to connect each capacitive pad to a I/O pin on the µC, then you would follow these steps:

1. Set the pin as an output.
2. Output a high level for enough time for any eventual capacitive load (that could be your finger) to charge.
3. Set the pin as an input.
4. Wait just enough time in order to allow all the pads that are not touched to discharge.
5. Read all the pins. (The pins read a high are the ones that are being touched.)