光電對射式計數感測器模組 10mm槽寬 光遮斷式電機馬達測速感測器 紅外計數傳感器模組

光電對射式計數感測器模組 10mm槽寬 光遮斷式電機馬達測速感測器 紅外計數傳感器模組

NT$48 未稅

LM393 光電對射式計數感測器模組 10mm槽寬 光電對射計數傳感器 紅外計數傳感器模組

計數感測器, LM393 測速感測器, 測速感測器模組, 光遮斷器模組, 計數器模組, 電機測試模組, 槽型光耦模組

Slotted LM393 Beam Infrared Light Counter Photoelectric Sensor Module

尚有庫存

  • 商品說明

商品說明

光電對射式計數感測器模組 10mm槽寬 光遮斷式電機馬達 測速感測器 紅外計數傳感器模組

Slotted LM393 Beam Infrared Light Counter Photoelectric Sensor Module

一、PCB兩圓孔(點到點中心的距離)為 1.5cm,孔徑為0.3cm

二、槽型光耦槽寬10mm

三、主要芯片:LM393、槽型光耦H2010

四、工作電壓:直流5伏

五、特點:
1 、具有信號輸出指示。
2 、單路信號輸出。
3 、有遮擋物時輸出高電平(LED燈滅),無遮擋物時輸出低電平(LED燈亮)
4 、靈敏度不可調。
5 、可用於工件計數、電機測速。。。。
6 、電路板輸出開關量!

LM393 光電對射式計數感測器模組產品特點

一、長尺寸:27.6mm X寬20mm X高17mm
二、主要晶片:LM393、對射式紅外頭
三、工作電壓:直流5伏
四、特點:
1 、具有信號輸出指示。
2 、單路信號輸出。
3 、輸出有效信號為低電平。
4 、靈敏度不可調。
5 、可用於工件計數、電機測速。
6 、電路板輸出開關量!

範例碼

int encoder_pin = 2; // The pin the encoder is connected 
unsigned int rpm; // rpm reading
volatile byte pulses; // number of pulses
unsigned long timeold; 
// The number of pulses per revolution
// depends on your index disc!!
unsigned int pulsesperturn = 20;

 void counter()
 {
 //Update count
 pulses++; 
 }

void setup()
 {
 Serial.begin(9600);
 //Use statusPin to flash along with interrupts
 pinMode(encoder_pin, INPUT);
 
 //Interrupt 0 is digital pin 2, so that is where the IR detector is connected
 //Triggers on FALLING (change from HIGH to LOW)
 attachInterrupt(0, counter, FALLING);
 // Initialize
 pulses = 0;
 rpm = 0;
 timeold = 0;

 }

 void loop()
 {
 if (millis() - timeold >= 1000){ /*Uptade every one second, this will be equal to reading frecuency (Hz).*/
 
 //Don't process interrupts during calculations
 detachInterrupt(0);
 //Note that this would be 60*1000/(millis() - timeold)*pulses if the interrupt
 //happened once per revolution
 rpm = (60 * 1000 / pulsesperturn )/ (millis() - timeold)* pulses;
 timeold = millis();
 pulses = 0;
 
 //Write it out to serial port
 Serial.print("RPM = ");
 Serial.println(rpm,DEC);
 //Restart the interrupt processing
 attachInterrupt(0, counter, FALLING);
 }
 }