4

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?

capcom
  • 5,882
  • 14
  • 48
  • 59

3 Answers3

6

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

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

Dave Tweed
  • 168,369
  • 17
  • 228
  • 393
  • 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. – capcom Sep 05 '12 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. – capcom Sep 06 '12 at 00:01
  • As far as I know, the keyboard image is generated by a laser diode and a hologram. – Dave Tweed Sep 06 '12 at 02:02
5

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.)

You can even (and should) add an insulation to the pads like a soldermask or adhesive film.

Bruno Ferreira
  • 4,470
  • 2
  • 25
  • 36
  • Thanks for your answer, but wait a second, this won't create an invisible grid though? Right? – capcom Sep 06 '12 at 01:49
  • @capcom You can create invisible grids with this technique. This is now capacitive touch-screens and mouse pads work. Search the Microchip website for "capacitive sensing technology" for excellent application notes on how to implement this. – ARF Sep 06 '12 at 05:42
  • @capcom As Arik referred, you can make the grid invisible since it cam be covered by other surface such as a plastic, glass paper, etc. – Bruno Ferreira Sep 06 '12 at 08:30
  • Oh I know how capacitive touch sensing technology works, but it wont be portable. I won't be able to carry this around wherever I want. Do you know what I mean? The surface covering the sensors will always be a part of the grid. It's a great solution if everything stays in the same spot. – capcom Sep 07 '12 at 00:43
4

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:

boardbite
  • 4,892
  • 11
  • 47
  • 73
  • I think you meant to link to [this video](http://www.youtube.com/watch?v=0awjPUkBXOU) – Ben Voigt Sep 06 '12 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. – capcom Sep 07 '12 at 00:50
  • @BenVoigt: updated – boardbite Sep 07 '12 at 02: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. – capcom Sep 07 '12 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. – boardbite Sep 07 '12 at 13:14
  • @capcom: IIRC, Johnny Lee also open-sourced software for managing the output of the IR camera. Google for more info. Also read the text under the Youtube video. Check [his website](http://johnnylee.net/projects/wii/) as well as [this one](http://www.uweschmidt.org/wiimote-whiteboard). – boardbite Sep 07 '12 at 13:22
  • @capcom: Are you trying to combine this with your wireless clicker idea? – boardbite Sep 07 '12 at 14:31
  • @capcom: Also, if you are working with an Arduino, [check this library](http://www.stephenhobley.com/blog/2009/03/01/pixartwiimote-sensor-library-for-arduino/). – boardbite Sep 07 '12 at 17:21
  • Nope, not that idea. I have too many ideas unfortunately :-( Thanks for that link, looking into it. Also, suppose I don't use the wiimote, but still want an IR camera, do you know of any cheap ones which are well documented and easy to interface? Or, what about putting an IR filter on a normal camera? Lots of interesting possibilities. – capcom Sep 07 '12 at 18:32
  • I suggest you start a new question on the possibility of IR filter on a normal camera, to allow the community to weigh in. (I don't know the detailed answer to that, but am definitely curious too) And for Wiimote camera: buy Wiimote for 25 bucks, bash it in half, pull out the camera. – boardbite Sep 07 '12 at 18:35