#include < Wire.h >
#include < RTClib.h >
#include < SoftwareSerial.h >
// Pin Definitions
#define LD2410_OUT_PIN 2 // Motion detection output
#define LED_PIN 5 // LED control
#define LDR_PIN A0 // Light sensor
#define SIM800_RX_PIN 6 // SIM800L TX
#define SIM800_TX_PIN 8 // SIM800L RX
// Thresholds - Fixed the night time hours to match your description
#define LDR_THRESHOLD 500
#define NIGHT_START 22 // 10PM (22:00)
#define NIGHT_END 5 // 5AM
RTC_DS3231 rtc;
SoftwareSerial sim800(SIM800_TX_PIN, SIM800_RX_PIN); // SIM800L
bool systemActive = false;
bool motionDetected = false;
bool isNightTime = false;