Code to send the location when PIR sensor and rcwl-0516 detect

Hello.

I am developing the program for a human detection mobile robot. I have a problem with a part of the code that I can't solve. I want to combine the PIR (infrared) sensor and the rcwl-0516 (microwave) sensor to detect a person and once detected, send the location to a device with the Neo 6m GPS. Here's a schematic summary of the code of the main functions:
summary.pdf (40,2 KB)

Well, I have 2 doubts, the first one is the following: in the command if(sensor 1 && sensor 2) {*}, here *, can I put all the GPS code, or I have to put it before and out of the conditional saying that it is LOW and then put a digitalWrite(.., HIGH) inside the conditional?

Then, the other doubt, in the schematic, I have put an order of the functions: movement, Bluetooth and the conditionals of the sensors. Is the order ok or does it have to be a certain one?

Thank you very much in advance.
Greetings.

Have you written a program that simply echoes what the two sensors are saying?

Literally just light an LED when the output form the sensor is saying there is motion, or there is a body present, or whatever. The raw signal, so to speak.

Two LEDs with series limiting resistors placed each to an output pin, code for the reading sensors leading to digitalWrite() on those LED pins.

Both those sensors have a method for reporting that might need some interpretation. There's no better way to get to know these two sensors than to just watch everything they do.

Post that code. No matter what your talents are, it is a good first step.

Have you written code that can do the other part, the part you want a human presence to trigger? But maybe triggered with a button standing in for the condition you want to sense?

Post that code.

TIA

a7

Moderator:
Please don´t cross post threads.

Check your inbox

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.