/* * PIR Motion Sensor Simulation for Proteus * Output: LED on Pin 13 turns ON when motion detected */ int pirPin = 2; // PIR output pin int ledPin = 13; // Built-in LED int pirState = LOW; // Current state of PIR int val = 0; // Reading from PIR
Introduction Passive Infrared (PIR) sensors are widely used in motion detection projects, such as security alarms, automatic lighting, and occupancy sensors. When simulating an embedded system in Proteus Design Suite, having a working PIR sensor model is essential. Unfortunately, Proteus does not include a native PIR sensor library . However, you can easily add a third-party PIR library or create a virtual simulation using alternative components.
void loop() val = digitalRead(pirPin);
if (val == HIGH) digitalWrite(ledPin, HIGH); if (pirState == LOW) Serial.println("Motion detected!"); pirState = HIGH;
else digitalWrite(ledPin, LOW); if (pirState == HIGH) Serial.println("Motion stopped."); pirState = LOW;
void setup() pinMode(pirPin, INPUT); pinMode(ledPin, OUTPUT); Serial.begin(9600);
Last updated: 2026
/* * PIR Motion Sensor Simulation for Proteus * Output: LED on Pin 13 turns ON when motion detected */ int pirPin = 2; // PIR output pin int ledPin = 13; // Built-in LED int pirState = LOW; // Current state of PIR int val = 0; // Reading from PIR
Introduction Passive Infrared (PIR) sensors are widely used in motion detection projects, such as security alarms, automatic lighting, and occupancy sensors. When simulating an embedded system in Proteus Design Suite, having a working PIR sensor model is essential. Unfortunately, Proteus does not include a native PIR sensor library . However, you can easily add a third-party PIR library or create a virtual simulation using alternative components.
void loop() val = digitalRead(pirPin);
if (val == HIGH) digitalWrite(ledPin, HIGH); if (pirState == LOW) Serial.println("Motion detected!"); pirState = HIGH;
else digitalWrite(ledPin, LOW); if (pirState == HIGH) Serial.println("Motion stopped."); pirState = LOW;
void setup() pinMode(pirPin, INPUT); pinMode(ledPin, OUTPUT); Serial.begin(9600);
Last updated: 2026