Software apps and online services

IFTTT Maker service

Google Sheets

Story

How many of you have burned something while cooking, because you got distracted for whatever reason? Well now we have a solution to your problems. The purpose of this project is to alert you when the timer is up and notify the user to take out the laundry or food before it's too late. This can also be very useful while studying or playing video games to keep you on schedule and maximize your productivity.

Two Particle Photons were used, one was attached to a breadboard to act as the switch to start the timer and one was attached to an Internet Button to give you a LED show while keeping track of the time. The mini-push button was used as a trigger/switch. Particle.Publish and Particle.Subscribe are embedded into the two particle codes so they can communicate with each other efficiently.

The first photon will be inserted into the breadboard that detects when the button is pressed. The button is also inserted into the breadboard and connected to the photon in pin D0 while an LED is connected to the photon in D1. The LED is used to notify the user when the button is pressed without having to check the other photon. When the button is pressed an on-board LED is triggered, a signal will be sent to a second photon.

Video

One directional communication (Old Version)

Updated video with both photons Publishing and Subscribing

Updated: Bi-directional Communication (New Version)

Photon 1: LED onboard

The second photon will receive the signal and tell the internet button to start the timer. The timer is tracked through the 11 LED lights on the internet button and once the timer runs out the LEDs go into a rainbow pattern and play a note before turning off after a designated time. The LED lights can be customized within the code on Particle Build by combining the three primary colors (RED, GREEN, BLUE). The tune/note can also be customized within the code in Particle Build by varying the frequencies and time delays between the notes. After the timer runs out Vrajesh's photon will publish a signal back to Terrell's photon and a LED on the breadboard will go off.

Second photon is also coded with a backup 1 min timer that can be activated upon push on Button 3 on the internet button. The timer doesn't have an automatic turn off code but its coded to be turned off when button 3 and button 2 are pressed simultaneously for 5 seconds.

Photon 2: Internet Button

Uses

Cooking Timer

Alarm

Laundry Timer

Blazin Challenge (Buffalo Wild Wings)

Shower Timer

Possibilities are endless....

IFTTT

If THIS than THAT was set up to get notifications when the button was pressed and the timer started. Terrell (Photon 1) gets notified when button was pressed while Vrajesh (Photon 2) gets notified when the timer starts.

Terrell's Notification

;

;

1 / 2 • Vrajesh's Notification

Graph

The graph is showing the different times that the timer started and ended. The reason it is set to 2 is because that is the name of the function being called and 3 is set to show when the timer runs out. The graph also displays time so you can check if the timer is running on the coded time.

Schematics

Photon 1

Particle Photon is responsible for starting the timer upon press of a button. When the button is pressed the LED on the breadboard is activated to let the user know the button pressed command will be sent up to the cloud.

Photon 2

The second photon is inserted in the Internet Button. The internet button consist of 11 LEDs, accelerometer, and buzzer. For the purpose of this project we only used the 11 LEDs lights and buzzer/speaker.

Code

Photon 1: The Button (Signal)

C/C++

This photon 1 has a button that is pressed and sends a signal to the cloud so photon 2 can respond by turning on the timer.

// We will be using D1 to control our LEDintledPin=D1;intlidPin=D3;// Our button wired to D0intbuttonPin=D0;voidsetup(){Particle.subscribe("Fortnite",Thang,"2c001c000e51353532343635");pinMode(lidPin,OUTPUT);digitalWrite(lidPin,LOW);// For input, we define the// pushbutton as an input-pullup// this uses an internal pullup resistor// to manage consistent reads from the devicepinMode(buttonPin,INPUT_PULLUP);// sets pin as input// We also want to use the LEDpinMode(ledPin,OUTPUT);// sets pin as output}voidThang(constchar*event,Stringdata){digitalWrite(lidPin,HIGH);delay(5000);digitalWrite(lidPin,LOW);}voidloop(){// find out if the button is pushed// or not by reading from it.intbuttonState=digitalRead(buttonPin);// remember that we have wired the pushbutton to// ground and are using a pulldown resistor// that means, when the button is pushed,// we will get a LOW signal// when the button is not pushed we'll get a HIGH// let's use that to set our LED on or offdelay(300);if(buttonState==LOW){if(Particle.connected()){Particle.publish("Button_Pressed","2");// turn the LED OndigitalWrite(ledPin,HIGH);}}else{// otherwise// turn the LED OffdigitalWrite(ledPin,LOW);}}

