Microchip Technology

user Occupation hasn't been added


  • Motion Sensor Using PIR Sensor and PIC Micorcontroller

  • Created: Oct 17, 2016

    • view151
    • comment0
    • bookmark0
    • fork0


No description available.


The motion detection has pre-dated back to the World War II, it was the time where an increase in demands for detection and monitoring was needed. This generated technological advances in motion sensing. Most notable invention at that time for motion detection was the radar, but was limited to military use. Today, motion sensors are found everywhere and can be made more easily, making our lives more convenient. Making a motion sensor now can be achieved with the use of microcontrollers and motion sensors. The circuit is a PIR motion sensor that is interface to a PIC microcontroller. There are many types of motion sensors, but this design uses the Passive Infrared (PIR) sensor, it uses body heat or infrared energy to detect motion. The microcontroller used is the PIC12F635, an 8-bit CMOS microcontroller with nanoWatt technology. It has a six I/O pin with individual programmable weak pull-ups/pull-downs.

The circuit has a PIR sensor, +5V voltage regulator, PIC microcontroller, BJT transistor, +9V battery, LED light, and a piezo buzzer. A 9V battery operates the circuit. A 5V voltage regulator is used to lower the voltage for the microcontroller and the PIR sensor. The voltage regulator is a MIC5205 low noise output voltage regulator. The PIR sensor is a pyroelectric device that detects motion by sensing changes in the infrared emitted by surrounding objects. The PIR sensor can detect a person up to approximately 30ft away or up to 15ft away in reduced sensitivity mode. The PIR sensor detects a motion when there is a sudden change in the surrounding IR pattern. When a motion is detected, it will output a high signal on its output pin (VOUT). This output will drive the base of the NPN transistor Q1. Since the PIR sensor output is only 3.3V a BJT is used to set logic input to the microcontroller. The microcontroller now monitors the voltage at the collector of the BJT transistor. In normal operation, the transistor is operated at cut off mode, and the collector output is at logic high (+5V). When a motion is sensed, the output high from the sensor module turns the transistor ON. The microcontroller can now read logic HIGH in the collector side of the BJT transistor. Once a motion is detected the piezo buzzer will alarm and an LED can be set to have a blinking effect.

The motion sensors are not limited for security systems, but can also be used in home control, commercial applications, energy efficiency, and automation. This is usually being used in commercial or public establishments in door openers. It is also used in occupancy sensors in light activation like smart lighting for walkways, streetlights, rooms, or staircase.