Develop an interfacing circuit and a sketch for intruder alert system that uses PIR sensor and GSM modem. Upon intruder detection send SMS – “Alert : Intruder detected”. Repeat the same at 10 second interval till a reset button is pressed.

Here i am using online IDE Tinkercad . If you don't know what is tinkercad then refer my blog HERE or else you can use offline IDE also.

Code:-

void setup() {

  pinMode(2, INPUT); //Pin 2 as INPUT

  pinMode(3, OUTPUT); //PIN 3 as OUTPUT

}

 

void loop() {

  if (digitalRead(2) == HIGH)

  {

  digitalWrite(3, HIGH);   // turn the LED/Buzz ON

  delay(100);                       // wait for 100 msecond

  digitalWrite(3, LOW);   // turn the LED/Buzz OFF

  delay(100);                       // wait for 100 msecond

  }

}


Output:-



Comments

Popular Posts

Set the time using four switch and display the clock on LCD using arduino ** SW1 : when press, increment 1 digit ** SW2 : when press, decrement 1 digit ** SW3 : when press, display set time and start the clock ** SW4 : when press, reset the clock

Connect switch to Arduino. If switch is on than print ”ON” else print “OFF” on serial monitor.

Interface 4 push button with arduino & do following: ** SW1 : when press, display 0 to 9 on LCD ** SW2 : when press, display 00 to 99 on LCD ** SW3 : when press, display 000 to 999 on LCD ** SW4 : when press, display 0000 to 9999 on LCD