Photon 2: Timer (10 seconds and 1 minute)

C/C++

This photon (Internet Button) gets the signal from the cloud and starts the 10 second timer. If button three is pressed on photon 2 (Internet Button) a 1 minute timer will start. Hold buttons 2 and 3 to cut the timer off once finished.

// This #include statement was automatically added by the Particle IDE.#include<InternetButton.h>// This #include statement was automatically added by the Particle IDE.SYSTEM_THREAD(ENABLED);InternetButtonb=InternetButton();unsignedlongstartTime=0;intledNum=0;boolcheckFlag=false;boolsubFlag=false;intButt=D7;voidsetup(){//initiating Internet buttonb.allLedsOff();b.begin();initPomo();pinMode(Butt,OUTPUT);digitalWrite(Butt,LOW);Particle.subscribe("Button_Pressed",DatThang,"2a003e000d47343438323536");}voidDatThang(constchar*event,constchar*data){b.ledOn(1,255,0,0);delay(1000);//b.ledOff(1);//delay(10);b.ledOn(2,255,69,0);delay(1000);//b.ledOff(2);//delay(20);b.ledOn(3,255,215,0);delay(1000);//b.ledOff(3);//delay(30);b.ledOn(4,188,143,143);delay(1000);//b.ledOff(4);//delay(10);b.ledOn(5,148,0,211);delay(1000);//b.ledOff(5);//delay(10);b.ledOn(6,0,0,139);delay(1000);//b.ledOff(6);//delay(10);b.ledOn(7,65,105,225);delay(1000);//b.ledOff(7);//delay(10);b.ledOn(8,64,224,208);delay(1000);//b.ledOff(8);//delay(10);b.ledOn(9,34,139,34);delay(1000);//b.ledOff(9);//delay(10);b.ledOn(10,127,255,0);delay(1000);//b.ledOff(10);//delay(10);b.ledOn(11,3,255,0);delay(1000);//b.ledOff(11);//delay(10);b.rainbow(10);delay(5000);b.allLedsOff();b.playSong("E5,2,G5,8,E6,8,C6,4,D6,8,G6,8");Particle.publish("Fortnite","3");//digitalWrite(Butt, HIGH);//pomoMain();}voidloop(){checkButton();pomoMain();}//main Application LoopvoidpomoMain(){if(millis()-startTime>100UL&&checkFlag){//750UL = .75seconds, ex: 327000UL = 5.45 minutes (at 5.45 minutes this will make a work session around 45 minutes with a 15 minute break)if(ledNum>10){checkFlag=false;subFlag=true;partiTime();}elseif(ledNum>7){b.ledOn(++ledNum,0,53,60);//ex: b.ledOn(ledNumber, red, green, blue) feel free to Modify these colors}else{b.ledOn(++ledNum,200,50,100);// feel free to modify these colors :)}startTime=millis();}}//pomoMain() is end of "work" cyclevoidpartiTime(){while(b.buttonOn(3)==0&&subFlag){b.rainbow(8);Particle.process();}b.allLedsOff();b.playSong("E5,2,G5,8,E6,8,C6,4,D6,8,G6,8");//song that plays at ResetinitPomo();}//partiTime function = end of full cyclevoidinitPomo(){ledNum=0;b.ledOn(ledNum,105,0,255);startTime=millis();checkFlag=false;subFlag=false;}//initializing function for variablesvoidcheckButton(){if(b.buttonOn(3)||b.buttonOn(2)){checkFlag=!checkFlag;delay(50);while(b.buttonOn(3));delay(50);}//end of checkFlag toggle}//checkButton() is for Flag Checking