obniz Parts Library

Keyestudio_PIR

GitHub
Keyestudio_PIR
Usable Devices :
obniz_board
Found at :

Keyestudio PIR

Keyestudio PIR sensor. It is used tot detects human/animals' motion.

wired(obniz, {signal [,vcc, gnd]})

connect to the obniz Board.

name type required default description
signal number(obniz Board io) yes   Signal pin outputs value of sensor(s pin of Keyestudio)
vcc number(obniz Board io) no   VCC for sensor(+ pin of Keyestudio)
gnd number(obniz Board io) no   GND for sensor(- pin of Keyestudio)
// Javascript Example
var sensor = obniz.wired("Keyestudio_PIR", {signal:0, vcc:1, gnd:2});
sensor.onchange = function(val){
  console.log(val ? 'Moving Something!' : 'Nothing moving');
}

onchange = function(value)

It called when something changed.
It humans is closing to a sensor, this function will called with value true.
If a humans leaves or if a human stops moving, this function will called with value false.
After true, it basically becomesfalse immediately.

// Javascript Example
var sensor = obniz.wired("Keyestudio_PIR", {signal:0, vcc:1, gnd:2});
sensor.onchange = function(val){
  console.log(val ? 'Moving Something!' : 'Nothing moving');
}

Supported from: obnizOS 3.5.0

You will Get in Few Days

Circuit for Starter “obniz Board” is available on Amazon and other online stores.
You can get it at below

Our products and resellers

Forum

Visit our developer’s forum to discuss and discover technologies.

Forum

Contact

Feel free to contact out support and technical team.

Contact us