best way to sense someone entering a room

hello basically my project consists of a servo arm applying a sandpaper pad to some film reel thats playing on a projector whenever someone enters a room.
what I was wondering was would be the best sensor to detect that persons presence?

originally I though pressure pads under a carpet but the rooms is quite large , well large in regards to being throughly sensitive about 3 square meters and it seems like it would be quite expensive.

my next thought was infrared beams but then I'd have a similar problem of having to angle quite a few to ensure the room is covered at every point.

recently I have been looking at the ultra sonic range sensors on spark fun and they seemed like they might be appropriate.

any thoughts?

cheers
sam

Ultrasonic, PIR, or maybe even a pressure plate(s). When I was 7 yrs old, I made a pressure plate, with just some tin foil, card board, cotten balls, a battery and a buzzer, and that seemed to work pretty well. My first attempt was just a bell on my door knob.

ok cool , how did you do that? my issue was I thought I'd have to buy 9 or so pressure sensors for every pad , which would be quite expensive

sorry i'm so new to this and barely know anything about electronics , but eager to learn. making my own pressure pads would definitely be fun I think.

It was a simple yet crude design.

  • Cardboard as the bottom plate
  • A few tin foil strips glued to it, with about a inch of space between them.
  • cotten balls spaced between the strips
  • Top cardboard had large sheet of foil glued on
  • Attach wires to foil strips, battery and buzzer

Think of it as a very flat contact button.
However, WE HAVE TECHNOLOGY :astonished:

Just think about it this way. You have a conductor(tin foil) on the top and bottom plates(cardboard) with something separating them(cotton balls). When you complete the circuit(push the plates together) the buzzer goes off.

Using Kinect sensor to detect the presence of human in the room! Yeay! http://my.safaribooksonline.com/book/hardware/arduino/9781449321918/4dot-working-with-the-skeleton-data/id2894898

Why do you need to cover entire room?
Put some laser in the door frame at the waist height. Two would be enough to determine whether a person entered or left the room. That way you can even count the number of people inside.

Shpaget:
Why do you need to cover entire room?
Put some laser in the door frame at the waist height. Two would be enough to determine whether a person entered or left the room. That way you can even count the number of people inside.

Hard. What if two come in hand in hand get counted as one and then one leaves? PIR could be better.

Make the door frame smaller. Single file, forward march!

hmmm I don't intend to do any actual diy so I will leave the door frame as is , would add a lot of work to my project ha. PIR sounds good although does it only sense motion because I imagine people will be still when in the room.

I may try and make some pressure pads tomorrow but if PIR works that sounds like it would probably be easier.

just watched some videos on pir seems like it's defiantly the way to go

cheers for the help guys

actually watching a bit and wondering if is it only motion because presumably a person is constantly generating radiation whilst moving or not so it would be a case of altering the sketch to enable it to send a constant signal to the servo while the radiation is being detected regardless of rises or falls in the volume of how much is being detected?

Yes there are some issue with PIR. It's only going to tell you if someone in front of it is moving. You can't just point it at the room and count the people. PIR would be easy if you just want to know if someone is in there or not. But to count people going in you are going to need to set it up someway just as you would a trip laser or something. a PIR sensor still isn't going to tell the difference between one or two people.

So you need to figure out these things:
-Is there more than one entry to the room?
-Is it possible for more than one person to enter it at a time, or for them to be so close that conditions don't change between them.
-Do you need to know if someone is leaving? Can they leave out the same way they came? Can someone be leaving while someone else is entering?
-Is it okay to occasionally have errors due to people leaving/entering at the same time?

Basically if you can't control all of these conditions you're going to have some trouble unless you are okay with the occasional error. If you can't get people in and out one at a time per door, you can't really tell exactly whats going on. You would either need video recognition, or enough of those pads to have a high enough resolution to actually see where people are stepping.

If you can control how people enter and leave the room, or you are ok with these errors then just get two trip lasers or two sonar sensors. The two sensors are set up so that as you walk in, you pass one, then the other. If sensor 1 detects something, then sensor 2, someone has walked in. If sensor 2 then sensor 1, someone has walked out. I wouldn't do this with PIR sensors because they detect change so they will bounce around when someone walks in front, then when someone walks away. Both send the same signal, "hey something changed.... hey something changed again, maybe someone is there, maybe not." Whereas with a sonar you can see "something is 6 ft away... ok something is 1 ft away... ok something is 6ft away again" you know that someone just walked by. Plus PIR will bounce around multiple times per change anyway, they are really only any good if you just want to know if someone is around, not anything with accuracy like this.

I started something and its major part is the same--to count the number of people entering a room. If I want to use an IR detector (I bought 38KHz detector) what would I have to do to make it work? Can somebody please help me out with the code too? Its tough being a Biology student for the past 12 years!
Also, I'm open to working with pressure pads, but I would like some help with the code and the connections too!
Thank you!

well to be honest I do only want to know if someone is around , the number of people is irrelevant I only need to differentiate between 0 and any. From what you say about it only detecting change though it sounds as though a still person would be counted as 0. if this is the case I think I will use an ultrasonic one

