找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索
查看: 10555|回復(fù): 8
收起左側(cè)

51單片機(jī)HC-SR501人體感應(yīng)模塊資料庫與代碼

  [復(fù)制鏈接]
ID:426236 發(fā)表于 2018-11-14 11:19 | 顯示全部樓層 |閱讀模式
人體紅外感應(yīng)實(shí)物圖:
0.png
0.png

單片機(jī)源程序如下:

  1. /*********************************************************************************************
  2. The name of the program: <Pyroelectric sensor module>     
  3. Date:  2012 04 09
  4. hardware:mcu(stc12c5a60s2),Operational Amplifier(lm324),Pyroelectric sensor module,etc
  5.                                                                
  6. /*********************************************************************************************/

  7. #include<stc12c5a60s2.h>  
  8. #define uchar unsigned char
  9. #define uint unsigned int
  10. /*********************************************************************************************/
  11. void Delay_us(unsigned int x)
  12. {
  13.         while(x--);
  14. }
  15. /*********************************************************************************************/
  16. void delay(int x)
  17. {
  18.         uchar i,j;
  19.         for(i=0;i<x;i++)
  20.                 for(j=0;j<110;j++);
  21. }
  22. /*********************************************************************************************/
  23. void ADC_one()       //Only channel P1.0
  24. {
  25.         P1ASF=0x1f;   
  26.         ADC_CONTR=0x00;
  27.         AUXR1=0x00;               
  28.         ADC_CONTR=0x80;
  29.         Delay_us(2);
  30.         ADC_CONTR=0x88;     
  31.         Delay_us(2);
  32.         while(ADC_CONTR==0x88);
  33.         ADC_CONTR=0;     
  34. }
  35. /*********************************************************************************************/

  36. void main()
  37. {       
  38.         while(1)
  39.         {
  40.                 float num=0;
  41.                 uint resl=0;
  42.                 ADC_one();            
  43.                 resl=ADC_RES;
  44.                 resl=(resl<<2)+ADC_RESL;
  45.                 num=resl/1024.0*5;   
  46.                 num=num*1000;

  47.                 if(num>2700)
  48.                 {
  49.                         P2=0XEF;//Light-emitting diode is lit
  50.                 }
  51.                 else
  52.                         P2=0XFF;        //Light-emitting diode is extinguished
  53.         }       
  54. }
  55. /*********************************************************************************************/
復(fù)制代碼

1 Piece HC-SR501 High Sensitivity Human Infrared Sensor Module Pyroelectric PCB
Article-Nr.:2802164
Product Details:
•  Human Infrared Sensor Module
•  Condition: New
•  :Product Feature:
Probe LHI778, high sensitivity
•  Technical parameters: 1.Operating voltage: DC5V to 20V
2.Static power consumption: 65 microamps
3.Level output: 3.3V, low 0V
4.Delay time: adjustable (0.3 seconds to 18 seconds)
5.Blockade Time: 0.2 seconds
6.Trigger Mode: L can not be repeated, H can be repeated default value H
7.Sensing range: less than 120 degree cone angle of less than 7 meters
8.Operating temperature: -15 to +70 degrees
9.PCB Dimensions: 32 * 24mm, screw hole distance 28mm, screw aperture 2mm sensor lens size: (diameter): 23mm (default)
•  Features: 1. automatic induction: when someone enters its sensing range input high, people leave the sensor range automatic delay off high. Output low

2. photosensitive control (optional): module is reserved for the location, you can set the photosensitive control, daytime or light sensing. The photosensitive Control optional features not installed at the factory photoresistor. If necessary, please purchase separately photoresistor install it yourself

3. two trigger modes: L can not be repeated, H can be repeated. Jumper selectable, default is H

