Please help I am making a system that makes phone call when Smoke detector triggers arduino and plays a recorded sound in SD card by using DTMF tones saved in that Sd card , I have tried following things partly .
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 ?
#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");
}
}
}
Sorry to say but i didn't understand can you give me straight circuit for that ?
my need is I have a analog PIR sensor that has 3 pins 1 for supply 5v one for signal out and rest is ground so i need that signal to convert to Digital to state ON or OFF pls help me and sorry if I missed something to say .