Things used in this project

Hardware components:
Photon new
Particle Photon
×1
Amazon echo dot
Amazon Alexa Echo Dot
×1
12002 04
Breadboard (generic)
×1
N-Channel MOSFET
×1
Pushbutton 12mm
×1
09590 01
LED (generic)
×1
Mfr 25frf52 1m sml
Resistor 1M ohm
×1
Mfr 25frf52 100r sml
Resistor 100 ohm
×1
Mfr 25frf52 10k sml
Resistor 10k ohm
×1
Mfr 25frf52 1k sml
Resistor 1k ohm
×1
11026 02
Jumper wires (generic)
×1
12035 01
SparkFun microB USB Breakout
×1
USB Type A Female Breakout
×1
Adafruit industries ada592 image 75px
USB-A to Micro-USB Cable
×2
Software apps and online services:
Gawd2jnp51w1h1ccsulo
IFTTT Amazon Alexa service

Schematics

Echo Kill Switch Schematic
Echo kill switch mnmbtqshta

Code

Echo Kill Switch Particle CodeArduino
Copy this into the Particle IDE
// Kill switch for Amazon Echo

int kill_switch = D5;
int button = D6;
int btn_prev_state = HIGH;

void setup() {
    
    // Switch is output, button is input
    pinMode(kill_switch, OUTPUT);
    pinMode(button, INPUT);
    
    // Initialize kill switch as default low
    digitalWrite(kill_switch, LOW);
    
    // Register a cloud function
    Particle.function("killSwitch", killSwitch);
}

void loop() {
    
    // If button is pushed, toggle kill switch
    int btn_state = digitalRead(button);
    if ( (btn_state == LOW) && (btn_prev_state == HIGH) ) {
        digitalWrite(kill_switch, !digitalRead(kill_switch));
    }
    btn_prev_state = btn_state;
}

int killSwitch(String state) {
    
    // Set pin state based on given parameters
    if ( state == "on" ) {
        digitalWrite(kill_switch, HIGH);
    } else if ( state == "off" ) {
        digitalWrite(kill_switch, LOW);
    } else {
        return -1;
    }
    
    return 0;
}

Credits

Engineering superhero
Shawn hymel

Engineering Superhero at SparkFun Electronics.

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

Chromebook Enrollment
Easy
  • 523
  • 9

Work in progress

For work every now and then I have to enroll up to 200 Chromebooks/Chromebits/Chromeboxes, so I wrote a script that does just that.

Particle Photon and Electron shield
Easy
  • 268
  • 3

Work in progress

I was tired of using push-in boards and jumpers for my projects, so I developed a shield for the Particle Electron.

Particle + Raspberry Pi
Easy
  • 3,155
  • 19

Protip

The world's favorite low-cost computer now connects to the world's most popular IoT platform.

How to Command a RS485 Relays
Easy
  • 314
  • 3

Protip

Easy way to command a RS485 Relay boards with our Rotilio board.

Internet-connected Festive Tree
Easy
  • 244
  • 4

Full instructions

Spruce up your desk or home with an Internet-controlled 3D printed Holiday tree!

What is my IP?
Easy
  • 882
  • 10

Full instructions

First impressions of a Raspberry Pi connected to the Particle Cloud.

Add projectSign up / Login
Respect project