A. not repeat the trigger mode: the sensor output high, the delay time has elapsed, the output automatically from high to low.
B. repeatable trigger mode: the sensor output high, the delay period, if human activities within its sensing range, the output will always remain high until people leave only delay the high level goes low (sensor module detected after every activity of the body's automatic postponed a delay period of time, and the last time activities as the starting point of the delay time)

4. induced blockade time (default setting: 0.2 seconds): sensing module in every sensor output (high to low) followed by set up a blockade of the time, in this period of time the sensor is not receiving any induction signal. This feature can be achieved both of the (inductive output time and the blocking time) interval can be applied to the interval detection products; This feature can effectively suppress the various interference generated in the process of load switching

5. wide operating voltage range: default Voltage DC5V to 20V

6. micro-power: quiescent current of 65 microamps, particularly suitable for battery- powered electrical products

7. output high signal: easy to achieve docking with the various types of circuits
•  Instructions for use:
1. Sensing module is powered initialization time of about one minute, during which the module will output 0-3 times the interval, one minute after entering standby
2. Should avoid lights and other sources of interference the a close direct module surface of the lens, in order to avoid the introduction of the interference signal malfunction; using the environment as much as possible to avoid the flow of the wind, the wind will cause interference sensor
3. Sensing module uses dual probe, the probe window is rectangular, dual (A $ B $) in the long direction at both ends, from left to right or from right to left when the body is walked by infrared spectroscopy reach the dual time, distance difference, the greater the difference, the more sensitive the induction, when the human body from the front to the probe or from top to bottom or from the bottom to the previous direction came dual detection distance of less than infrared spectroscopy, no difference value, the sensor should be installed up to the direction of the probe dual direction with human activities as parallel as possible to ensure that the human body has been passed by the probe dual induction sensor insensitive or does not work; Round lens in order to increase the sensing range of angles, the module also makes the probe surrounded induction, but the left and right sides still up and down both directions sensing range and sensitivity, still need to try to install the above requirements
•  Color: show as pictures
PLS NOTE that due to lighting effects, monitor's brightness / contrast settings etc, it could be some minor differences in the hue of the images and the actual item


所有資料51hei提供下載:
HC-SR501人體感應(yīng)模塊.rar (2.62 MB, 下載次數(shù): 208)



回復(fù)

使用道具 舉報(bào)

ID:256517 發(fā)表于 2019-3-13 19:39 | 顯示全部樓層
很不錯(cuò)的資源
回復(fù)

使用道具 舉報(bào)

ID:256517 發(fā)表于 2019-3-13 19:40 | 顯示全部樓層
很不錯(cuò)的帖子,謝謝
回復(fù)

使用道具 舉報(bào)

ID:524170 發(fā)表于 2019-4-29 08:34 | 顯示全部樓層
很不錯(cuò)的帖子,謝謝
回復(fù)

使用道具 舉報(bào)

ID:349854 發(fā)表于 2019-6-22 10:01 | 顯示全部樓層
感謝po主,正好需要
回復(fù)

使用道具 舉報(bào)

ID:634955 發(fā)表于 2019-11-21 14:44 | 顯示全部樓層
有沒有at89x52的程序和仿真
回復(fù)

使用道具 舉報(bào)

ID:638921 發(fā)表于 2019-11-29 21:53 | 顯示全部樓層
可以教教我51單片機(jī)與HC-SR501之間怎么連接嗎
回復(fù)

使用道具 舉報(bào)

ID:356967 發(fā)表于 2022-9-20 11:26 | 顯示全部樓層
這不某一個(gè)寶給的資料嗎?我還以為是51的
回復(fù)

使用道具 舉報(bào)

ID:1064915 發(fā)表于 2023-9-27 09:34 | 顯示全部樓層
       ADC_RES和ADC_RESL是用于保存A/D轉(zhuǎn)換結(jié)果的寄存器,當(dāng)AUXR1=0x00時(shí),轉(zhuǎn)換結(jié)果的高八位存于ADC_RES,低二位存于ADC_RESL;當(dāng)AUXR1=0x04時(shí),轉(zhuǎn)換結(jié)果的高八位存ADC_RESL,低二位存于ADC_RES;
      取十位完整結(jié)果:
       eq.png
      其中Vcc為單片機(jī)的供電電壓,Vin為輸入電壓;
      eq (1).png

回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表