I'm working on an Arduino project that involves Arduino UNO, PIR sensor and a GSM Module. The idea is to send an SMS when a motion is detected. I've given about 1 minute delays between reading values from the sensor. However, I've noticed that the control goes back to the setup() function every time it reads from the sensor. I'm wondering why this is happening. I don't have any interrupts, just delay(). And all the logic is coded inside the loop() function.
Any idea why the control goes back to the setup()?