I just picked up a Passive Infrared (PIR) Sensor Module at Radio Shack for $10. (276-0033) Also available here. Datasheet is here.
It is plug-and-play with Vex, so I thought I’d post and share the goodness. It has a 3-pin connector that you can plug a servo extender into and the pinout is correct for Vex.
Attached to a digital port, it reads 0 until it senses motion in its field of view (about a 90 degree cone). The output remains high until a few seconds after the motion stops, then it returns to 0. (There is a jumper that configures it to pulse the whole time it is sensing motion, if you prefer.) You have to let it self-calibrate after you first power it on, so it won’t stabilize until 30s or so after you power it on.
It has two small holes for mounting, but they don’t conform to Vex sizes or spacing, of course.
Obviously, it’ll trigger continuously wile your bot is in motion, but it could be useful for a sentry bot that sits idle until it detects movement.
Maybe, but it would take some experimentation. If your robot moves, then the PIR sensor will “see” lots of motion because its whole field-of-view changes. I think they will only be of use on a robot while it is completely still - you couldn’t mount it on a servo and do a sweep, for instance.
Using two sensors with an overlapping field-of-view, you might just be able to figure out when somebody moves into the area of overlap. I doubt you would be able to get an accurate enough fix to hit them with a nerf ball, but it would be fun to try.
I use Vex for haunted house animatronics, and this appears to be just the ticket to trigger automatic props.
Bummer - the store didn’t seem particularly special or big, though it is well stocked (for a Radio Shack) in the components area. They guy who runs the store seems to be into building things, so perhaps he special orders them or something. You can order it off the web, or (usually) you can have your local store order it for you and hold it there till you check back.
I may ask them to special order it and hold it or i could just order it off the internet.
Our radioshack sells a lot of differnt stuff but they are not that big on eletrical components. The worst radioshack is the one in our mall, it has almost no stuff except for a couple ripped packages of resistors relays ect…
Thanks for posting the PIR info and links Quazar. These sensors worked perfect with my current robot project. They interface with vex very well.
However, on one of my robots, I have LED’s for the eyes that use a manual switch to turn on/off. I would like to automate the eyes to turn on automatically when someone walks by and then go off after a period of time. Can you recommend a relay that is compatible the PIR sensor.
When the PIR activates, it triggers the relay to turn on LED’s.
A relay would probably be overkill for LEDs. The PIR module can’t really drive relays directly, so you’ll need a transistor for that. Once you’ve got that, you may as well just do away with the relay and let the transistor control the LEDs directly.
There are several threads around that talk about wiring up a transistor to a Vex digital output port to control small DC loads. I’ve posted a diagram for one here. You can build the circuit as shown, and just plug it into a VEX Y Cable along with the PIR module, and you should get your desired result.
[EDIT] Since you are just driving LEDs, you can eliminate the rectifier in the diagram I mentioned above. You only need the rectifier if you are driving an inductive load (an incandescent bulb, motor, or relay). [/EDIT]
umm… Lemme check pause to open new tab
the sensor itself is $32.99 from the Radioshack website plus shipping.
I found one in my local store for about $20. (They were having a sale or something)
either way you still save on shipping, but it’s not a huge difference
I don’t have one to crack open either, but from what I can tell they are either very similar or exactly the same. Apparently Parallax only makes one model of ultrasonic sensor that looks like this, and the one on their Website is the same as the one at Radioshack. The specifications on each one are almost the same as well. the number of pins is the most confusing thing. I can see both the power wires going into the same two pins, but that still leaves one unaccounted for. Anyone opened one up before?
Here’s a better picture from Parallax http://www.parallax.com/Portals/0/Images/Prod/2/280/28015-L.jpg
sorry for the double post, but I forgot something.
Assuming this sensor is the Vex one or is Vex compatible, project boxes like these would be perfect for mounting them. Just drill holes for whatever you need to put in.
Thanks to Quazar for the link. It was in another thread somewhere and I had it bookmarked.
From the spec, it looks like they combine the trigger signal and the echo signal (interrupt) onto a single port. This means that you plug its one signal into an interrupt port. The software would need to do the following:
*]configure the interrupt port as an output driven low
*]pulse the port high for about 5 microseconds
*]set the port back to low - the range finder has now been triggered
*]configure the port as an input
*]wait for the port to go low - the sensor is now driving the port line
*]set the interrupt to run your ISR when it goes high
*]wait for the interrupt to fire
*]in the ISR, start a timer and reconfigure the interrupt to fire when the port goes low
*]wait for the interrupt to fire again
*]in the ISR, stop the timer, which now holds your range value.
[/LIST]Not as easy to use as the VEX one, and you’ll probably need MPLAB or RobotC to make it go. This is just from a casual inspection of the spec sheet; I haven’t used one of these and the exact sequence may vary a bit from this.
We bought a couple of these Parallax’s from Radio Shack in FEB-2008, FRC Team 957 was experimenting with them on our Robot for FRC 2008.
We found code at Chief Delphi with this thread, SONAR Sensor Software Driver. IIRC, (it was 4 months ago) you need to use an Output Port and an Interrupt on IFI controller, and tie the Input and Output lines together and connect them to the SIG line, so that you Trigger the Sonar, then monitor for the return.