Forum Replies Created

Viewing 15 posts - 1 through 15 (of 27 total)
  • Author
    Posts
  • in reply to: Data Logger Shield #70028
    avatarsheryline
    Participant

    I am almost done with my system, but i cant seem to get the code to set the smoke sensor to low and since its analog im confused what should be the code inside my void function

    in reply to: Data Logger Shield #70022
    avatarsheryline
    Participant

    unbelievable, i think the sms reply worked wohoo! now my pir sensor detects even if there is no movement πŸ™ i think its the sensor

    in reply to: Data Logger Shield #70015
    avatarsheryline
    Participant

    Hi ahmed, the sms command function to turn off my alarm when an SMS is received is still not working πŸ™ I tried your format and mine and its still the same.

    By the way for all the shields to work the smartphone should be connected always to your hardware right?

    Can you maybe teach me how to send my captured photos to an email?

    Is there a password or pin i can set on the app so only my smartphone will be the only one who can connect and control my shields and my system?

    Thanks a lot πŸ™‚ I am excited to post my project once its done. I think I am the first in my region or maybe my country to use 1shield πŸ˜€

    in reply to: Data Logger Shield #70013
    avatarsheryline
    Participant
    in reply to: Data Logger Shield #69856
    avatarsheryline
    Participant

    Hi Ahmed sorry for the very late reply was busy during holy week. I am trying to reconstruct my codes and see if everything works just fine. Will definitely give you an update. Thank you so much for helping me. πŸ™‚

    in reply to: Data Logger Shield #69292
    avatarsheryline
    Participant

    i removed the data logger because it caused more errors, i will try it again next time. For now the most important thing is the sms receive.

    in reply to: Data Logger Shield #69290
    avatarsheryline
    Participant

    #define CUSTOM_SETTINGS
    #define INCLUDE_SMS_SHIELD /*sms*/
    #define INCLUDE_CAMERA_SHIELD
    //1sheeld.cm for the steps on adding the libraries to your arduino program

    #include <OneSheeld.h>
    int ledPin = 13; // choose the pin for the LED
    int pirPin = 3; // choose the input pin (for PIR sensor)
    /*for flame sensor*/
    int FireBuzzer = 9;
    int FlamePin = 2; /*This is for input pin*/
    /*for SMOKE sensor*/
    int smokeBuzzer = 5;
    int smokeA0 = A5; /*the digital pin connected to the smoke sensor’s output*/
    int sensorThres = 400;

    void setup() {
    pinMode(ledPin, OUTPUT); // declare LED as output
    pinMode(pirPin, INPUT); // declare sensor as input
    /*flame setup*/
    pinMode(FireBuzzer, OUTPUT);
    pinMode(FlamePin, INPUT);
    /*gas setup*/
    pinMode(smokeBuzzer, OUTPUT);
    pinMode(smokeA0, INPUT);
    OneSheeld.begin();

    }

    void loop(){

    if (digitalRead(pirPin) == HIGH) { // check if the input is HIGH
    digitalWrite(ledPin, HIGH); // turn LED ON
    delay(5000);
    SMS.send(“09967054800″,”Motion DETECTED”);
    Camera.setFlash(ON);
    Camera.rearCapture();
    OneSheeld.delay(5000);

    }

    if (digitalRead(pirPin) == LOW)
    {
    digitalWrite(ledPin, LOW); // turn LED OFF

    }

    /*flame_condition*/
    if (digitalRead(FlamePin)== HIGH)
    {
    digitalWrite(FireBuzzer, LOW);
    }

    if (digitalRead(FlamePin)== LOW)
    {
    digitalWrite(FireBuzzer, HIGH);
    SMS.send(“09967054800″,”Fire Detected!”);
    Camera.setFlash(ON);
    Camera.rearCapture();
    OneSheeld.delay(5000);
    }

    if (analogRead(smokeA0) > sensorThres)
    {
    tone(smokeBuzzer, 1000, 200);
    delay(150);
    SMS.send(“09967054800″,”Smoke Detected!”);
    Camera.setFlash(ON);
    Camera.rearCapture();
    OneSheeld.delay(5000);
    }
    else
    {
    noTone(smokeBuzzer);
    }
    }

    void myFunction (String phoneNumber ,String messageBody)
    {

    if (phoneNumber == “+639967054800”)
    {

    if (messageBody == “MOTION OFF”)
    {
    digitalWrite(ledPin,LOW);
    digitalWrite(pirPin,LOW);
    }
    if (messageBody = “FIRE OFF”)
    {
    digitalWrite(FireBuzzer,LOW);
    digitalWrite(FlamePin,LOW);
    }
    if (messageBody = “SMOKE OFF”)
    {
    digitalWrite(smokeBuzzer,LOW);
    digitalWrite(smokeA0,LOW);
    }

    else
    {
    SMS.send(“+639967054800″,”Invalid Command”);
    }
    }
    }

    in reply to: Data Logger Shield #69288
    avatarsheryline
    Participant

    Hi ahmed i made revisions to my codes and is now working as intended πŸ™‚ But still the sms receive function is still not working, i tried to reply to my own number and the LED and buzzer did not turn off πŸ™ what could be wrong?

    in reply to: Data Logger Shield #69159
    avatarsheryline
    Participant

    I am not sure if there is something wrong about my conditions or the brackets in my loop that maybe causes to give me an sms or log for fire sensor even if the alarm triggered was for motion πŸ™

    in reply to: Data Logger Shield #69157
    avatarsheryline
    Participant

    /*to avoide memory overload*/
    #define CUSTOM_SETTINGS
    #define INCLUDE_SMS_SHIELD /*sms*/
    #define INCLUDE_TERMINAL_SHIELD
    #define INCLUDE_CAMERA_SHIELD
    #define INCLUDE_DATA_LOGGER_SHIELD /*data log*/
    #define INCLUDE_CLOCK_SHIELD /*clock*/
    /* Include 1Sheeld library. */
    #include <OneSheeld.h>
    /*DECLARING VARIABLES*/
    /*for motion sensor*/
    int pirPin = 3; /*the digital pin connected to the PIR sensor’s output*/
    int ledPin = 13;
    int val=0;
    int PIR = LOW;
    /*for flame sensor*/
    int BuzzPin = 9;
    int FlamePin = 2; /*This is for input pin*/
    int Flame = HIGH; /*HIGH when FLAME Exposed*/
    /*for SMOKE sensor*/
    int buzzPin = 5;
    int smokeA0 = A5; /*the digital pin connected to the smoke sensor’s output*/
    int sensorThres = 400;
    /* Reserve a counter. */
    int counter = 0;
    bool startFlag = false; /*data log, Define a boolean flag.*/
    boolean isMessageSent = false;

    int hour, minute, day, month, year;

    /*SETUP*/
    void setup(){

    /*start communication*/
    OneSheeld.begin();
    /*motion setup*/
    pinMode(pirPin, INPUT);
    pinMode(ledPin, OUTPUT);
    digitalWrite(pirPin, LOW);
    /*flame setup*/
    pinMode(BuzzPin, OUTPUT);
    pinMode(FlamePin, INPUT);
    /*gas setup*/
    pinMode(buzzPin, OUTPUT);
    pinMode(smokeA0, INPUT);

    }

    /*LOOP*/
    void loop(){
    Flame = digitalRead(FlamePin);
    int analogSensor = analogRead(smokeA0);
    val = digitalRead(pirPin);
    hour = Clock.getHours();
    minute = Clock.getMinutes();
    day = Clock.getDay();
    month = Clock.getMonth();
    year = Clock.getYear();

    /*motion_condition*/
    if (val == HIGH) { // check if the input is HIGH
    digitalWrite(ledPin, HIGH);
    delay(10000);

    if (PIR == LOW)
    {
    Camera.setFlash(ON);
    Camera.rearCapture();
    OneSheeld.delay(5000);
    Logger.stop();
    Logger.start(“Motion Sensor Triggered”);
    SMS.send(“09967054800″,”Motion DETECTED”);// turn LED ON

    PIR = HIGH;
    }
    }
    if(startFlag)
    {
    Logger.add(“Motion Detected at”,”Motion Detected at”);
    Logger.add(“Hour”,hour);
    Logger.add(“:”,”:”);
    Logger.add(“Minute”,minute);
    Logger.add(“Month”,month);
    Logger.add(“-“,”-“);
    Logger.add(“Day”,day);
    Logger.add(“-“,”-“);
    Logger.add(“Year”,year);
    Logger.log();
    OneSheeld.delay(1000);
    counter++;
    if(counter==20)
    {
    Logger.stop();
    counter=0;
    Logger.start(“Motion Sensor Triggered”);
    }
    }
    else
    {
    digitalWrite(ledPin, LOW); // turn LED OFF
    if (PIR== HIGH){
    PIR = LOW;
    }
    }
    /*flame_condition*/
    if (Flame== HIGH)
    {

    Terminal.println(“HIGH flame”);
    digitalWrite(BuzzPin, HIGH);
    Camera.rearCapture();
    Logger.stop();
    Logger.start(“Flame Sensor Triggered”);
    OneSheeld.delay(10000);
    SMS.send(“09967054800″,”Fire Detected!”);
    isMessageSent = true;
    }
    if(startFlag)
    {
    Logger.add(“Fire Detected at”,”Fire Detected at”);
    Logger.add(“Hour”,hour);
    Logger.add(“:”,”:”);
    Logger.add(“Minute”,minute);
    Logger.add(“Month”,month);
    Logger.add(“-“,”-“);
    Logger.add(“Day”,day);
    Logger.add(“-“,”-“);
    Logger.add(“Year”,year);
    Logger.log();
    OneSheeld.delay(1000);
    counter++;
    if(counter==20)
    {
    Logger.stop();
    counter=0;
    Logger.start(“Fire Sensor Triggered”);
    }
    }
    else
    {

    Terminal.println(“NO FLAME”);
    digitalWrite(BuzzPin, LOW);
    isMessageSent = false;
    }

    /*smoke_condition*/
    if (analogSensor > sensorThres)
    {

    analogWrite(buzzPin, HIGH);
    Camera.rearCapture();
    Logger.stop();
    Logger.start(“Smoke/Gas Sensor Triggered”);
    OneSheeld.delay(10000);
    SMS.send(“09967054800″,”Smoke Detected!”);
    isMessageSent = true;
    delay(10000);
    }
    if(startFlag)
    {
    Logger.add(“Smoke/Gas Detected at”,”Smoke/Gas Detected at”);
    Logger.add(“Hour”,hour);
    Logger.add(“:”,”:”);
    Logger.add(“Minute”,minute);
    Logger.add(“Month”,month);
    Logger.add(“-“,”-“);
    Logger.add(“Day”,day);
    Logger.add(“-“,”-“);
    Logger.add(“Year”,year);
    Logger.log();
    OneSheeld.delay(1000);
    counter++;
    if(counter==20)
    {
    Logger.stop();
    counter=0;
    Logger.start(“Smoke/Gas Sensor Triggered”);
    }
    }
    else
    {

    analogWrite(buzzPin, LOW);
    isMessageSent = false;
    }

    }

    void myFunction (String phoneNumber ,String messageBody)
    {
    int analogSensor = analogRead(smokeA0);

    if (phoneNumber == “+639967054800”)
    {

    if (messageBody == “MOTION OFF”)
    {
    digitalWrite(ledPin,LOW);
    PIR = LOW;
    }
    if (messageBody = “FIRE OFF”)
    {
    digitalWrite(BuzzPin,LOW);
    Flame = LOW;
    }
    if (messageBody = “SMOKE OFF”)
    {
    digitalWrite(buzzPin,LOW);
    analogSensor = LOW;
    }

    else
    {
    SMS.send(“+639967054800″,”Invalid Command”);
    isMessageSent = true;
    }
    }
    else
    {
    isMessageSent = false;
    }
    }

    in reply to: Data Logger Shield #69155
    avatarsheryline
    Participant

    Wonderful! I have corrected the codes, I was about to test the sms receive part when I got more problems:

    1-camera shield takes pictures even if my motion sensor did not pick up anything yet and there was no LED on first, is there a problem with my delay codes for both arduino and onesheeld?

    2-sms and data logger shows Fire detected when only motion was detected πŸ™

    by the way how did you post your codes in this page like that?

    in reply to: Data Logger Shield #68961
    avatarsheryline
    Participant

    Hi Ahmed, i just cant stop exploring πŸ˜€
    I tried the codes I saw in the sms documentation and tried it on my end.
    This program should turn off my alarm if a sensor is triggered and the user wants to turn the alarm of using an SMS reply.

    I am not getting any error when I compiled it but I haven’t uploaded it in the 1sheeld hardware yet. I was hoping if you can check if my logic or program is correct?

    void setup(){

    /*start communication*/
    OneSheeld.begin();

    SMS.setOnSmsReceive(&myFunction);

    }

    void loop(){
    /*my normal sensor codes here*/
    }

    void myFunction (String phoneNumber ,String messageBody)
    {
    phoneNumber = “09967054800”;

    if (messageBody == “MOTION OFF”)
    {
    digitalWrite(ledPin,LOW);
    PIR = LOW;
    }
    if (messageBody = “FIRE OFF”)
    {
    digitalWrite(BuzzPin,LOW);
    Flame = LOW;
    }
    if (messageBody = “SMOKE OFF”)
    {
    digitalWrite(buzzPin,LOW);
    analogSensor = LOW;
    }
    else
    {
    SMS.send(“09967054800″,”Invalid Command”);
    isMessageSent – true;
    }
    }

    in reply to: Data Logger Shield #68952
    avatarsheryline
    Participant

    I tried to study the sms documentation in the website and there is this code:

    char * getSms(void)

    is this where I can use the app to receive an sms and maybe program the sms received to act as input and return an output of turning of the alarm? πŸ™‚

    in reply to: Data Logger Shield #68927
    avatarsheryline
    Participant

    Great Info! Thanks Ahmed πŸ™‚ for number 2, I mean can I activate/deactivate my sensors or my system when I am away from home through the use of SMS? Like example a receive an SMS notif and a camera shot in my email and I found out it was just a cat or something so I want to turn off the alarms and sensors so I was hoping if I could send an SMS back to my 1sheeld to turn my system off/on? in case I cannot use the Iot Shield.

    in reply to: Unable to connect bluetooth #68854
    avatarsheryline
    Participant

    hello, I bought my first 1sheeld+ device and I was very eager to use it for my home security project and I tried to pair it with a cheap android phone Cherry Mobile J2 using Nougat version. I tried more than 20times connecting and I even tried to follow some of the steps on this thread to clear data and force stop google play and install the app again and also tried to download some bluetooth apps but maybe you can suggest which app is best for phones with choosy bluetooth settings. I am still looking for another phone I can use, the green and blue light seems to blinking like its transmitting something but its still wont detect the hardware. Anything else I could try? πŸ™

Viewing 15 posts - 1 through 15 (of 27 total)