“磁控传感器”的版本间的差异

来自YFRobotwiki
跳转至: 导航搜索
(以“ 磁控传感器模块 === 产品简介 === <br> 磁控传感器模块是一个发声的电子模块。 === 规格参...”为内容创建页面)
 
第6行: 第6行:
 
=== 产品简介 ===
 
=== 产品简介 ===
 
<br>
 
<br>
 磁控传感器模块是一 的电 子模块
+
 磁控传感器模块 是采用进口全镀金干簧管设计制作,干簧管(Reed Switch)也称舌簧管或磁簧开关, 是一 种磁敏的特殊开关。它是由Western Electric 公司在1940年 。其它主要元件是开或关的弹性簧片及磁铁或 磁铁;经过几十年的改进,它的稳定性更进一步。它寿命可以达到百万次以上。而且干簧管对于坏境的要求也比较低(如不受湿度影响),相对霍尔传感器,它的使用范围更加广。
 +
 
 +
更多干簧管参数请查看页末 --> 参考资料
  
  
第12行: 第14行:
 
=== 规格参数 ===
 
=== 规格参数 ===
 
<br>
 
<br>
*供电电压:DC3.3 - 5V
+
*供电电压:DC3.3 5V
 +
*输入要求:外部磁场 > 5 高斯
 +
*敏感距离:0 ~ 20mm
 +
*开关电流范围:0 ~ 2A
 +
*开关电压范围:0 ~ 200V
 +
*工作温度范围:-55 ~150℃
 
*安装孔径:3MM
 
*安装孔径:3MM
 
*模块尺寸:31*21*10.1MM(长*宽*高)
 
*模块尺寸:31*21*10.1MM(长*宽*高)
第41行: 第48行:
 
:'''示例代码'''
 
:'''示例代码'''
 
<pre>
 
<pre>
//passive Buzzer test
+
// Reed Switch Test
//simulate the ambulance voice by passive Buzzer
+
  
int buzzer=6; //set pin
+
#define ledPin 13          //define LED pin
 +
#define reed_switchPin 7  //define reed switch Pin
 +
int reed_switchValue = 0;
  
 
void setup() {  
 
void setup() {  
 
+
   pinMode(ledPin,OUTPUT);  
   pinMode(buzzer,OUTPUT);
+
   pinMode(reed_switchPin,INPUT);
    
+
 
}
 
}
  
void loop() {
+
void loop()  
   unsigned char i,j;
+
{  
   while(1)
+
   reed_switchValue = digitalRead(reed_switchPin);
   {
+
    
    for(i=0;i<80;i++) //make frequency of a sound
+
   if(reed_switchValue == LOW) {
     {
+
     digitalWrite(ledPin,HIGH);   // detect the external magnetic field , set the LED on
      digitalWrite(buzzer,HIGH);
+
  }
      delay(1);
+
  else {
      digitalWrite(buzzer,LOW);
+
     digitalWrite(ledPin,LOW);   // or set the LED off
      delay(1);
+
   }
    }  
+
    for(i=0;i<100;i++) //make another frequency of a sound
+
     {
+
      digitalWrite(buzzer,HIGH);
+
      delay(2);
+
      digitalWrite(buzzer,LOW);
+
      delay(2);
+
    }
+
   }  
+
 
}
 
}
 
</pre>
 
</pre>
 程序下载地址:[http://pan.baidu.com/s/1eQ8SmzC passiveBuzzer_test]
+
 程序下载地址:[http://pan.baidu.com/s/1ntu0M3f ReedSwitchTest]
  
 程序运行结果: 给无源蜂鸣器两种不同频率 使其发出两种声音 模拟救护车声音
+
 程序运行结果: 当干簧管检测到外部磁场后 内部弹片吸合 检测到电平,点亮LED,否则熄灭LED
  
  
第81行: 第79行:
 
===参考资料===
 
===参考资料===
 
<br>
 
<br>
* [http://baike.baidu.com/view/183969.htm 蜂鸣 简介]
+
* [http://pan.baidu.com/s/1kTAJU67 干簧管与霍尔传感 选择和比较]
 +
* [http://pan.baidu.com/s/1nttKSXz OKI干簧管手册]
  
  

2015年8月29日 (六) 16:51的版本

生成缩略图出错:文件可能丢失:
磁控传感器模块


产品简介


磁控传感器模块是采用进口全镀金干簧管设计制作,干簧管(Reed Switch)也称舌簧管或磁簧开关,是一种磁敏的特殊开关。它是由Western Electric 公司在1940年发明的。其它主要元件是开或关的弹性簧片及磁铁或电磁铁;经过几十年的改进,它的稳定性更进一步。它寿命可以达到百万次以上。而且干簧管对于坏境的要求也比较低(如不受湿度影响),相对霍尔传感器,它的使用范围更加广。

更多干簧管参数请查看页末 --> 参考资料。


规格参数


  • 供电电压:DC3.3 ~ 5V
  • 输入要求:外部磁场 > 5 高斯
  • 敏感距离:0 ~ 20mm
  • 开关电流范围:0 ~ 2A
  • 开关电压范围:0 ~ 200V
  • 工作温度范围:-55 ~150℃
  • 安装孔径:3MM
  • 模块尺寸:31*21*10.1MM(长*宽*高)
  • 孔间距:15MM
  • 模块重量:4.3g


引脚说明


  • 1. G -- Gnd(地)
  • 2. V -- Vcc(电源+5V)
  • 3. S -- Sign(信号)


应用示例


电路连接示意图


磁控传感器模块的 G、V、S分别连接 Arduino UNO的GND、VCC(+5V)、D7引脚。



示例代码
// Reed Switch Test

#define ledPin 13           //define LED pin
#define reed_switchPin 7   //define reed switch Pin
int reed_switchValue = 0;

void setup() { 
  pinMode(ledPin,OUTPUT); 
  pinMode(reed_switchPin,INPUT); 
}

void loop() 
{ 
  reed_switchValue = digitalRead(reed_switchPin);
  
  if(reed_switchValue == LOW) {
    digitalWrite(ledPin,HIGH);   // detect the external magnetic field , set the LED on
  }
  else { 
    digitalWrite(ledPin,LOW);    // or set the LED off
  }
}

程序下载地址:ReedSwitchTest

程序运行结果:当干簧管检测到外部磁场后,内部弹片吸合,检测到电平,点亮LED,否则熄灭LED。


参考资料





返回首页

更多建议和问题欢迎反馈至 YFRobot论坛

购买方式:YFRobot 电子工作室