Daniel Eisterhold
Created January 25, 2020 © GPL3+

Aerobic System Monitor

Monitors an aerobic system for any alarms (ex. high water level caused by a bad relay/timer/pump).

IntermediateWork in progress2 hours6
Aerobic System Monitor

Things used in this project

Hardware components

Photon
Particle Photon
×1
Enclosed AC/DC Power Relay with Protection & De-Bounce. Screw Terminals. 120V Trigger Input.
×1
National Control Devices Screw Terminal Breakout Board for Particle Photon with On-Board Power Supply
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
Microsoft Azure
Microsoft Azure

Hand tools and fabrication machines

Multitool, Screwdriver
Multitool, Screwdriver
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Laser cutter (generic)
Laser cutter (generic)

Custom parts and enclosures

Mounting Plate

Laser cut mounting plate

Code

Aerobic Monitor

Arduino
Build and flash using Particle's web IDE.
// Aerobic System Alarm Pin
#define ALARM D0
#define LED D7
#define INTERVAL 1000

unsigned long current = 0;
bool isAlarmState = false;

SYSTEM_MODE(AUTOMATIC);

void setup() {
    pinMode(ALARM, INPUT_PULLUP);
    pinMode(LED, OUTPUT);
    
    isAlarmState = digitalRead(ALARM) == LOW;
    Particle.variable("isAlarmState", isAlarmState);
}

void loop() {
	if ((millis() - current) >= INTERVAL) {
		current = millis();
        checkForAlarm();
	}
}

void checkForAlarm() {
    bool isAlarm = digitalRead(ALARM) == LOW;

    // Alarm is currently active, but was previously not active
    if (isAlarm && !isAlarmState) {
        isAlarmState = true;
        Particle.publish("ALARM_ON", PUBLIC);
        digitalWrite(LED, HIGH);
        // Delay 5 seconds
        //delay(5000);
    }
    
    // Alarm is not currently active, but is now active
    if (!isAlarm && isAlarmState) {
        isAlarmState = false;
        Particle.publish("ALARM_OFF", PUBLIC);
        digitalWrite(LED, LOW);
        // Delay 5 seconds
        //delay(5000);
    }
}

Credits

Daniel Eisterhold
2 projects • 0 followers

Comments