circuits

WBahn

Joined Mar 31, 2012
33,135
The problem with the LDR is more about logistics than debouncing, as WBahn pointed out in post #12.

You can condition the signal from the LDR with a retriggerable monostable multivibrator such as a 74LS123 to produce an extended signal of a suitable duration.

The problem is that it does not identify the direction of motion.

Then there is the problem of two persons passing each other, one coming in and the other going out.

On a first iteration basis, you will need at minimum, two sets of sensors, staggered in position. One sensor will detect later than the other. From this you can determine direction.
But I don't think he needs to deal with all of that. He stated early on that he has two separate doors, one entrance and one exit. It is reasonable, especially for a basic lab project (assuming that that is what this is) to detect people passing one sensor at the entrance door and assume that they are all entering and detect people passing another sensor at the exit door and assume that they are all leaving.
 

MrChips

Joined Oct 2, 2009
35,127
As I said, the LDR will not present the type of bounce you will see with a mechanical switch.

The first thing to do is to feed a slow square-wave signal (about 1Hz) from an oscillator such as a 555 timer circuit and verify that the counter counts properly.

Next is to feed the the signal from the LDR, amplified and fed to a 74LS123 monostable (or 555 monostable) with about a 1-sec time-constant to the 74192 UP/DOWN counter.
 
Top