Back to Parent


I categorized the project into three targets as a thought process. 
First- Make the RGB Led work with program.
Second-Make the Piezo Sound work.
Third-Make the temperature sensor work and tweak the led and piezo sound to work according to the temperature data and enable push notifications.

Inspiration Projects:

Project process

First - Making the RGB Led work.

Why RGB? The project could have been achieved with a green led and red led individually set up. But an RGB led would be cool and also help me learn to code the RGB and make it work. 


This blog had a program which was already tried by one of the participants and had the pictures of wiring diagram which i used to achieve the RGB output. Once i acheived the RGB output, the code was tweaked to remove the blue light and the wire was unplugged in the bread board. 

int REDPin = A0; // RED pin of the LED to PWM pin **A0** 
int GREENPin = D0; // GREEN pin of the LED to PWM pin **D0**
int BLUEPin = D1; // BLUE pin of the LED to PWM pin **D1**
int brightness = 255; // Full brightness for an ANODE RGB LED
 void setup()
 pinMode(REDPin, OUTPUT); // sets AO pin as output
 pinMode(GREENPin, OUTPUT); // sets D0 pin as output
 pinMode(BLUEPin, OUTPUT); // sets D1 pin as output
 void loop()
{ analogWrite(REDPin, brightness);
 analogWrite(GREENPin, brightness);
 analogWrite(BLUEPin, brightness);
 analogWrite(REDPin, 0);
 analogWrite(GREENPin, 0);

 analogWrite(BLUEPin, 0);
 delay(500); }  

In this program, analogWrite was converted to digitalWrite and only Red and green pin were used.

Second - Making the Piezo work.

The Piezo wiring diagram was taken from the lab tutorials and the code executed using digitalWrite function with a simple warning tone. It produced a single long tone.
The program was tweaked to make the tone as "beep, beep beep" with delay and loop function. The tone was programmed to turn on only when the red light was on.
The RGB+Piezo program was saved as a separate file.

Third - The program set for temperature sensor was downloaded from Daragh's github account and then wiring was done according to the diagram. The temperature sensor was checked by dipping it in a cup of hot water. The cloud variables did show the change in temperature.

Fourth -  The temperature sensor program was tweaked by adding the RGB+Piezo program into it. Still the temperature and RGB+Piezo were independent entities.

Final - The If else function was added to light up the RGB to red when temperature crossed 50 degree Celsius which would otherwise be green and the piezo would make the beep beep sound. The Program was linked to IFTTT to sent an SMS once the temperature was achieved. In the program, Publish function was used to send a notification to the user to alert that, " The food is cooked; Its time to eat. 

Temperature readings and output recorded

Cold- 22.25degree Celcius/72 degree Fahrenheit; Green Light On.

Warm- 25.62 degree Celcius/78 degree Fahrenheit; Green Light On.
Hot-  55.87 degree Celcius/132.57 degree Fahrenheit; Red Light On." Beep Beep" from Piezo. Notification sent through IFTTT to mobile phone.

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!