mbeals 74 Posted October 18, 2012 Share Posted October 18, 2012 I would like to set up a proximity detector with a range of around 5'. All I want is a simple trigger....high for someone is there, and low if there isn't. Looking online, I've found I can do it actively with an illumination diode and an IR receiver, or I can do it passively with a PIR detector. It seems like the active sensor is the simplest, but I'm concerned that I won't get the 5' of range and that the signal will be really noisy and prone to a lot of false alarms. However, it also seems like the PIR detectors are more geared towards motion sensing, and I need to monitor a persistent presence. I would also rather deal with a binary type output than having to process a PWM signal. Anyone have experience or recommendations? For what it's worth, I'm attempting to build a bi-directional detector that can detect when a person is to the left, right or directly in front of the sensor. Quote Link to post Share on other sites
cubeberg 540 Posted October 18, 2012 Share Posted October 18, 2012 Hm - are you completely against measuring pulse length? The HC-SR04 Ultrasonic sensor is pretty cheap (~$3 USD) and gives a pretty reliable distance (up to 400cm/13 feet). It's a 5v peripheral, so you have to use a voltage divide, but the code is pretty simple. Quote Link to post Share on other sites
mbeals 74 Posted October 19, 2012 Author Share Posted October 19, 2012 I looked at those, but that module is pretty big... I need to fit two of them into the nose of a fake pumpkin and remain somewhat hidden. Quote Link to post Share on other sites
bobnova 59 Posted October 19, 2012 Share Posted October 19, 2012 PIR will only sense heat moving. IR at night might work at least some of the time. A person wearing IR absorbing clothes would be difficult to detect, a person wearing reflectors would be much easier. You'd probably need a pretty juicy IR LED and a good detector. Ultrasonic would be the easy way, but for directional stuff it would either need to scan, or you'd need two or three sensors. You could use visible light and have the pumpkin strobe people for tracking, less spooky and more WHAT THE HELL IS THAT PUMPKIN DOING!?, but that might not be a bad thing. Quote Link to post Share on other sites
jsolarski-backup 22 Posted October 19, 2012 Share Posted October 19, 2012 I would go with the active ir one, also to increase distance you need more ir output ....lets make robots? had a big write up about that kind of setup....sorry on my phone other wise i would post a link Quote Link to post Share on other sites
Fred 453 Posted October 19, 2012 Share Posted October 19, 2012 Olimex do a PIR based on the MSP430F2013. Ideal as you can extend or replace the code running on it to suit you. Quote Link to post Share on other sites
mbeals 74 Posted October 19, 2012 Author Share Posted October 19, 2012 I can't believe this is that complicated. I've seen cheap toys that do this sort of thing with what looks like photo diodes. I wonder if I could use a visible light diode with a band pass type filter to smooth out lf background illumination changes and hf noise. as long as the background is brighter than the foreground, it should sense shadows, and I could crudely adjust sensitivity with gain and threshold settings. Quote Link to post Share on other sites
larsie 121 Posted October 21, 2012 Share Posted October 21, 2012 I've built one myself using discrete components. I get maybe 20 cm range. I could maybe get longer if I used different components. This is the info: http://lars.roland.bz/diy-infrared-proximity-sensor/ and here is a youtube video of a simple robot using it. It sort of shows the range I got. http://www.youtube.com/watch?feature=pl ... ULUc1B9hdU Quote Link to post Share on other sites
GeoNomad 8 Posted October 21, 2012 Share Posted October 21, 2012 I would go with a real proximity detector if the object might not be moving, which is a requirement of all motion detectors. The Sharp GP2Y0A21YK and similar proximity detector are easy to interface and you can set the range you want to detect. They are available on ebay at a pretty reasonable price. A couple of PDF spec sheets to get you going: GP2Y0A21YK and GP20A02YK. Peter Quote Link to post Share on other sites
mbeals 74 Posted October 22, 2012 Author Share Posted October 22, 2012 I did look at those, and I plan on getting some for later projects...but $40 for parts I might not get back is excessive.... and they are still too large. Quote Link to post Share on other sites
bobnova 59 Posted October 22, 2012 Share Posted October 22, 2012 Built a couple this evening. One using visible light that has decent (multi-foot) range in dim conditions and maybe a foot in fairly bright conditions (forget direct sun), and one using IR that has a range in darkness of about 1.5 feet. In any meaningful light the IR phototransistor triggers and the sense pulse gets drowned out. I need a better sensor. Quote Link to post Share on other sites
mbeals 74 Posted October 22, 2012 Author Share Posted October 22, 2012 For the visible light one....I'm assuming its passive? How bright was your "dimly lit" room? Did you apply any filtering? I was planning on taking a short time average to decrease noise, and setting my threshold based on a running, multi-second average to handle gradual changes in background Quote Link to post Share on other sites
SirPatrick 35 Posted October 22, 2012 Share Posted October 22, 2012 How are these sensors too large? What are the size requirements you are trying to stay within? For distance detection on the cheap you really aren't going to do better than those IR sensors linked above. Any homebrew solution with IR LED and IR receiver is going to be quite a bit more inaccurate and prone to noise. Quote Link to post Share on other sites
bobnova 59 Posted October 22, 2012 Share Posted October 22, 2012 I pulsed a LED and checked light level before pulsing and during pulsing. A 15ms pulse was enough for the sensor to register a dramatic change, enough to be sensed anyway. Given the right setting it'd be creepy Or you could put the LEDs above the area you're looking to sense presence in, that'd work too. I found a 50nF cap was needed noise wise. Quote Link to post Share on other sites
mbeals 74 Posted October 22, 2012 Author Share Posted October 22, 2012 This is going in a fake pumpkin, so two sensors need to fit in the nose region....maybe 1" by 1". Accuracy is not a huge deal....if I hit 75 to 80% detection rate I will be happy. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.