element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Freedom development platform
  • Products
  • Dev Tools
  • Freedom development platform
  • More
  • Cancel
Freedom development platform
Blog Interfacing HC-SR501 pyroelectric infrared PIR motion sensor detector module to FRDM-KL43Z using Kinetis Design Studio 3.0 Kinetis SDK 1.2 Processor-Expert
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Freedom development platform to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: bheemarao
  • Date Created: 7 Oct 2015 9:15 AM Date Created
  • Views 643 views
  • Likes 1 like
  • Comments 2 comments
  • pir_sensors
  • hc-sr501
  • frdm-kl43z
Related
Recommended

Interfacing HC-SR501 pyroelectric infrared PIR motion sensor detector module to FRDM-KL43Z using Kinetis Design Studio 3.0 Kinetis SDK 1.2 Processor-Expert

bheemarao
bheemarao
7 Oct 2015

This is a project for interfacing PIR sensor module to  FRDM-KL43ZFRDM-KL43Z using Kinetis Design Studio 3.0 Kinetis SDK 1.2 Processor-Expert

 

The module contains 3 pins for connection with system. The two of them are vcc 5v and Gnd. The third one is output from this module. The signal goes high when motion is detected. The output signal is 3.3v compliant. From your system after providing power you check the 3 rd pin for motion detection

 

image

Delay time is the time during which the output remains changed after the change caused by a detected motion. Or the delay between two subsequent motion detections.

 

Below are the features of the sensor module:


  • wide operating voltage range: default voltage DC 3.6V ~ 20V
  • temperature compensation ( optional, not factory setting ) : In the summer, when the ambient temperature rises to 30 ~ 32 , detection distance is slightly shorter, temperature compensation can be used for certain performance compensation.
  • high output signal: the circuit can be easily implemented with various docking.
  • Micropower : quiescent current <50 microamps, especially for battery-powered automatic control products.
  • with induction blocking time ( default setting : 2.5S block time ) : sensor module output every time after induction (high variableTo the low level), you can set up a blockade followed by time period, during this time period does not accept any inductive sensor signals.This function can be achieved " sensor output time " and " blocking time "interval between the work can be applied to interval detection products; while this feature can effectively inhibit the load switching process for a variety of interference. ( This time can be set to zero seconds- tens of seconds )

 


Hardware interface to KL43Z Freedom board:

image


We are connecting the signal pins of the sensor module as shown below:


VCC > J3-10 > P5V-USB

GND > J3-14

OUT > J4-12 > PTC-1 port pin


image


Components required in our project:

We are using 3 components for this project requirement:


     1) fsl_gpio

     2) fsl_debug_console

     3) wait

 

Component fsl_gpio:


Connections made to fsl_gpio component are


image

We have connected PTC-1 port pin as an input signal which is connected to ‘OUT’ pin signal of the sensor

Pin PTE-31 is connected as output which in turn connected to RED LED to indicate the motion sensor.

 

Component fsl_debug_console:

We have connected debug UART to display the motion sensor output on the terminal

The connection is as shown below:


 

image


Component wait


We have added this component to add delay in our software

 

Software for our project:


Finally our main c program to perform this action is as shown below:


while(1){
    while(GPIO_DRV_ReadPinInput(J4_12)){
         GPIO_DRV_ClearPinOutput(LED2_RED);
         debug_printf("Motion detected\r\n");
         WAIT1_Waitms(500);
   }
   GPIO_DRV_SetPinOutput(LED2_RED);
   debug_printf("Motion not present\r\n");
   WAIT1_Waitms(500);
} // end of while(1)


i.e we are continuously reading the input port pin whether the motion sensor signal is sensed or not?

If sensed positive we are turning the LED on and display the message on the hyper terminal


The output is as shown below after configuring the serial terminal for the baud rate of 19200 and your com port

image


The video output for the same is shown below


image
I have enclosed the project folder and executable for your quick reference and evaluation


Happy Intruder sensing  image image image




Attachments:
KL43-PIR.rar
KL43-PIR-srec.rar
  • Sign in to reply
  • DAB
    DAB over 10 years ago

    Nice post.

     

    I need to dig out my PIR sensor and play around with it.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • bheemarao
    bheemarao over 10 years ago

    Hi

    I have added the video output in below link:

    Interfacing HC-SR501 pyroelectric infrared PIR motion sensor

     

    Best Regards

    Bheema Rao

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube