The project like this, 3 ir sensor senders and receivers were put to count people who are in the room if the number of them is more than 4 for example the DC motor must turn off 3
Senders and 3 receivers for more accurate let's say that the first sensor is (A) the second (B) and the third (C)if A works fist then B then C we can assume that the person is entering the room but if C then B then A then he is existing, and if the number of people in the room in more than 4 the DC motor which is connected with a transistor must turn off
so please if any one can help me to write the arduino code ?
// I don't want to use an LCD or monitor . just if the number is more than 4 the DC motor must turn off
any help ?
Do you plan to send one of use the Arduino, the sensors, and the room where the sensors will be placed?
IR sensors can not count the people who are in a room. They can be arranged to count the number of people entering or leaving a room. For that, you need TWO of them, not three, AND you need to assure that people can not enter the room any other way AND you need to assure that anyone that starts to enter, or starts to leave, the room MUST complete the process that they started, AND that only one person at a time can be entering or leaving the room.
IF, and only if, you can assure all that, then determining the time that sensor A was triggered and the time that sensor B was triggered is easy. Knowing which was triggered first tells you whether a person was entering (so you need to increment the counter) or leaving (so you need to decrement the counter).
The counter then tells you whether the motor should be on or off. Connecting the motor to a motor shield, supplying it proper power, and connecting the motor shield to the Arduino are all trivial.