#define LED_PIN D5 void setup() { pinMode(LED_PIN, OUTPUT); Serial1.begin(115200); digitalWrite(LED_PIN, LOW); } void loop() { if (Serial1.available()) { String data = Serial1.readStringUntil('\n'); if (data == "DETECTED") { digitalWrite(LED_PIN, HIGH); } else if (data == "NO_PERSON") { digitalWrite(LED_PIN, LOW); } } }