FLAME DETECTOR WITH RF24

Flame RF24 trans

//TRANSMITTER

#include <SPI.h>

#include “nRF24L01.h”

#include “RF24.h”

int DataMsg[1];

RF24 radio(8,7);

const uint64_t pipe = 0xE14BC8F482LL;

void setup()

{

Serial.begin(9600);

Serial.println(“NRF24L01 Transmitter”);

radio.begin();

radio.openWritingPipe(pipe);

}

void loop()

{

int sensorValue0 = analogRead(A0);

if (sensorValue0 < 100)

{

DataMsg[0] = 1;

radio.write(DataMsg, 1);

}

else

{

DataMsg[0] = 2;

radio.write(DataMsg, 1);

}

}

Flame RF24 recv

//RECEIVER

 

#include <SPI.h>

#include “nRF24L01.h”

#include “RF24.h”

int DataMgs[1];

RF24 radio(8,7);

const uint64_t pipe = 0xE14BC8F482LL;

int Relay1 = 5;

void setup()

{

pinMode(Relay1, OUTPUT);

Serial.begin(9600);

radio.begin();

radio.openReadingPipe(1,pipe);

radio.startListening();

}

void loop()

{

if (radio.available())

{

bool done = false;

while (!done)

{

done = radio.read(DataMgs, 1);

Serial.print(“NRF24L01 Receiver: “);

Serial.println(DataMgs[0]);

if (DataMgs[0] == 1)

{

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(2000); //#1

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(2000); //#2

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(2000); //#3

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(2000); //#4

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(30);

digitalWrite(Relay1, HIGH);

delay(30);

digitalWrite(Relay1, LOW);

delay(2000); //#5

}

if (DataMgs[0] == 2)

{

digitalWrite(Relay1, LOW);

}

delay(100);

}

}

else

{

Serial.println(“Waiting for signal…”);

}

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s