Use as a motion detection device?

Pretty new to meshtastic. I have a few TBeams, was thinking of an interesting to me project, of making like a monitored wireless perimeter. If these could be wired to a pir motion sensor and send a canned message when tripped, then just go back to sleep. Would this be difficult to do?

1 Like

Umm … could possibly use the external notification plugin. for your use, it just needs a gpio input defined for your application. I suspect it’ll be ~15 lines of code.

1 Like

What do you think about these in your professional opinion?

No experience with them.

Different sensors have varying requirements on the hardware and software side of things. One of the challenges of your project will be weather proofing your device and the sensor of choice.

I think it would be relatively simple to modify a solar motion light to help keep the battery charged, and provide the sensor and the enclosure.

1 Like

This is one of the solar lights I was playing with.

The light could be replaced with a mini relay that changes the state of the chosen gpio pin. Could probably do the same and save some energy with the right transistor setup.


1 Like

Voltage divider may be easier … just uses two resistors :slight_smile:

1 Like



Xaio PIR sketch

int LED = 13;             // the pin that the LED is atteched to
int PIR = 5;              // the pin that the sensor is atteched to

void setup() {
  pinMode(LED, OUTPUT);   // initalize LED as an output
  pinMode(PIR, INPUT);    // initialize sensor as an input
  Serial.begin(38400);     // initialize serial
  Serial1.begin(38400);
}

void loop(){
  if (digitalRead(PIR) == HIGH) { // check if the sensor is HIGH
    digitalWrite(LED, HIGH);      // turn LED ON 
    Serial.println(":Motion!:"); 
    Serial1.println(":Motion!");
    delay(10000);                   // delay 100 milliseconds 
  } 
  else {
    digitalWrite(LED, LOW);       // turn LED OFF
    Serial.println("Motion stopped!");
    delay(10000);                   // delay 100 milliseconds
  }
}
3 Likes