Back to Parent

Process:

I started with referring to projects involving motion detection, alarm systems, proximity detection etc on hackster and other resources. I needed to achieve two things:

a. Detect motion and provide a visual cue for the same

b. Ring a buzzer to alert the user about the motion detected

Hence, I started with figuring out about how the sensor works and needs to be connected. I initially connected the sensor and LED only. The circuit was pretty straightforward and I could make the LED light up by running the code. The next step was to connect the buzzer. Once the buzzer was brought into the circuit, making it work was considerably easy. The problem was with making it stop. Once the buzzer was triggered it was important to switch it off once the user was alerted. I introduced the "triggered" variable and put in  a condition in my code to only ring the buzzer when "triggered = true". This completed my circuit and my code.

Once everything was set up and I run the code a few times, I realized, that the buzzer was going off even when there was no motion around the sensor. After some research and on the recommendation of my Professor, I added a line of code that allowed the sensor to be calibrated for a minute before detecting motion. I also adjusted the time sensitivity and motion sensitivity on the PIR sensor to get better readings. To ensure that the program was running correctly, I also added the serial command which told me whether the PIR value was 0 (no motion detected) or 1 (motion detected). After these few changes the sensor seemed to working better, however, it was still quite sensitive to external interference. 


Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0