Sounds like you need a little clarification of your goal. Do you want the sandpaper to actuate when someone enters the room (as in only once per person) or do you want it to actuate the entire time someone is standing in the room (meaning the film scratches to nothing the longer someone stays?)

Monitoring just an entrace is the simplest way to count people. Depending on how you do that, it may have issues where it counts 2 people as one (though, if you put it at their legs, they would have to be walking perfectly in sync.) But how much does that really matter?

Maybe defining the overall purpose/effect you are trying to get would help. I am envisioning that this is an interactive exhibit where you are trying to show the degradation of an image the more it is viewed. Clarify your parameters, and I think people can be of more help.

BTW, a PIR sensor works by using two adjacent sensors angled slightly away from each other. Motion is detected by comparing the two sensors. The most you could determine from them (if you had a truly raw PIR sensor) is the direction of the movement. Most PIR modules have all the logic built in, which simply triggers if a sequential change between the two sensors is detected using comparators. Technically it can sense to some degree whether someone is continuing to stand in front of it, but again, you would need access to the raw sensors.

Automatic doors at the store uses radar for this purpose (a special band that is absorped by the human body.) Sonar would provide a similiar effect. Though if your project is as I am envisioning, a simple break-beam detector circuit would really be enough.

samhallett:
well to be honest I do only want to know if someone is around , the number of people is irrelevant I only need to differentiate between 0 and any. From what you say about it only detecting change though it sounds as though a still person would be counted as 0. if this is the case I think I will use an ultrasonic one

What's the dimensions of the room (length, width)? As long as the it's not larger than around 13-14 feet, ultrasonic sensors would probably work. Depending on the room size, you'll need a couple/few. The NewPing library is specifically designed to interface with multiple ultrasonic sensors. There's an example sketch that reads 15 sensors. For your purpose, you don't need ultra-fast speed, reliability is more important.

I would suggest several sensors that do a room scan once every several seconds or longer (with redundancy to reduce the chance of errors). I would also put a sensor at the doorway that would run frequently (like ever second or faster) also with redundancy that would trigger a room scan. As the author of the library I could help with the sketch too. Sounds like a fun project, and it shouldn't be too hard either.

Tim

teckel:
Depending on the room size, you'll need a couple/few.

An ultrasonic sensor just tells you the distance to the nearest reflecting object that is within range, so using this to determine whether there was a person in the room would require you to perform a three-dimensional scan of the room and then compare that against the results of the same scan when the room was empty. As long as the person was close enough to the sensor to be detected, and was not hidden behind something else, they could be detected. But it would require quite a complex scanning process and more data than a typical Arduino could hold in memory, to perform it.

The sort of PIR sensors used in security lights and alarm systems are very good at detecting people moving within a room and can detect even very small movements. As long you don't need to detect the presence / absence very promptly, and a 'false negative' (reporting the room was empty when it wasn't) was tolerable, that seems the most practical approach. The idea would be that the room was assumed to be empty if no movement had been detected for some time - for example, five minutes.

you've hit the nail on the head I want it to actuate the entire time someone is in the room at a constant intensity regardless of the number of people (unless that number is 0) , sorry that took so long to get out. I am interested by the idea of sonar though. part of my motivation in this project is to get aquatinted with the Arduino so I wouldn't mind going for the slightly more complex method.

I worked on this system:

samhallett:
you've hit the nail on the head I want it to actuate the entire time someone is in the room at a constant intensity regardless of the number of people (unless that number is 0) , sorry that took so long to get out.

And to think I don't "get" art. lol :wink:

ok, so on with it... the problem is to count people coming into the room. But with a simple IR break-beam, you wouldn't know whether someone just left or if another came in. So, you need to sense the direction of travel through the doorway as well. From outside to inside, add one person. From inside to outside, subtract one person. When everyone has left the room, you will be left with zero.

Another problem with any system (especially with just sonar) is that if two people enter the room at the same time and get counted as one, and only one leaves, your counter will be left thinking there is nobody in the room. Same problem if two people leave at the same time, you will lose track of your counter.

The easiest method of course, is to control your environment. Instead of pinching the doorway, what about simple barriers like rope barrier for the first 10 feet or so that control entering and exiting paths?

A PIR sensor would be the next simplest method. They really are very sensitive and will detect the slightest of movements. Get the type with the round dome.
Sonar would probably be very difficult as it only senses the distance of something, not what it is. It will reflect off of everything. However, if you have a limited point where people would stand to view the art, you could simply watch for an object in that area. Multiple sonars are really not going to be any different than just using a PIR sensor as you are going to detecting movement that way (unless you plan on building a sonar imager.)

A kinex would work great for this. Very complex.

Or.... what is one thing most people have? Eyes! And most people have 2. What about a properly arranged IR light pointing out directly from your projection screen? Eyes reflect IR light very brightly (think redeye.) A camera meant to filter out visible light could count these points of light. Or really, just sense that at least two dots of the general spacing of eyeballs is present. Since your viewer will be looking AT your art (most likely) it is just like what causes red-eye in photos (when someone looks at the flash instead of the lens.) That's a bit complex, but easier than a kinex. And you do not need very high resolution (in fact the lower the better.)

Finally, that gives you the added bonus of not wearing away the image if the person is not actively looking at your art.