Zachary HamptonPeyton FowlerSamuel Guyton
Published

IOT Project 2020: Refrigerator Temperature Monitor

Our team created a circuit that measures the temperature of a refrigerator to make sure your food stays crisp and cold.

IntermediateFull instructions provided562
IOT Project 2020: Refrigerator Temperature Monitor

Things used in this project

Hardware components

Argon
Particle Argon
×3
Breadboard (generic)
Breadboard (generic)
×3
Temperature Sensor
Temperature Sensor
×1
Jumper wires (generic)
Jumper wires (generic)
×16
LED (generic)
LED (generic)
×2
Resistor 10k ohm
Resistor 10k ohm
×1
Photo resistor
Photo resistor
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
ThingSpeak API
ThingSpeak API

Story

Read more

Schematics

circuitiotproject_wvl4YHK06Q.pdf

Code

Temp+Light Sensor

C/C++
This particle argon senses temperature and light and uses those values to set off remote indicators telling if the door has been opened and if the temperature has warmed at any point in time. It also receives feedback from the remote indicators and turns on separate LEDs when confirmation of an indicator being turned on is received. Temperature is continuously plotted to a chart via ThingSpeak at the same time.
// This #include statement was automatically added by the Particle IDE.
#include <ThingSpeak.h>

int temp = 0;
int light = 0;
int indicatortemp;
int indicatorlight;
int f;

TCPClient client;
unsigned long myChannelNumber = 1248239;
const char * myWriteAPIKey = "VDKK6NMO5YSV2P6M";

void setup(){
    ThingSpeak.begin(client);
    pinMode(D2, OUTPUT);
    pinMode(D3, OUTPUT);
    Particle.subscribe("FridgeIsWarm", TempIndication);
    Particle.subscribe("DoorIsOpen", DoorIndication);
}

void loop() {
    delay(1500);
    temp = (analogRead(A1));
    light = (analogRead(A0));
    f = (temp * .000244200244 * 300);
    ThingSpeak.setField(1, f);
    Serial.println("f");
    ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
    delay(1000);
    
    if (temp > 600) {
        indicatortemp = true;
        Particle.publish("TwoGuysPlusOneGotCovid1248", String(indicatortemp));
    }
    else {
        indicatortemp = false;
    }
    
    if (light > 30) {
        indicatorlight = true;
        Particle.publish("TwoGuysPlusOneTestedNegative1248", String(indicatorlight));
    }
    else {
        indicatorlight = false;
    }
}

void TempIndication(const char *event, const char *data) {
        digitalWrite(D2, HIGH);
}

void DoorIndication(const char *event, const char *data) {
        digitalWrite(D3, HIGH);
}

Open Door Indicator

C/C++
Remote indicator telling if the refrigerator/freezer door has been opened at any point.
int doorindicator;

void setup() {
    Particle.subscribe("TwoGuysPlusOneTestedNegative1248", light);
    pinMode(D7, OUTPUT);
    pinMode(D2, INPUT);
}

void loop() {
    doorindicator = digitalRead(D2);
    
    if (doorindicator == true) {
        Particle.publish("DoorIsOpen", String(doorindicator));
    }
    delay(3000);
}

void light(const char *event, const char *data) {
    digitalWrite(D7, HIGH);
}

Warm Temp Indicator

C/C++
Remote indicator telling if the refrigerator/freezer temperature has warmed at any point.
int tempindicator;

void setup() {
    Particle.subscribe("TwoGuysPlusOneGotCovid1248", TempSensor);
    pinMode(D7, OUTPUT);
    pinMode(D2, INPUT);
}

void loop() {
    tempindicator = digitalRead(D2);
    
    if (tempindicator == true) {
        Particle.publish("FridgeIsWarm", String(tempindicator));
    }
    
    delay(3000);
}

void TempSensor(const char *event, const char *data) {
        digitalWrite(D7, HIGH);
}

Credits

Zachary Hampton

Zachary Hampton

1 project • 1 follower
Peyton Fowler

Peyton Fowler

1 project • 2 followers
Samuel Guyton

Samuel Guyton

1 project • 2 followers

Comments