Counting passes with sensor

Hello everybody,

I am new to the Arduino environment and I am planning to build a project involving counting the number of passes. The thing is I don't know which sensors are best to use. I was considering 2 ultrasonic sensors (beside counting I also need to know the direction so I need 2 sensors placed at a certain distance to detect if the movement is left-right or right-left), but 2 of those would probably interfere with each other, or 2 infrared obstacle avoidance sensors, but those don't seem to work at the distance I need (1-1,5 m). I know the alarm systems use a laser or some kind of beam which reflects on a surface and then returns - that seems to be the best solution, but I could find a sensor like that (probably a combination of 2 - emitter + receptor), but the best solution would be something that does not require any other objects (like a reflector).

What do you think I could use?

Thank you,
Adrian

adriantc:
Hello everybody,

I am new to the Arduino environment and I am planning to build a project involving counting the number of passes. The thing is I don't know which sensors are best to use. I was considering 2 ultrasonic sensors (beside counting I also need to know the direction so I need 2 sensors placed at a certain distance to detect if the movement is left-right or right-left), but 2 of those would probably interfere with each other, or 2 infrared obstacle avoidance sensors, but those don't seem to work at the distance I need (1-1,5 m). I know the alarm systems use a laser or some kind of beam which reflects on a surface and then returns - that seems to be the best solution, but I could find a sensor like that (probably a combination of 2 - emitter + receptor), but the best solution would be something that does not require any other objects (like a reflector).

What do you think I could use?

Thank you,
Adrian

Is the opening you're wanting to track wide enough for multiple people to go through side by side? Or, can people walk both in and out at the same time? If so, no matter what type of system you use, your counting is going to be wrong.

It may be possible to do this with ultrasonic sensors. The sketch would ping one, then the other, with around 29-33ms of delay between the two. This would allow enough time for any echos to dissipate. For controlling two ultrasonic sensors you could use my NewPing library which works well with multiple sensors. I'd put the sensors a few feet apart to make sure you get the correct direction.

Probably a better way is to use an optical beam with a reflector on the far side. Or, a two-part system were there's a optical beam on one side and a receiver on the other. This beam is always active and senses when the beam is "cut". The good thing about this system is that it detects the interrupt so it can detect very fast movement (unlike the "pinging" method of an ultrasonic sensor). If you're ever seen the safety sensors on garage doors that detect if something is in the way, those would work prefect. It's a tight beam, and it can detect something going through the beam at a very fast pace. Something like this: Genie Safety Beam Photo Eye Sensors Kit (you would need two sets).

Tim

Thanks... I haven't thought about pinging the ultrasonic sensors alternatively. It might work. The thing is that I don't want to put them so apart, maybe at a slight angle from each other (of course facing other direction), but next to each other.

I need to count the people entering and going out a door... As a condition only one at a time in a single direction and with enough distance between to register as different. Probably the beam interruption is the best since it offers the best detection rate. The Genie kit seems pretty expensive and large (at least from pictures). Do you think it can be replicated with a photocell (infrared) and an emitter (I don't know if one exists for android)

I need to count the people entering and going out a door.

This is a very difficult thing to do, many years of research have not shown a good and accurate way to do this.

Just as an example, suppose some one trips the first sensor and then she changes her mind and goes back. Now someone traveling in the opposite direction will trip the next sensor and some one will be clocked as going out, they will then trip the first sensor. Therefore all counting will be done in the wrong direction.

Now suppose two people are so close together that they only trip one sensor but by the time they trip the second sensor they have separated and trip it twice. Again you have a counting error of some sorts.

How accurate do you have to be?

Grumpy_Mike:
How accurate do you have to be?

Its going to be a home-based project so I don't need an extremely accurate count. The main issue would be to register the easy counts... one person - no matter what light conditions or speed conditions (not this special cases where the user changes his mind or two persons are very close to each other and so on).

This thread is addressing a similar topic:-
http://arduino.cc/forum/index.php/topic,126620.0.html

adriantc:
I need to count the people entering and going out a door...

The door itself seems to be the biggest challenge. I didn't remember reading that a door was involved. The door itself will be a big surface that will appear to be person sized. If it was a doorway, you would have a better chance of doing this with some accuracy. But the door being in the way will be much more of a challenge.

How about this. One of the sensors will track when the door is opened. Then, one ultrasonic or optical sensor can be put on just one side of the door (the side where the door doesn't open). Then, you track the door opening as one trigger, and the ultrasonic/optical sensor as the other trigger. With this information, you can determine direction depending on which is triggered first. This would also lower your cost as creating a door open sensor is simple and cheap.

Tim