Things used in this project

Schematics

A/C Condensate Monitoring with 2 Photons.
This is a simple Schematic depicting the wiring configuration.
Final circuit r8iyywfvkh

Code

Condensate Monitoring CodeC/C++
The Same code was used on both Photon's for the sake of simplicity. The purpose of this project was to pass a variable between two Photons, to use one Photon wire the relay shield as shown in the schematic to the first Photon.
int digitalvalue;

void setup() {
    
    pinMode(D7,OUTPUT);
    pinMode(D1,INPUT);
    pinMode(A5,OUTPUT);
    
    
    Particle.variable("digitalvalue", &digitalvalue, INT);
    
    Particle.function("digitalvalue",digitalvalueToggle);

}

void loop() {
    
    digitalvalue = digitalRead(D1);
    
    delay(10000);
    
    if (digitalvalue==0) {
        Particle.publish("Drain","A/C is not Draining Properly!");
         digitalWrite(A5,0);
    }
    else if (digitalvalue==1) {
        Particle.publish("Drain","A/C is Draining Properly");
        digitalWrite(A5,1);
    } 
    
    

 
}

int digitalvalueToggle(String command){
    if (command=="on") {
        digitalWrite(D7,HIGH);
        return 1;
    }   
    else if (command=="off") {
        digitalWrite(D7,LOW);
        
        return 0;
    }
    else {
        return -1;
    }



int value= D1;
String data=String(value);


// Trigger the webhook
Particle.publish("Drain", data, PRIVATE);
// Wait 30 seconds
delay(30000);

      
}

    

Credits

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

Blynk GPS Tracker
Intermediate
  • 3
  • 1

Full instructions

Simple GPS tracker using a Particle Photon (or Electron) and an EM406 GPS module with location visible on Blynk app map.

Pool Buddy
Intermediate
  • 1,452
  • 10

Work in progress

Monitor and log water quality (pH & ORP) and temperature from everywhere.

Smart Garden
Intermediate
  • 1,923
  • 17

Smart Garden is a plant environmental monitoring system.

IoT Thermometer Using Python
Intermediate
  • 791
  • 8

Full instructions

How to develop a simple but powerful IoT thermometer using a Zerynth-powered single-board MCU and the Zerynth App.

Particle Photon Flip Dot Clock
Intermediate
  • 2,115
  • 31

Full instructions

The flip dot display uses an electromechanical dot matrix that spin from black to yellow to display text, numbers and more!

What To Wear LCD
Intermediate
  • 38
  • 1

Ever wondered what to wear due to unpredictable weather??? Wonder no longer!

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Feedback