Triangulation with Distance sensors

Thread Starter

djsfantasi

Joined Apr 11, 2010
9,163
Hello,

I've made a couple of blinking and moving eyes. First, for my animatronic penguin, then on commission for an LA artist. I've been asked to make eyes that would follow you as you move around them (you can search for my username on instructables.com or check out djsfantasi.com).

There is an article about using two Ping))) ultrasonic sensors. I was also wondering about using a pair of Sharp IR distance sensors. The theory is to mount them co-linearly and cover one of the transducers. Triggering both together, both would respond to the uncovered transducer. Then, by calculating the different times from the sensors or coding a decision tree based on the different times, one could determine roughly where the person was relative to the center line of the eyes.

Do you think this is do-able? Currently, I am using an Arduino as my development platform, to gain experience before moving on to PICs.
 

wayneh

Joined Sep 9, 2010
17,498
Oh my, the difference in time would be the difference from light traveling just inches more or less to the two sensors. That is an extremely short amount of time. I believe in related posts here (on laser ranging), the solution was though to be phase comparison where you look at the shift between two waves rather than a ∆t between pulses.

In other words, this would be incredibly difficult for anyone, let alone someone with your professed skill level. No offense, I certainly couldn't do it either.
 

Thread Starter

djsfantasi

Joined Apr 11, 2010
9,163
No offense taken. I was encouraged by the success the author of the Ping))) article had. So perhaps ultrasonic is the better route. I believe that it also offers a greater range, from 2 cm to 3 m.

My electronics skill level is hobbyist; my coding skills are expert. If it can be done in code, I'll do it.
 

THE_RB

Joined Feb 11, 2008
5,438
I think you could do it with a slightly different approach.

If you used two Sharp GP2 IR sensors (that give a distance reading output) pointing in parallel (same direction) about 10" apart. Then a person standing 1m in front would read 1m distance on both sensors;

Rich (BB code):
S1 -------1m------- person
S2 -------1m------- person
But if the person moves to the side, one sensor misses the person and reads infinity;

Rich (BB code):
S1 ----------infinity------------- 
S2 -------1m------- person
                    person
So the code could detect this and keep turning the head so the person is visible to both sensors.

You still have two minor problems;
1. Sharp sensors are low range, generally 1.5m max range for the cheap type (unless you want the big expensive 5m versions).
2. This system only tracks a person after being "acquired". It can't see a person who enters a room to the side of the head, and will only acquire the person after they walk in front of the head.
:)
 

sirch2

Joined Jan 21, 2013
1,037
Have you thought about using a Kinect sensor? I doubt that you are going to be able to use a Kinect easily with an Arduino or PIC though
 

Thread Starter

djsfantasi

Joined Apr 11, 2010
9,163
RB,

Unfortunately, the application will not involve a head or turning base so the sensors will remain in a straight line. However, in your example if both sensors report a person or report infinity then the eyes will face forward. Otherwise, they would turn away from the single sensor reporting infinity. (This is simplified. Actually if both report infinity, the eyes would be closed)

Does this approach seem reasonable?

I just priced the 5m versions and they are comparable to the ultrasonic sensors. As I would need three Ping))) sensors or two GP2Y0K710 sensors… - Yikes!
 

wayneh

Joined Sep 9, 2010
17,498
Any way to "cheat"? For instance, use floor sensors. Or IR sensors in the wall behind the observer? Just trying to think outside the box.
 

THE_RB

Joined Feb 11, 2008
5,438
You said you are good at code. Why not use a cheap camera module, and decode a few lines of data from it? Most are I2C data output now.

You don't need to get the entire field, just read a few horiz lines with maybe 20 samples per line. A person in front of the camera (and slightly to the right) would look like this in your data array;

Rich (BB code):
....................
....................
............##......
...........####.....
...........####.....
...........####.....
...........###......
...........###......
:)
 

John P

Joined Oct 14, 2008
2,026
A camera may not work if there's poor contrast between the human figures and the background. It would depend on the lighting.

But I just saw this item on the Sparkfun website:
https://www.sparkfun.com/products/12907

It's the chip that's used in optical mice, and it has the ability to act as a low-resolution camera. Maybe it's possible to correlate the outputs of two of them, and get stereo vision.
 

sirch2

Joined Jan 21, 2013
1,037
I got one of those optical mouse chips to play with. The difficult part is getting the optics right, the sensor is at the bottom of a small hole and it works ok at very close range but focusing an image on to from a distance may be a challenge unless you are good at optics.
 

THE_RB

Joined Feb 11, 2008
5,438
The optical mouse sensor is only something like 18x18 pixels.

You can get a $4 camera module from ebay comes with working optics for a room focal distance and you can decode as much (or as little) pixel resolution as you choose.

There are some source code examples on the net using a cheap AVR micro to step the camera at a slower frame rate and decode the pixel data in real time using the micro's inbuilt ADC (reads pixel brightness).
 
Top