# uni-directional object counter circuit

#### ahsan ali 3

Joined Aug 18, 2017
19
i have been given the project of uni-directional counter.......using logic gates................

i have google it and found that all the circuit given there are bi-directional...... using ir sensor , 555 ic and decode counter for 70-segment...

what i need is to make a circuit which only counts when someone gets it.... it should give "1" output when someone comes out of room....

i have to make this using logic gates.... what comes in my mind is to use two ir sensors so one works if it gets output first............or something like that.......

#### dl324

Joined Mar 30, 2015
10,946
Is this homework?

#### ahsan ali 3

Joined Aug 18, 2017
19

#### dl324

Joined Mar 30, 2015
10,946
dld project......
What does "dld" mean?

Is this a school project for which you will receive a grade?

Joined Jan 15, 2015
5,505
You need to better explain your project and if this is schoolwork you need to state it is so the thread can be relocated to where you will get help with this sort of assignment.

When working with counters you need to get the terms correct. Counters can up count (increments) and down count (decrements). Counter basics go a long way. This sounds like you want a people counter circuit. Normally as a person enters a room the counter increments and if a person leaves the room the counter decrements. This provides a count of how many people are in a room at any given time. Anyway, you need to better explain your objective. A simple Google of People Counter Circuits will yield a dozen results.

Ron

#### ahsan ali 3

Joined Aug 18, 2017
19
What does "dld" mean?

Is this a school project for which you will receive a grade?
yes this is a school project.................

i need to construct a people counter which output "1" at seven segment display when someone enters into room..... and outputs nothing when someone comes out of the room.... or decrement in counted values using logic gates.

#### absf

Joined Dec 29, 2010
1,947
How does the sensor know that you are leaving or entering?

I think you need 2 sensors to do it. Let's call them Sensor A and Sensor B. They are placed 6 inches apart. If Sensor A is detected 0.5S before Sensor B, then someone is entering. And if Sensor B is detected before Sensor A, then someone is leaving... Does that make sense?

Allen

Joined Feb 20, 2016
3,564
It will be better to use an Up/Down counter using quadrature counting technique. As mentioned above, you need 2 sensors. Otherwise some one can enter and get multiple counts if they rock back and forward in the beam.
A quadrature counter will help limit this.

#### ahsan ali 3

Joined Aug 18, 2017
19
How does the sensor know that you are leaving or entering?

I think you need 2 sensors to do it. Let's call them Sensor A and Sensor B. They are placed 6 inches apart. If Sensor A is detected 0.5S before Sensor B, then someone is entering. And if Sensor B is detected before Sensor A, then someone is leaving... Does that make sense?

Allen
yes i thought of this idea...... but could come up how to get output when A is "1" before B. and if B is "1"before A it should give direct 0 instead of decrement......... do it simple..... if some one enters it should gives 1 and if someones goes out, it shows not count and remains zero..... now what logic should be used here....... i tried but could now come up with desired outcome....

#### ahsan ali 3

Joined Aug 18, 2017
19
It will be better to use an Up/Down counter using quadrature counting technique. As mentioned above, you need 2 sensors. Otherwise some one can enter and get multiple counts if they rock back and forward in the beam.
A quadrature counter will help limit this.
i require to make it just count when someone enters otherwise zero in any condition....... now how could i do this

Joined Jan 15, 2015
5,505
I suggested in post #5 you Google people counter circuits and provided a link. This is one of many popular circuits.

I suggest you look at the photo sensors along with the gates and figure out how it works. Think about the sensor spacing and why the gates behave logically as they do. I am not going to explain circuit operation. I also suggest you look at other similar circuits. Looking at the photo cells or photo diodes and thinking about what they do is what it is all about.

Ron

#### ahsan ali 3

Joined Aug 18, 2017
19
beyond my sense

Joined Jan 15, 2015
5,505
beyond my sense
Then maybe you need to go back and understand how basic gates work as this stuff is not really very difficult. Ask your instructor for some help and mentoring,

Ron

#### ahsan ali 3

Joined Aug 18, 2017
19
look brother what i want is the counter only counts one when some one is coming inside......

i am using two sensors ..... 2nd is some inches away from 1st...... know there are 4 possiblities......

1::::

2:::::

3::::::::

4:::::::::

Now brother tell me is this correct..... the only situation which I require is the third when the 1st sensor get high output answer is high....
means when any person passes through the the sensor 1..... it give 1 output other wise no output.....

am i correct....

#### ahsan ali 3

Joined Aug 18, 2017
19
Then maybe you need to go back and understand how basic gates work as this stuff is not really very difficult. Ask your instructor for some help and mentoring,

Ron

Joined Jan 15, 2015
5,505
I don't quite get why U3 is in there? Rather than aa AND you could use a NAND similar to the above but adding an inverting buffer is fine I guess and since you only want an UP count I guess what you have would work at a glance.

Ron

#### ahsan ali 3

Joined Aug 18, 2017
19
I don't quite get why U3 is in there? Rather than aa AND you could use a NAND similar to the above but adding an inverting buffer is fine I guess and since you only want an UP count I guess what you have would work at a glance.

Ron
is there any other technical problem in it..... and how much far apart ,should i place the sensors......

Joined Jan 15, 2015
5,505
The idea of the sensors is to detect direction of an object (person) going in or out. So the sensor spacing needs to be no greater than the with of a person. Most doing this exercise seem to choose 6 to 12 inches or 15 cm to 30 cm. You just want to trigger the leading sensor before the lagging sensor.

Ron

#### absf

Joined Dec 29, 2010
1,947
The 7400 can be used as NOT gates but the AND gates cannot. So if you design your circuit with NOR chip, you won't need the inverter chip....

So the rest is just experimenting with the distance of the 2 sensors. Do you just want to count people that are entering?

Allen

#### ahsan ali 3

Joined Aug 18, 2017
19
The 7400 can be used as NOT gates but the AND gates cannot. So if you design your circuit with NOR chip, you won't need the inverter chip....

So the rest is just experimenting with the distance of the 2 sensors. Do you just want to count people that are entering?

Allen
thanks ....... for making more easy....

yes i just want to calculate the people coming in......