Assignment -2 Report
Assignment -2 Report
ASSIGNMENT-2
GENERATION OF PIR PULSE SIGNAL
Aim: To simulate a PIR (Passive Infrared) sensor output by
generating a HIGH pulse using an Arduino, in order to test and verify
motion detection response systems without using an actual PIR sensor
Theory:
A Passive Infrared (PIR) sensor is commonly used in motion
detection systems. It detects infrared radiation emitted by warm
objects (like humans or animals) within its range. When motion is
detected, the PIR sensor outputs a HIGH signal; otherwise, it remains
LOW. These sensors are widely used in applications like security
systems, automatic lighting, and home automation.
In this experiment, instead of using an actual PIR sensor, we simulate
its output using an Arduino microcontroller on Tinkercad, a browser-
based circuit simulator. The simulation involves generating a digital
HIGH pulse on a specific pin to mimic the behavior of a PIR sensor
during motion detection. This HIGH pulse represents the moment
when the PIR sensor would normally detect motion and activate
connected devices like LEDs or buzzers.
The purpose of this simulation is to test and verify the functioning of
systems that respond to PIR sensor signals without needing the
physical sensor. By doing so, developers and students can prototype
and debug motion-sensitive circuits efficiently in a virtual
environment.
This technique demonstrates how digital signals can be controlled in
software to simulate real-world sensor behavior, making it easier to
test response logic, component interactions, and timing without
hardware constraints.
Code:
#define PIR_SENSOR 3 // PIR sensor is connected to digital pin 3
#define LED 12 // Onboard LED is connected to digital pin 13
void setup() {
pinMode(PIR_SENSOR, INPUT); // Set PIR sensor pin as input
pinMode(LED, OUTPUT); // Set LED pin as output
Serial.begin(9600); // Start serial communication at 9600
baud
}
void loop() {
int motionDetected = digitalRead(PIR_SENSOR); // Read the state
of the PIR sensor
Project link:
https://www.tinkercad.com/things/98dZmcuJmF6-dazzling-esboo-
wluff/editel?returnTo=https%3A%2F%2Ffanyv88.com%3A443%2Fhttps%2Fwww.tinkercad.com%2Fdas
hboard
Conclusion:
The simulation carried out on Tinkercad successfully demonstrated
how an Arduino can be used to generate a HIGH pulse to simulate the
output of a PIR sensor. The virtual environment allowed us to test the
behavior of a motion detection system without the need for physical
hardware. The simulated HIGH pulse on the output pin effectively
imitated motion detection, enabling us to verify the response of
connected components (such as LEDs or other devices).