Motion Detector


In the photo here, you'll see a motion detector on the right. There's sort of a milky bulb diffuser on the front. On it's left is a buzzer. The demonstration, then, is this: when the sensor detects any motion, it sends a signal to the PIC, which then instructs the buzzer to beep away. Not much of a demo, I grant you, but it illustrates how things work. Lots of practical applications spring to mind at once:

  • automatic porch or garage lights
  • security alarms
  • touchless water taps
  • something to scare deer away from the garden
  • hallway nightlights

The sensor is the HC-SR501 and has the rather impressive name of pyroelectric infrared (PIR) motion detector. Despite the magnificent moniker, they go for around two bucks apiece. As usual, I got mine from Amazon. If you enjoy reading Chinglish, then here's a link to the data sheet:


For being so inexpensive, it really does sport quite the features. For example, a jumper lets you select whether to run it in gate or trigger mode. In the former case, a gate signal is generated as long as motion is detected. In the latter case, only one trigger is generated, which then resets after a certain on-time until the next motion is sensed. There is an onboard trimpot that lets you adjust the trigger output pulse width from about 6 seconds to 5 minutes. The other trimmer lets you set the sensitivity.

Kind of a fun part!

Click to get the source code.
Click to get the schematic PDF.

Next Project: Ultrasonic Ranging Device

No comments:

Post a Comment