Go Down

Topic: Smoke Detector Triggers arduino and Arduino makes phone call using DTMF Tones (Read 2 times) previous topic - next topic

peterengland is Here

As I am not good in electronics can you please suggesta circuit example for me please?
Peter.


robtillaart

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

peterengland is Here

Thanks , How to create a State High or Low using Analogue PIR sensor ?

Means i am talking about following code , in that i need only two states its high or low how to achieve this ?

Code: [Select]

#include <SD.h>                      // need to include the SD library
#include <TMRpcm.h>           //  also need to include this
#define SD_ChipSelectPin 10  //using digital pin 10 as chipselect on arduino UNO


     TMRpcm tmrpcm;   // create an object for use in this sketch
     char mychar;
     int pirSensor = 0;
     int THRESHOLD = 149;
     byte val = 0;

void setup(){
     
     tmrpcm.speakerPin = 9; //11 on Mega, 9 on Uno, Nano, etc
     Serial.begin(9600);
     if (!SD.begin(SD_ChipSelectPin))
     {       
     Serial.println("SD fail");
     return;
     }
        tmrpcm.play("1.wav");     //plays a file everytime uno resets
     }
void loop(){

     if(Serial.available()){ 
     mychar = Serial.read();
   
     val = analogRead(pirSensor);
     if (val >= THRESHOLD)
     {
     tmrpcm.play("1.wav");
     }
    }
  }


pls help me.
Peter.

robtillaart

topdown it would be something like this.
Code: [Select]

void loop()
{
  bool b = detectSmoke();
  if (b == true)
  {
    playWave();
  }
  delay(1000);
}

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up