• Home
  • Prakash
    • R and D
    • Smart Home
  • Basics
    • Capacitors
      • Color codeing Disc Capacitor Capacitor characterstics Polarity Non Polarity Series Connection Parallel Connection
    • Diodes
      • Zener Diode Light Emitting Diode Signal Diode Photo Diode
    • Inductors
    • Transistor
      • Silicon Germenium NPN PNP MOSFET SCR
    • Resistors
      • Color codeing 4-Band 5-Band Series Parallel Potential Meter
    • Logics
      • Analog Logic
      • Digital Logic
      • Hexa Decimal Numbers
      • Octal Numbers
      • Binary Fraction
      • Binay to Decimal
    • OP-Amplifiers
      • Basics
      • Oscillators
      • Transistor Switch
      • 555 IC circuits
      • Waveform Generators
      • 741 IC Circuits
    • Power supply
      • Transformer
      • Halfwave Rectifier
      • Fullwave Rectifier
      • Bridge Rectifier
      • 78xx Series
      • 0 to 30v Regulator
  • Modules
    • H-Bridge
      • L293D Bridge
      • Relay Bridge
    • RF 434MHz Modules
    • Relay Modules
    • Push to ON switch
    • Push to OFF switch
  • Sensors
    • Analog sensors List-1
      • LDR Photo Diode Solar Cell Transducers Temperature Humidity Sensor Soil Moisture Ranger Sensor Range Detection
    • Analog sensors List-2
      • Flame Sensor Force Sensor Flex Sensor Ambient Sensor Motion Sensor Vibration Sensor Sound Sensor UltraSonic Sensor GrayScale Sensor
    • Digital Sensors
      • Touch Sensor Tilt Sensor Signal
    • 3-Axis Sensor
    • Gyro Sensor
  • Projects
    • Embedded
      • Mini Projects 8051 Arduino NodeMCU MSP430 Raspberry IOT ARM
    • C #
      • Visual Basic Visual Studio
    • Matlab
    • VLSI
    • PHP-HTML
    • Contribute
  • Downloads
  • Technology

MY TEST CODE

int sensor1=2;
int sensor2=3;
int sensor3=4;
int x;
int y;
int z;
int state;
int flag=0;
int led1 =5;
int led2 =6;
int led3 =7;
int reset = 8;
int buz =13;
boolean s1,s2,s3;
void setup()
{
  pinMode(sensor1,INPUT);
  pinMode(sensor2,INPUT);
  pinMode(sensor3,INPUT);
 
  pinMode(led1,OUTPUT);
  pinMode(led2,OUTPUT);
  pinMode(led3,OUTPUT);
  pinMode(reset,OUTPUT);
 
  digitalWrite(led1,LOW);
  digitalWrite(led2,LOW);
  digitalWrite(led3,LOW);
  digitalWrite(buz,LOW);
  Serial.begin(9600);
  delay(2000);
    Serial.println("AT+CNMI=2,2,0,0,0");
  delay(2000);
  Serial.println("AT+CMGF=1");
  delay(2000);
  Serial.print("AT+CMGS=\"");
    Serial.print("+919959352839");
    Serial.println("\"");
    delay(900);
    Serial.print("security sys on");
    delay(900);
    Serial.write(0x1A);
    Serial.write(0x0D);
    Serial.write(0x0A);
}
void loop()
{
     
  s1=digitalRead(sensor1);
  s2=digitalRead(sensor2);
  s3=digitalRead(sensor3);
  if(s1==HIGH)
  {
    if(x==0)
    {
    digitalWrite(led1,HIGH);   
    Serial.print("AT+CMGS=\"");
    Serial.print("+919959352839");
    Serial.println("\"");
    delay(900);
    Serial.print("Sensor#1 is Active");
    delay(900);
    Serial.write(0x1A);
    Serial.write(0x0D);
    Serial.write(0x0A);
         digitalWrite(buz,HIGH);
         delay(5000);
         digitalWrite(buz,LOW);
        x=1;
  }
  delay(1000);
  }
}

--------------------------------------------------------------------------------------------------------------------------


void setup()

{

                for (int i=0;i<8;i++)

                {

                pinMode(i, INPUT_PULLUP);//take pins0-7 as inputs with default high or pulled up pins.

                }

                pinMode(9,OUTPUT);//buzzer output at pin9

}

// the loop routine runs over and over again forever:

void loop()

