Price AlphinDrew Demers
Published

MEGR 3171 Fridge Temp monitor team 26

This IOT project is a simple temperature and photoresistor project that works to see if your fridge is working at the proper temperature

IntermediateFull instructions provided4 hours22
MEGR 3171 Fridge Temp monitor team 26

Things used in this project

Hardware components

Temperature Sensor
Temperature Sensor
×1
Photo resistor
Photo resistor
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×2
Argon
Particle Argon
×2
Resistor 220 ohm
Resistor 220 ohm
×1
Micro-USB to USB Cable (Generic)
Micro-USB to USB Cable (Generic)
×2

Software apps and online services

ThingSpeak API
ThingSpeak API
Google Sheets
Google Sheets

Hand tools and fabrication machines

Tape, Clear
Tape, Clear
Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Photocell Wiring Diagram

This is the wiring diagram of the photocell circuit that was used in our project.

Temperature sensor wiring

This is the simple wiring diagram of how the temperature sensor was connected.

Code

Light Sensor Code

C/C++
This is the code used to operate the light senor circuit.
int led2=D7;
int photoresistor = A0;
 
int analogValue;
 

void setup() {
    pinMode(led2,OUTPUT);
  pinMode(photoresistor, INPUT);
   Particle.variable("photoresistor", analogValue);
   
    Particle.subscribe("Temp",value,"e00fce68ed5a561dfd850454");

}
void loop() {
    delay(10000);
  analogValue = analogRead(photoresistor);
  
  if (analogValue >50){
      
      digitalWrite(led2, HIGH);
      Particle.publish("Open","The fridge is open",PRIVATE);
      delay(1000);
  }
 
else{ 
    digitalWrite(led2,LOW);
    Particle.publish("Closed","The fridge is closed", PRIVATE);
    delay(1000);
}}

Temperature Sensor Code

C/C++
This is the code used to operate our temp sensor circuit.
#define sensorPin A0

void setup() {
     Particle.subscribe("Open",value,"e00fce68ed5a561dfd850454");
    Particle.subscribe("Closed",close,"e00fce68ed5a561dfd850454");

  // Begin serial communication at a baud rate of 9600:
  Serial.begin(9600);
}

void loop() {
  // Get a reading from the temperature sensor:
  int reading = analogRead(sensorPin);

  // Convert the reading into voltage:
  float voltage = reading * (590 / 1024.0);

  // Convert the voltage into the temperature in Celsius:
  float temperature = (voltage - 500) / 10;
  
  Particle.publish("temp",temp, PRIVATE);

  // Print the temperature in the Serial Monitor:
  Serial.print(temperature);
  Serial.print(" \xC2\xB0"); // shows degree symbol
  Serial.println("C");

  delay(1000); // wait a second between readings
}

Credits

Price Alphin

Price Alphin

1 project • 1 follower
Drew Demers

Drew Demers

1 project • 1 follower

Comments

Add projectSign up / Login