Determine number of people in a room

Thread Starter

jankyyatch

Joined May 5, 2018
9
Ok, here is what I want to do. No I actually did, but I want to know if someone has a different idea on how to approach this.

I want to know if a person ( or more than one) is present in a room and when there is one I'd turn on the light.
I did this a few years ago with a light beam made out of one IR transmitter (the modulated one for IR controls) two IR receivers, a few logic ICs and a triac etc. Not very difficult, I could determine the direction of the person passing through the beam and count the number of people.

However, this whole thing needs a power supply at a place where I do not always have a power outlet nearby and it has more wiring than I want to.

Does anybody have experience with a system that senses the presence of a person?

I do not want to use IR Motion sensors, because the person is not necessarily moving. The person can also be hidden behind some furniture.
The system should also still work when I moved around a chair for example. So simple capacitive proximity sensors/loops might not work.

Only a human beings presence should be detected.
I am not asking for schematics here, just ideas.

Thanks for any feedback

Moderator's note: This thread is a continuation of a related thread at the URL below.
https://forum.allaboutcircuits.com/threads/determine-number-of-people-in-a-room.56842/
 
Last edited by a moderator:

Raymond Genovese

Joined Mar 5, 2016
1,653
I think that this has become a "classic" problem. I also did one like that some years ago, for a very specific purpose.

IR E/Ds like you described are the most common and probably the most cost effective way.

Ultrasonics have also been applied to this task as well.

In the end, you may have to settle on addressing the PS and not a completely new approach.

Beyond that......well, seems to me that you have to get into thinking about what biometrics are available.

Although they can be still once inside, they had to be moving at some point to get into/ out of the room. So that narrows the task a bit.

Certainly people are decent IR sources, so you could pick up on that. An IR camera?

Or you could use a regular camera and do person detection algorithms (easier than facial recognition?).

Those two are clearly expensive approaches and do not necessarily eliminate your PS issue, but I am "thinking out loud".

Of course it would help if you could get those darn people to wear BLE beacons or Law Enforcement ankle bracelets so you could track them a little easier :)

If the people are only millennials, I would consider a water bottle or smart phone detector, because they will always have at least one of those on them at all times.

I am interested in the topic and am anxious to see what kind of other replies you receive. This is one of those projects that I would encourage as
a senior project for students...but without the IR or ultrasonic approaches which have been done so many times.
 

Thread Starter

jankyyatch

Joined May 5, 2018
9
well the main aim of the project is to control congestion in public places like banks and auditoriams, i have all the program code my major problem now is how to draw a circuit diagram on sensor's part , i humbly ask for assistance in drawing up a working circuit with proteas software
 

panic mode

Joined Oct 10, 2011
5,504
setup light emitter (or two) at one side of the door and two receivers at the other side of the door. receivers need to be spaced (say horizontal offset of 3-4 inches).
bring receivers to your MCU inputs and setup interrupts for each.
when sensor #2 is triggered and #1 is on, someone is walking in (count up).
when sensor #1 is triggered and #2 is on, someone is walking out (count down).
same is used for counting pulses from quadrature encoders...
 

Thread Starter

jankyyatch

Joined May 5, 2018
9
setup light emitter (or two) at one side of the door and two receivers at the other side of the door. receivers need to be spaced (say horizontal offset of 3-4 inches).
bring receivers to your MCU inputs and setup interrupts for each.
when sensor #2 is triggered and #1 is on, someone is walking in (count up).
when sensor #1 is triggered and #2 is on, someone is walking out (count down).
same is used for counting pulses from quadrature encoders...
thanks alot for assistance, so how are the sensors drawn on a circuit connected with a microcontroller? can you give a picture mode using a PIC16F877 microntroller
 
well the main aim of the project is to control congestion in public places like banks and auditoriams, i have all the program code my major problem now is how to draw a circuit diagram on sensor's part , i humbly ask for assistance in drawing up a working circuit with proteas software
At first I was confused about your request, because it appeared as though you had said that you already constructed a circuit, were NOT asking for a schematic and was asking for new ideas - see post #1 in this thread).

I saw the MOD note because you had, apparently, responded to a thread that was some years old. Post #1 in this thread, however, contains text (beyond the quote) from the original thread and not text that you wrote.

So, I am assuming that you have NOT built a people counter and you are asking for a schematic for that kind of circuit.

