Joseph McCarey
Published

IFTTT Connected Kettle

Connect a kettle to IFTTT to enable remote activation, notifications, and data tracking!

IntermediateFull instructions provided2 hours1,527
IFTTT Connected Kettle

Things used in this project

Hardware components

Relay (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Solderless Breadboard Half Size
Solderless Breadboard Half Size
×1
Photon
Particle Photon
×1
Hamilton Beach Programmable 1.7 Liter Kettle 40996Z
×1

Software apps and online services

Maker service
IFTTT Maker service

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Code

Photon Firmware

Arduino
The kettle has three power states: On, Off, and Keep Warm. The code tracks the difference between power states 1 and 2 via timing but assumes the kettle will be shut off before keep warm ends (simply because I do not use the function). Tracking between the keep warm and off power state could be added by another timer similar to the one included for tracking between on and keep warm. The pin mode is switched between OUTPUT and INPUT instead of changing output voltage because the relay is being run on 3v instead of 5v so even low voltage would enable it. The publish statement is only required for notifications or data tracking.
int power = 0;

int startTime = 0;
int powerState = 0;

/*0=off
1= boiling
2= keep warm
*/

bool success = Particle.function("powerToggle", powerToggle);


void setup() {}

void loop() {
    if(powerState == 1 && Time.now() >= startTime + 300){
        powerState = 2;
        Particle.publish("done_boiling", NULL, 60, PRIVATE);
    }
    
}

int powerToggle(String req){
    pinMode(power, OUTPUT);
    if(powerState == 0){
        powerState = 1;
        startTime = Time.now();
    }
    else
        powerState = 0;
    delay(200);
    pinMode(power, INPUT);
    return powerState;
}

Credits

Joseph McCarey

Joseph McCarey

2 projects • 4 followers
High school Senior at Lane Technical - Student advisor at CS4ALL - Making for fun and for grades
Thanks to Waldemar Sakalus.

Comments