Things used in this project

Hardware components:
Photon new
Particle Photon
×2
SunFounder 2 Channel DC 5V Relay
×1
Water Solenoid Valve
×1
BRK 7010B Hardwire Smoke Alarm
×1
Software apps and online services:
Q8wtlimqnp04fzhtr9v5
IFTTT Maker service
Particle
Google sheets
Google Google Sheets

Schematics

The smoke detector circuit diagram
Smoke diagram lreaez4uoi
The relay and water valve circuit diagram
Water valve circuit b3xjitgsbt

Code

Smoke detector codeArduino
const int sensorPin = D3;  
const int ledPin =  D7;
int rssi =0;

void setup()
{
  pinMode(sensorPin, INPUT);
  pinMode(ledPin, OUTPUT);
  Particle.publish("State", "0",PRIVATE);
  Particle.variable("RSSI", &rssi, INT);
}


void loop()
{
  int  sensorSignal; 
  int i;
  int j;
  int n=60; //Published Low state every 60 minutes
  int m=60; //Published WiFi strength every 60 seconds 

   for (i = 0; i < n; i++) 
   {
        for (j = 0; j < m; j++) 
        {
           sensorSignal = digitalRead(sensorPin);
           if ( sensorSignal == HIGH)  
           {
                digitalWrite(ledPin, HIGH); 
                Particle.publish("State", "1",PRIVATE);
                delay(15000);
            }
            else
            {
                digitalWrite(ledPin, LOW);
            }
            delay(1000);
        }
        rssi = WiFi.RSSI();
        Particle.publish("rssi", String(rssi), 60, PRIVATE);
   } 
  Particle.publish("State", "0",PRIVATE);
}
Relay and water solenoid valveArduino
int openValve(String command);
const int valvePin = D7;
int rssi =0;

void setup()
{
 
  Particle.function("valve", openValve);
  Particle.variable("RSSI", &rssi, INT);
  pinMode(D7, OUTPUT);
}

void loop()
{
    rssi = WiFi.RSSI();
    Particle.publish("rssi", String(rssi), 60, PRIVATE);
    delay(60000);
}

int openValve(String command)
{

  if(command == "open")
  {
   digitalWrite(valvePin, HIGH);
   delay(10000);
   digitalWrite(valvePin, LOW);
       Particle.publish("Reopen", "Reopen Valve",PRIVATE);
        delay(1000);
    return 1;
  }
  else return -1;
}

Credits

0b5f0cfaf1dbd8f9e726efc9697b0454
vinh phan

My name is Vinh Phan. I am an Engineering student at UNC Charlotte.

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Particle Photon Based Security System with Alerting
Intermediate
  • 1,338
  • 20

Full instructions

Be alerted to any door or window opening and closing in your house on your smart phone.

Happy Plant Notifier
Intermediate
  • 290
  • 5

Full instructions

Get a text or call if your plant is getting too dry, along with a nice LCD display giving information regarding your plant's health.

My Guardian for the Workshop
Intermediate
  • 196
  • 4

Full instructions

Device will send emails if the door or window has been opened, and will monitor the temperature and humidity of the place.

Raspberry Pi Google Assistant With Sleek Wood Box
Intermediate
  • 5,295
  • 30

Full instructions

l built a DIY Google AI Assistant using a Raspberry Pi, USB Speaker and USB microphone.

Smart and Safe Outdoor Plant Watering System
Intermediate
  • 2,517
  • 18

Monitors soil moisture and weather forecasts to give plants just the water they need. Safe garden hose hookup for season long watering.

Race Car Dashboard (Online Connectivity)
Intermediate
  • 2,085
  • 8

The project was initially designed to acquire real-time race car data for BAJA-SAE competitions.

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaFree StoreBlog