磁控传感器:修訂版本之間的差異

出自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 電子工作室