{
  analogWrite(9,25);
  delay(2000);
  analogWrite(9,0 );
  delay(2000);
  analogWrite(9,50 );
  delay(2000);
  analogWrite(9,0 );
    delay(2000);
  analogWrite(9,75);
  delay(2000);
  analogWrite(9,0 );
    delay(2000);
  analogWrite(9,100 );
  delay(2000);
  analogWrite(9,0 );
    delay(2000);
  analogWrite(9,125 );
  delay(2000);
  analogWrite(9,0 );
    delay(2000);
  analogWrite(9,150 );
  delay(2000);
  analogWrite(9,0 );
    delay(2000);
  analogWrite(9,175 );
  delay(2000);
  analogWrite(9,0 );
    delay(2000);
  analogWrite(9,200 );
  delay(2000);
  analogWrite(9,0 );
    delay(2000);
  analogWrite(9,225 );
delay(1000); 
  analogWrite(9,0 );
  delay(2000);
    analogWrite(9,300);
    delay(2000);
  analogWrite(9,0 );
  delay(2000);
  analogWrite(9,400 );
  delay(2000);
  analogWrite(9,0 );
    delay(2000);
  analogWrite(9,500);
  delay(2000);
  analogWrite(9,0 );
    delay(2000);
  analogWrite(9,600);
  delay(2000);
  analogWrite(9,0 );
    delay(2000);
  analogWrite(9,700 );
  delay(2000);
  analogWrite(9,0 );
    delay(2000);
  analogWrite(9,800 );
  delay(2000);
  analogWrite(9,0 );
    delay(2000);
  analogWrite(9,900 );
  delay(2000);
  analogWrite(9,0 );
    delay(2000);
  analogWrite(9,1000 );
  delay(2000);
  analogWrite(9,0 );
    delay(2000);
  analogWrite(9,1500 );
  delay(2000);
  analogWrite(9,0 );
  delay(2000);
------------------------------------------------------------------------------------------------------------------------- 
//
//                if (digitalRead(0)==LOW)
//
//                {
//
//                                analogWrite(9,25);//if button 1 is pressed PWM of duty ratio(25*100)/255 is given to buzzer
//
//                                delay(100);
//
//                                analogWrite(9,0);
//
//                }
//
//                if (digitalRead(1)==LOW)
//
//                {
//
//                                analogWrite(9,50); //if button 2 is pressed PWM of duty ratio(50*100)/255 is given to buzzer
//
//                                delay(100);
//
//                                analogWrite(9,0);
//
//                }
//
//                if (digitalRead(2)==LOW)
//
//                {
//
//                                analogWrite(9,75);// /if button 3 is pressed PWM of duty ratio(75*100)/255 is given to buzzer
//
//                                delay(100);
//
//                                analogWrite(9,0);
//
//                }
//
//                if (digitalRead(3)==LOW)
//
//                {
//
//                                analogWrite(9,100); //if button 4 is pressed PWM of duty ratio(100*100)/255 is given to buzzer
//
//                                delay(100);
//
//                                analogWrite(9,0);
//
//                }
//
//                if (digitalRead(4)==LOW)
//
//                {
//
//                                analogWrite(9,125);
//
//                                delay(100);
//
//                                analogWrite(9,0);
//
//                }
//
//                if (digitalRead(5)==LOW)
//
//                {
//
//                                analogWrite(9,150);
//
//                                delay(100);
//
//                                analogWrite(9,0);
//
//                }
//
//                if (digitalRead(6)==LOW)
//
//                {
//
//                                analogWrite(9,175);
//
//                                delay(100);
//
//                                analogWrite(9,0);
//
//                }
//
//                if (digitalRead(7)==LOW)
//
//                {
//
//                                analogWrite(9,200);
//
//                                delay(100);
//
//                                analogWrite(9,0);
//
//                }
}
--------------------------------------------------------------------------------------------------------------------------


//A sketch to demonstrate the tone() function

//Specify digital pin on the Arduino that the positive lead of piezo buzzer is attached.
int piezoPin = 8;

void setup() {

}//close setup

void loop() {

  /*Tone needs 2 arguments, but can take three
    1) Pin#
    2) Frequency - this is in hertz (cycles per second) which determines the pitch of the noise made
    3) Duration - how long teh tone plays
  */
  tone(piezoPin, 1000, 500);

  //tone(piezoPin, 1000, 500);
  //delay(1000);

}
--------------------------------------------------------------------------------------------------------------------------


  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+

Related Posts:

  • NodeMCU Project List  NodeMCU Access Point web Server … Read More
  • NodeMCU Access Point web Server ESP8266 example: Wi-Fi Access point, static IP, web-server and remote GPIO control After testing the basic Wi-Fi connectivity options … Read More
  • Andriod apps Whatsapp  Updated Engineering Apps RASPBERRY Connecting apps ECE Connect … Read More
  • Downloads Embedded  Keil 4  Code Composer Studio c6713 Hyperterminal MSP 430 Software Arduino Arduino 1.8.5(non admin install) … Read More
  • WhatsApp new look and features WhatsApp (new feature,customised  app icon, contact save without direct whattsapp msg, notification icon, blue tickes, theme changes, privacy se… Read More
Terms and Conditions -
Privacy Policy -

Contact Us

Name

Email *

Message *