Concept
Read moreA basic motion detection system using an ESP32 and PIR sensor that sends alerts (LED + optional buzzer / serial message). It demonstrates real-world security application, which aligns well with your Element14 challenge theme.
💻 Code (Arduino IDE)
#define PIR_PIN 13
#define LED_PIN 2
#define BUZZER_PIN 4
void setup() {
pinMode(PIR_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
pinMode(BUZZER_PIN, OUTPUT);
Serial.begin(115200);
}
void loop() {
int motion = digitalRead(PIR_PIN);
if (motion == HIGH) {
Serial.println("Motion Detected!");
digitalWrite(LED_PIN, HIGH);
digitalWrite(BUZZER_PIN, HIGH);
delay(1000);
} else {
digitalWrite(LED_PIN, LOW);
digitalWrite(BUZZER_PIN, LOW);
}
}How It Works- PIR detects infrared changes → motion detected
- ESP32 processes signal
- LED + buzzer alert instantly
- Serial monitor logs activity
4 projects • 2 followers
Firmware engineer focused on embedded systems, low-level programming, and reliable MCU firmware development.









Comments