49713 Designing for the Internet of Things
· 25 members
A hands-on introductory course exploring the Internet of Things and connected product experiences.
ReadyPot is an IoT connected device that detects when a pot of water is boiling and alerts the user via phone notification and audio alarm
I am designing for my sister. She cooks at home a lot and, currently, besides watching a pot of water, there is no way to alert her when the water is boiling. This device should allow her to step away from the stove and work on other tasks and still be notified when the water has reached the right temperature.
My goal is to create an IoT connected device that measures the temperature of the water and, when the boiling temperature has been sustained for a suitable amount of time, alerts my sister through phone notification as well as an audible alarm if in case she happens to be nearby. This way she will be notified immediately when she is able to start cooking.
As I approached this project, I knew interfacing and measuring from the one-wire temperature sensor would be the greatest struggle, so it was the first obstacle I tried to overcome. The biggest problem I ran into was library related since I needed to find libraries with built in code to retrieve measurement values. After implementing the correct libraries for the sensor, I linked the temperature readings to the serial monitor to verify correct temperature readings.
Next, I tackled the objective of signaling a piezo buzzer as part of the alarm system. This was difficult at first since I learned that piezo buzzers run off PWM signals. However, after discovering the tone() function built into arduino it was quite simple. I then found code to play the mario theme song and made heavy adjustments so as to play notes that were audibly distinguishable.
I then implemented an LED visual output that synced with the buzzer alarm.
Finally, I connected the particle photon platform with the IFTTT service so that when boiling was detected my phone would receive a notification.
This prototype has fairly complete functionality. Future iterations would remove the repeating audio alarm so that it only triggered once or twice. I would also create stronger lead connections and possibly create a more permanent platform on proto board.
Bill of parts:
1 particle photon board
1 breadboard
1 piezo board
1 LED
2 10 KOhm resistors
1 One-Wire sealed temperature sensor
Assorted jumper wires
#include "OneWire.h"
#include "spark-dallas-temperature.h"
OneWire oneWire(D0);
DallasTemperature dallas(&oneWire);
double temperature = 0.0;
double temperatureF = 0.0;
int check = 0;
void setup() {
Particle.variable("temperature", &temperature, DOUBLE);
Particle.variable("temperatureF", &temperatureF, DOUBLE);
pinMode(D1, OUTPUT);
pinMode(D2, OUTPUT);
dallas.begin();
Serial.begin(9600);
digitalWrite(D1,LOW);
}
void loop() {
dallas.requestTemperatures();
// get the temperature in Celcius
float tempC = dallas.getTempCByIndex(0);
// convert to double
temperature = (double)tempC;
// convert to Fahrenheit
float tempF = DallasTemperature::toFahrenheit( tempC );
// convert to double
temperatureF = (double)tempF;
Serial.println(temperatureF);
if (temperatureF > 135.0){
if (check==0)
{
Particle.publish("boiling-water", "high");
}
check = 1;
playMario();
}
else
{
Particle.publish("boiling-water", "low");
check = 0;
digitalWrite(D1,LOW);
}
delay(1000);
}
void playMario()
{
digitalWrite(D2,HIGH);
tone(D1,1320,100);
delay(150);
tone(D1,1320,100);
delay(300);
tone(D1,1320,100);
delay(300);
tone(D1,1020,100);
delay(100);
tone(D1,1320,100);
delay(300);
tone(D1,1540,100);
delay(550);
tone(D1,760,100);
delay(575);
tone(D1,1020,100);
delay(450);
tone(D1,760,100);
delay(400);
tone(D1,640,100);
delay(500);
tone(D1,880,100);
delay(300);
tone(D1,960,80);
delay(330);
tone(D1,900,100);
delay(150);
tone(D1,860,100);
delay(300);
tone(D1,760,100);
delay(200);
tone(D1,1320,80);
delay(200);
tone(D1,1520,50);
delay(150);
tone(D1,1720,100);
delay(300);
tone(D1,1400,80);
delay(150);
tone(D1,1520,50);
delay(350);
tone(D1,1320,80);
delay(300);
tone(D1,1040,80);
delay(150);
tone(D1,1160,80);
delay(150);
tone(D1,960,80);
delay(500);
digitalWrite(D2,LOW);
}
Click to Expand
This project was a very interesting experience. Much of what I worked with I had already been exposed to, however, there were a few parts I was previously unfamiliar with. I was able to learn the process to interface with the temperature sensor and the libraries needed as well as the code needed to use a piezo buzzer and what pins are able to emit PWMs.
I feel very satisfied with this project and would do nothing differently.
A hands-on introductory course exploring the Internet of Things and connected product experiences.
ReadyPot is an IoT connected device that detects when a pot of water is boiling and alerts the user via phone notification and audio alarm
January 31st, 2018