DIY – Arduino KAKU 433mhz PIR sensor for PiMatic

The Arduino project below can be used to create a K(lik)A(an)K(lik)U(it) PIR sensor for monitoring presence in PIMatic. This project is using the 433mhz libraries for Arduino (link).

To build this cool Arduino Project you’ll need the following parts:
Arduino (any kind)
PIR Sensor (Ebay)
433 transmitter (Ebay)
Some jumperwires
And the most important… You’ll need a working PIMatic installation with a Homeduino connected!

Arduino Sketch

//--- START ---
#include <RemoteTransmitter.h>
KaKuTransmitter kaKuTransmitter(11);
int statePin = LOW;
volatile byte motion;
void setup()
 attachInterrupt(0, motion_detect, RISING);//Initialize the interrupt pin for PIR Sensore (Arduino digital pin 2)
void loop()
void motion_detect()//This function is called whenever presence is detected by the arduino
 kaKuTransmitter.sendSignal('M',25,2,true);//Sends KAKU singal
//---- END ----

If you want to create multiple Arduino KAKU 433mhz PIR sensors you can change the number 25 in to change the ID of the sensor (example below):

Unit: 25
ID: 26
Unit: 24
ID: 26
Unit: 25
ID: 10

When your Arduino KAKU 433mhz PIR sensor is ready you’ll need to create a device in the PIMatic config file. You’ll need to create a new device (example below):

      "id": "433_PIR01",
      "name": "PIR Gang",
      "class": "HomeduinoRFPir",
      "protocols": [
          "name": "pir1",
          "options": {
            "unit": 25,
            "id": 26

Once created the device you can use it in a rule (example below):

      "id": "beweging-op-trap",
      "name": "Beweging op trap",
      "rule": "if presence of 433_PIR01 is equal to present and it is after 20:00 and before 23:59 or it is after 00:00 and before 02:00 then execute \"/usr/bin/hyperion snake\"",
      "active": true,
      "logging": true