Pages: 1 [2]   Go Down
Author Topic: best way to sense someone entering a room  (Read 2237 times)
0 Members and 1 Guest are viewing this topic.
Toledo, OH
Offline Offline
Sr. Member
****
Karma: 19
Posts: 457
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Arduino Uno - Teensy 2.0 - Teensy 3.0 - Raspberry Pi Model B w/512MB RAM
My libraries: NewPing library - LCDBitmap library - toneAC library - NewTone library

UK
Offline Offline
Shannon Member
****
Karma: 184
Posts: 11196
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Bournemouth
Offline Offline
Full Member
***
Karma: 0
Posts: 123
I am a digital media student at aucb in bounremouth , england.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

St. Leonards-on-Sea, E. Sussex, UK.
Offline Offline
Sr. Member
****
Karma: 2
Posts: 301
Ancient developer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I worked on this system:

http://www.irisys.co.uk/
Logged

Leon Heller
G1HSM

Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-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.
« Last Edit: February 04, 2013, 06:18:33 pm by Retroplayer » Logged

Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Actually, come to think of it, the imaging sensor in a wii remote is designed almost exactly for this purpose.

http://www.instructables.com/id/Wii-Remote-IR-Camera-Hack/
« Last Edit: February 04, 2013, 06:22:46 pm by Retroplayer » Logged

Bournemouth
Offline Offline
Full Member
***
Karma: 0
Posts: 123
I am a digital media student at aucb in bounremouth , england.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

retro player that would actually be the best thing ever , it would be so cool if it only started to denature if you were actually looking at it , it would bring a whole new level to the installation about observation and just be great to see people flummoxed as they realised their gaze was destroying the film.

so from what your say id need a camera that picks up IR , facing in the audiences direction from the projection possibly mounted under the bottom edge of the image which will most likely be on a canvass

http://rocketbrandstudios.com/store/pcb-s-and-boards ?

and then presumably an IR bulb or IR source?

Logged

Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

retro player that would actually be the best thing ever , it would be so cool if it only started to denature if you were actually looking at it , it would bring a whole new level to the installation about observation and just be great to see people flummoxed as they realised their gaze was destroying the film.

so from what your say id need a camera that picks up IR , facing in the audiences direction from the projection possibly mounted under the bottom edge of the image which will most likely be on a canvass

http://rocketbrandstudios.com/store/pcb-s-and-boards ?

and then presumably an IR bulb or IR source?



I thought you would like that idea. smiley Yep, that link brings you to a nice circuit already made up which is easier than hacking a wiimote for one and making a board. Odd how it isn't really much more than a wiimote itself. I have not personally used one of these before,but as I understand, it is a specially designed camera sensor which is specifically meant for detecting IR blobs and patterns. Essentially all the image processing I was thinking you would have to do is already done for you with this sensor.

And yes, you will need very bright IR LEDs. You will likely have to play around with arrangement to get them to hit the eyes directly on so that the IR reflects off the back of the eyeball at the right angle. This is what makes eyes light up (like on a cat or racoon.) Basically, the person would need to be looking nearly directly at the IR source.If you flood it, then you can ensure that, but you are going to get some reflection off other stuff. The trick is to recognize a pattern that reasonably represents two eyes pointed at your projection. Using a video camera instead of the sensor will help you play around with finding just the right angle. The eyes will light up like headlights when they are hit properly. Just put your Wii sensor and IR LEDs there.

That instructable I linked seems to show the nitty-gritty details about what the output looks like. There is lots of arduino code and libraries for it, so I think much of the work for you is already done.

I am actually even considering buying one to play with. I knew about it before, but never had a project to really play with it.
Logged

Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

BTW, if you can't source that module (the two places I have found it are backordered) it doesn't really look too difficult to hack one:
http://letsmakerobots.com/node/7752
Logged

Toledo, OH
Offline Offline
Sr. Member
****
Karma: 19
Posts: 457
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Not true at all, it would be quite easy because of the wide detection pattern of an ultrasonic sensor.  A few along one wall would be all that's required.  The memory would be almost nothing, and it would NOT be 3D by any stretch of the imagination.  There are people that use 15 sensors with my library with no problems at all.

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.

They only detect movement.  If the person is not moving, the room would be "empty".  Ultrasonic sensors would detect someone in the room, even if not moving.

You don't count visitors entering the room, that's just a trigger to scan the room.  A room scan would be done every so often.  You could even do it with one sensor mounted to a servo that scanned the room.

Using sonar is only difficult to those who have not used it.  If you know the distance to the other wall, you simply ping and if you get a result close to the wall distance there's nothing in the way.  If you get a "no ping" result it means that there's something in the room that absorbed the ping.  If you get a distance that's smaller than the distance to the other wall, it means there's someone in the room.  It's all quite easy and requires just a few lines of code.

I actually have designed something like this.  On power up, each of the ultrasonic sensors send a series of pings and average the results.  This is stored for each sensor as the wall distance.  It then pings every so often (can be multiple times a second if you like).  If the ping result is 0 "no ping" or anything less than the calibrated initialization distance, you know there's something in the room.  I always do a second (or third) ping to then confirm the results.

Ultrasonic sensors are accurate to within 1cm so someone could try to "hide" by hugging the wall and not moving and they would still be detected.  The sensors also very cheap, can be communicated with using only one wire, and are super easy to write a sketch to communicate with.  Nothing to invent, unsolder, or anything like that.  Just connect, drop in an example sketch, tweak it a bit, and you're ready to go.

The IR retina reflection is a great idea, but a much more challenging build.  Sounds like a great project, but maybe not a great first project.  There's probably a lot of trial and error and filtered logic that needs to be worked on for it to be effective.

Tim
« Last Edit: February 05, 2013, 01:26:53 pm by teckel » Logged

Arduino Uno - Teensy 2.0 - Teensy 3.0 - Raspberry Pi Model B w/512MB RAM
My libraries: NewPing library - LCDBitmap library - toneAC library - NewTone library

Bournemouth
Offline Offline
Full Member
***
Karma: 0
Posts: 123
I am a digital media student at aucb in bounremouth , england.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks tekel and retro player. I agree that the infra red idea may be a bit above my beginner level so what I intend to do at the moment as i have three months is to see if i can get the sonar system working and then if it works well keep it as a backup while I pursue the IR route which would be fantastic.

cheers guys
Logged

Pages: 1 [2]   Go Up
Jump to: