Vladimir Dmitrovic
Published © LGPL

Particle Photon & Slack Silent Webhook Alarm

Using Webhook to Slack team chat application and sending direct messages to your PC/Mac/notebook or any Mobile device.

BeginnerFull instructions provided30 minutes2,009
Particle Photon & Slack Silent Webhook Alarm

Things used in this project

Hardware components

Photon
Particle Photon
×1
Resistor 220 ohm
Resistor 220 ohm
×1
Reed Relay
×1
Ferrite (Magnet)
×1

Software apps and online services

Particle Cloud
Slack
Slack

Story

Read more

Schematics

Door.png

Code

Silent Alarm

C/C++
This is code for your Particle Photon device. It will use Analog Pin A0 to detect is analog value of voltage bellow 4000 (0-4095 for 3.3V) and send event Alarm on Particle Cloud.
int Alarm=0;
bool fAlarm = true; 
void setup()
{
    
}
void loop(){
    Alarm=analogRead(A0); 
     if (fAlarm==true) {
        if (Alarm<=4000) {
            Particle.publish("Alarm","The alarm is triggered", 60, PRIVATE);
            fAlarm=false;
        }
     }
     if(fAlarm==false && Alarm>=4000)
       fAlarm=true;
 delay(1000);
}

Credits

Vladimir Dmitrovic

Vladimir Dmitrovic

1 project • 5 followers
Student of Mechatronics, e-Commerce and IoT developer.

Comments