What is the best way of X-axis motion sensing?

Hello

I'm building a bar/wall and want to detect human motions along the X-axis, so when people pass by, I can track their position and can animate for example googly eyes on a monitor to follow them.

The thing is, I really doint have mutch space. So I thought I could maybe line up some proximity sensors (http://wiki.bildr.org/index.php/LV-EZ1) side by side. But they are fairly expensive and huge. I thought more of something in the size of a light sensor . Does someone know if this would work, if people pass by in a distance from 0-100cm/0-3feet? Or are there other ways to achieve this?

Im kinda lost.

Ciao

Yes, I think it would work. In fact, you should use 2 of them separated by a meter!

Wire them in series with one side at 5V and the other at ground. Now if you read the analog value between the 2 sensors, you will be able to tell which direction each person was moving. That's because blocking the light to one sensor will make the analog reading go up, and blocking the light to the other sensor will make the analog reading go down.

Do you know if there are any Classes available for this, so I can easily chain 10 or more of them together (for a higher resolution) and get moving direction from the class? I see it coming, that my implementation of this function would got many noise and runaway values.

ciao

Does someone know if this would work, if people pass by in a distance from 0-100cm/0-3feet? Or are there other ways to achieve this?

Answer greatly depends on lighting conditions, in broad-day it's definitely not gonna to work. You have to set a "trip-wire", using light source on the other side of peoples line, to fix this.