Wired Door Window Sensor 330mm [S140] 



https://www.youtube.com/watch?v=DPBcD_RDDM0


*GitHubhttps://github.com/rdiot/rdiot-s140.git


* Specs

metals shield anti-fire ABS

connecting mode: N.C. normally closed

rated current : 100mA

rated voltage : 200 VDC

operating distance: more than 15mm, less than 25mm

rated power: 3W

No external power supply, connect to wired or wireless alarm control panel GND and N.C ports directly! Please note that this item not fit to iron door, It will decline magnetic of the sensor.


* Contents

- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,16,2);  // LCD1602

int pushButton = 2;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD1602");

  pinMode(pushButton, INPUT_PULLUP);

  

  delay(1000);


  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S140:Window Sensor");


  int buttonState = digitalRead(pushButton);


  lcd.setCursor(0,1);

  lcd.print("value=" + (String)buttonState + " ");


  if(buttonState == 1)

  {

    digitalWrite(8, HIGH);

  }

  else

  {

   digitalWrite(8, LOW); 

  }

  delay(1);

}

'2) Sensor > Door' 카테고리의 다른 글

433Mhz Button Smart Receiver Doorbell [S220]  (0) 2016.09.12
433Mhz Wireless Door Contact Sensor [S212]  (0) 2016.09.12
Electromagnetic Door Lock 12V [S182]  (0) 2016.09.12
Posted by RDIoT
|