Things used in this project

Hardware components:
Relay (generic)
11026 02
Jumper wires (generic)
Adafruit industries ada64 image 75px
Solderless Breadboard Half Size
Photon new
Particle Photon
Hamilton Beach Programmable 1.7 Liter Kettle 40996Z
Software apps and online services:
IFTTT Maker service
Hand tools and fabrication machines:
09507 01
Soldering iron (generic)


Photon FirmwareArduino
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;

1= boiling
2= keep warm

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

void setup() {}

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

int powerToggle(String req){
    pinMode(power, OUTPUT);
    if(powerState == 0){
        powerState = 1;
        startTime =;
        powerState = 0;
    pinMode(power, INPUT);
    return powerState;


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


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


Add projectSign up / Login