單筆滿 NT$1,000 免運費
10mm槽寬 LM393 光電對射式計數感測器模組 | 馬達測速 | 紅外線遮斷開關 | 附 Arduino 範例
Arduino-17%

10mm槽寬 LM393 光電對射式計數感測器模組 | 馬達測速 | 紅外線遮斷開關 | 附 Arduino 範例

NT$ 40NT$ 48NT$ 8
貨號
75645613(B4-11)
分類
運動及位置感應器
庫存
有庫存(0)
1

商品說明 Slotted LM393 Beam Infrared Light Counter Photoelectric Sensor Module 產品參數 PCB兩圓孔(點到點中心的距離)為 1.5cm,孔徑為0.3cm 槽型光耦槽寬10mm 主要晶片:LM393、槽型光耦H2010 工作電壓:直流5伏 產品特點: 具有信號輸出指示。 單路信號輸出。 有遮擋物時輸出高電平(LED燈滅),無遮擋物時輸出低電平(LED燈亮) 靈敏度不可調。 可用於工件計數、電機測速。。。。 電路板輸出開關量! 範例碼 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); } }

訂閱電子報

搶先收到新品上架、優惠活動與技術資訊

宸揚資科 JWISDOM SYSTEM INC.

宸揚始終相信,『軟體科技是改變力量』,持續在這條道路前行堅持,在團隊的合作過程樂於分享與協作。在明確目標下勇往直前,不怕困難,突破自我,歡迎勇於冒險的夥伴與我們共同創造精采。

關於

幫助

聯絡我們

  • Address: 台南市東區東門路二段297號5F
  • Phone: +(886) 6-234-0161
  • Fax: +(886) 6-234-0171
  • Email: [email protected]

© 2026 宸揚資科 JWISDOM SYSTEM INC. All rights reserved.

安全付款
VISAJCBATM超商