Help with Project


#1

I am making a motion sensor security system. can anyone help


#2

I am making an Analog to digital converter…Can i get help for parts list and comprehensive circuit diagram please?


#3

Hi fazefaiz,
what help you want,in your code or in hardware?
but if you use the “PIR Motion Sensor” ,its very easy to use it have three pin VCC GND and OUTPUT
if you have any movement the output will be 5V else it will be 0V .
and if you want help in your code we can help you to make it in interrupt mode.
i wish i can help you.


#4

Here is the code as well as the schematics for this project :smiley:
If you’d like you can switch out the LED for a buzzer, that’s what I did. :stuck_out_tongue:

Click me for the code!

/*

  • PIR sensor tester

*/

int ledPin = 13; // choose the pin for the LED

int inputPin = 2; // choose the input pin (for PIR sensor)

int pirState = LOW; // we start, assuming no motion detected

int val = 0; // variable for reading the pin status

void setup() {

pinMode(ledPin, OUTPUT); // declare LED as output

pinMode(inputPin, INPUT); // declare sensor as input

Serial.begin(9600);

}

void loop(){

val = digitalRead(inputPin); // read input value

if (val == HIGH) { // check if the input is HIGH

digitalWrite(ledPin, HIGH);  // turn LED ON

if (pirState == LOW) {

  // we have just turned on

  Serial.println("Motion detected!");

  // We only want to print on the output change, not state

  pirState = HIGH;

}

} else {

digitalWrite(ledPin, LOW); // turn LED OFF

if (pirState == HIGH){

  // we have just turned off

  Serial.println("Motion ended!");

  // We only want to print on the output change, not state

  pirState = LOW;

}

}

}