Sindy LopezMatthew Hestenes
Created November 20, 2019

Emergency Device assistance with Amazon Echo Dot

Emergency device that is connected to a virtual assistant program.

BeginnerFull instructions providedOver 1 day24
Emergency Device assistance with Amazon Echo Dot

Things used in this project

Hardware components

Argon
Particle Argon
×2
Echo Dot
Amazon Alexa Echo Dot
×1
LED (generic)
LED (generic)
×1
Resistor 220 ohm
Resistor 220 ohm
×1

Software apps and online services

Maker service
IFTTT Maker service
ThingSpeak API
ThingSpeak API
Amazon Alexa service
IFTTT Amazon Alexa service

Story

Read more

Schematics

Project Schematic

Project Schematic

Code

Communication

C/C++
void lights(const char *event, const char *data){
   
    Particle.publish("transmission", data, PRIVATE);
    delay(1000);
   
}
 
void responce(const char *event, const char *data){
   
    if (strcmp(data, "1")==0) {
   
        digitalWrite(D7, HIGH);
        delay(500); 
        digitalWrite(D7, LOW);
        delay(500);
   
    }
   
    else {}
   
}
 
 
void setup() {

   
    pinMode(D7, OUTPUT);
 
}
 
void loop() {
 
    Particle.subscribe("party_lights", lights, MY_DEVICES);
    delay(1000);
   // String test = String(1);
    //Particle.publish("party_lights", test, PRIVATE);
    //delay(2000);
    //Particle.publish("party_lights", "0", PRIVATE);
    //delay(2000);
    
    Particle.subscribe("response", responce, MY_DEVICES);
    delay(1000);
}

Action

C/C++
void trans(const char *event, const char *data){
   
    if (strcmp(data, "1")==0) {
       
        digitalWrite(D2, 255);
       
       
        String responsevalue = String(1);
        Particle.publish("response", responsevalue, PRIVATE);
        delay(2000);
 
    }
   
    else if (strcmp(data, "0")==0) {
       
     
        digitalWrite(D2, 0);
       
        String responsevalue = String(1);
        Particle.publish("response", responsevalue, PRIVATE);
        delay(2000);

    }
   
    else {}
   
    delay(1000);
   
}
 
void setup() {
 
    pinMode(D2, OUTPUT);
   
 
}
 
void loop() {
 
    Particle.subscribe("transmission", trans, MY_DEVICES);
    delay(1000);
}

Credits

Sindy Lopez

Sindy Lopez

1 project • 1 follower
Matthew Hestenes

Matthew Hestenes

0 projects • 1 follower

Comments