I am not going to draw a schematic for you, but there are plenty of them available online...click here and scroll through until you find one that you like (it's just a simple Google search using the terms people counter schematic).

If you do find one that you like and build it, please let us know how it works for you.
 

Thread Starter

jankyyatch

Joined May 5, 2018
9
At first I was confused about your request, because it appeared as though you had said that you already constructed a circuit, were NOT asking for a schematic and was asking for new ideas - see post #1 in this thread).

I saw the MOD note because you had, apparently, responded to a thread that was some years old. Post #1 in this thread, however, contains text (beyond the quote) from the original thread and not text that you wrote.

So, I am assuming that you have NOT built a people counter and you are asking for a schematic for that kind of circuit.

I am not going to draw a schematic for you, but there are plenty of them available online...click here and scroll through until you find one that you like (it's just a simple Google search using the terms people counter schematic).

If you do find one that you like and build it, please let us know how it works for you.
 

Thread Starter

jankyyatch

Joined May 5, 2018
9
C:
#define sensor1 portA.RA2
#define sensor2 portA.RA3
sbit LCD_RS at RB3_bit;
sbit LCD_EN at RB1_bit;
sbit LCD_D4 at RB4_bit;
sbit LCD_D5 at RB5_bit;
sbit LCD_D6 at RB6_bit;
sbit LCD_D7 at RB7_bit;
sbit LCD_RS_Direction at TRISB3_bit;
sbit LCD_EN_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB4_bit;
sbit LCD_D5_Direction at TRISB5_bit;
sbit LCD_D6_Direction at TRISB6_bit;
sbit LCD_D7_Direction at TRISB7_bit;
char i;
int count;
int count1;
char txt;

void introduction(void);
void displayLCD(int y);
void main(){

      PORTA=0XFF;
      PORTB=0X00;
      TRISC=0X00;
      TRISD=0X00;
      count=0;
      count1=1;
      adcon1=6;
     introduction();
    //char txt[]={7};

      LCD_INIT();
      LCD_CMD(_LCD_CLEAR);

      while(1){
      LCD_OUT(1,2, "BI-DIRECTIONAL");
      LCD_OUT(2,1, "VISITOR COUNTER");

      delay_ms(500);

      LCD_CMD(_LCD_CLEAR);
      LCD_OUT(1,1, "WELCOME EVERYONE");

      while(1){
           for(i=0; i<7; i++){
               LCD_CMD(_LCD_SHIFT_RIGHT);
               delay_ms(50);
           }
           LCD_CMD(_LCD_CLEAR);
           for(i=0; i<7; i++){
               LCD_CMD(_LCD_SHIFT_LEFT);
               delay_ms(50);
           }
           }
          }     if  (porta.ra2==1)
               {    
                           while (porta.ra3==0)
                           {
                            delay_ms(500);
                            count++;
                           }
                  count++;
             while((count==10)&&(porta.ra2==0))
             {
               LCD_CMD(_LCD_CLEAR);
               LCD_OUT(1,1, "MAXIMUM NUMBER");
               LCD_OUT(2,1, "EXCEEDED!!");
             }
             if(porta.ra2==1)
                {
                  LCD_OUT(1,1, "MAXIMUM NUMBER");
                  LCD_OUT(2,1, "EXCEEDED!!");
                }
             }
              else if(porta.ra3==0)
              {
                    while (count<10)
                    {
                      if(porta.ra2==0)
                       {
                         count=13;
                         delay_ms(500);
                         count1--;
                         displayLCD(count1);
                       }
                       else{
                            delay_ms(50);
                            count++;
                           }
                    }
                    while((count==10)&&(porta.ra3==0))
                              {
                                LCD_CMD(_LCD_CLEAR);
                                LCD_OUT(1,1, "MAXIMUM NUMBER");
                                LCD_OUT(2,1, "EXCEEDED");
                              }
                    if(porta.ra3==1){
                                    LCD_CMD(_LCD_CLEAR);
                                    LCD_OUT(1,1, "YOU MAY ENTER");
                                    delay_ms(500);
                                    LCD_CMD(_LCD_CLEAR);
                                  }


               }

                   if(count1>0){
                                 LCD_CMD(_LCD_CLEAR);
                                 LCD_OUT(1,1, "PLEASE ENTER");
                               }
                   if(count1==0){
                                   LCD_CMD(_LCD_CLEAR);
                                   LCD_OUT(1,1, "PLEASE ENTER");
                                }
                                count=0;

                   if(count1>=5){
                                   Lcd_Cmd(_LCD_CLEAR);
                                   Lcd_Out(1,1,"     Full     ");
                                   Lcd_Out(1,11,"Count:");
                                   IntToStr(5,txt);
                                   Lcd_Out(2,5,"ENTER");
                                   delay_ms(90);
                                   count1=5;
                                }
                 else if(count1<0)
                                {
                                   count1=0;
                                }
               }
          
           void introduction(void)
              {
                unsigned char i;
                LCD_CMD(_LCD_CLEAR);
                LCD_OUT(1,1, "WELCOME");
                delay_ms(500);
              
                for(i=0; i<16; i++)
                 {             // Move text to the left 16 times
                   Lcd_Cmd(_LCD_SHIFT_LEFT);
                   delay_ms(80);
                 }
                 Lcd_Cmd(_LCD_CLEAR);
                }
           void displayLCD(int y)
                  {
                     char txt[7];
                     IntToStr(y,txt);
                     Lcd_Cmd(_LCD_CLEAR);
                     Lcd_Out(1,1,"Count:");
                     Lcd_Out(1,11,txt);
                     Lcd_Out(2,11,"per 30");
                  }
 
Last edited by a moderator:
Top