PIR Motion Sensor from Radio Shack

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.


  • Dean

This is really cool, i may have to go pick up one of these but i don’t know if they will have them.

But if i got 2 of these you could track a slow object such as a person walking slowly.

I did not know that these were vex compatible out of the box so this is nice to know.


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.


  • Dean

Now that i think of it the sensors would not work for motion detection.

The only way i can see them working is to have one on either side. The sensor assembly would not move at all but the actually robot/turrent or whatever would move depending on the sensor data.

It would be a crude tracking system but i have been trying to find some way of doing this but you cannot do it with light sensors or 1 ultrasonic unit.

I guess it could be done with ultrasonics but you would need like 4 sensors and it would have limited range less than 5ft.

I just went to my Radioshack and they did not have this sensor. :frowning:

I guess you must have a special Radioshack, the guy at my radioshack said that only a corporate store front would have this or the “main” radioshack stores.

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.


  • Dean

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…

I have been using this for a while now. I put it into a project box and can be seen on my EXP robot here:

It works well and is fun to incorporate into robots.

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.

Thanks again,

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]


  • Dean

Thanks Dean. I’ll give it a try.

Bought this today.

Fits perfectly with vex! I’m going to try it out programming soon. Im thinking off a door greeting robot or something similar.

I found it in the sensor drawer of the radio shack parts drawers.

Radioshack sells the same ultrasonic range finder as the vex one (minus the casing:() as well.

is it cheaper b/c of less packaging?

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

its not the same exact one… is it? I haven’t opened one up

it doesn’t seem to have an interrupt plug-in on it.

does anyone know how to mount this with cheap materials? I tried to make a cardboard box with some holes for the IR and the PWM connection and of course mounting but it broke.

also, what are the 3 additional pins covered by a black connector for? interrupt?

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

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.


  • Dean


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.