Hipo Shun
Published © GPL3+

Refrigerator Checker

Do you have the trouble on determining the function of a refrigerator? Yes we are suffering too!That is why we build a refrigerator checker!

IntermediateFull instructions provided24 hours2,024
Refrigerator Checker

Things used in this project

Hardware components

Photo resistor
Photo resistor
×1
LED Matrix 7219 MAX 8*8
×1
LED (generic)
LED (generic)
×2
DS18B20 Temperature Sensor
×1
Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Jumper wires (generic)
Jumper wires (generic)
×4
Resistor 100 ohm
Resistor 100 ohm
×1
100k ohm resistor
×1
4.7k ohm resistor
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Schematics

it is not 100% accurate
pls refer to the actual photo

SCHEMATICS

Code

Refrigerator checker

C/C++
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 2
#include "LedControl.h"

int Temperature;
int lightPin = 0;
int led = 4;
long previousMillis = 0;
long interval = 100;
unsigned long delayTime = 1000; // Delay between Frames


LedControl lc = LedControl(12, 11, 10, 1);
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

byte invader1a[] =
{
  B10000001,  // First frame of invader #1
  B01000010,
  B00100100,
  B00011000,
  B00011000,
  B00100100,
  B01000010,
  B10000001
};

byte invader1b[] =
{
  B00000000, // Second frame of invader #1
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000
};


byte invader1c[] =
{
  B00000000,  // First frame of invader #1
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000
};

byte invader1d[] =
{
  B00000000, // Second frame of invader #1
  B00000001,
  B00000010,
  B00000100,
  B10001000,
  B01010000,
  B00100000,
  B00000000
};

byte invader1e[] =
{
  B01100010,  // First frame of invader #1
  B10010101,
  B10010101,
  B10010010,
  B10010000,
  B10010000,
  B10010000,
  B01100000
};

byte invader1f[] =
{
  B00000000, // Second frame of invader #1
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000
};



void setup() {

  pinMode(lightPin, OUTPUT);
  pinMode(led, OUTPUT);

  Serial.begin(9600);
  sensors.begin();

  lc.shutdown(0, false); // Wake up displays
  lc.shutdown(1, false);
  lc.setIntensity(0, 5); // Set intensity levels
  lc.setIntensity(1, 5);
  lc.clearDisplay(0);  // Clear Displays
  lc.clearDisplay(1);
}


void sinvader1a()
{
  for (int i = 0; i < 8; i++)
  {
    lc.setRow(0, i, invader1a[i]);
  }
}

void sinvader1b()
{
  for (int i = 0; i < 8; i++)
  {
    lc.setRow(0, i, invader1b[i]);
  }
}

void sinvader1c()
{
  for (int i = 0; i < 8; i++)
  {
    lc.setRow(0, i, invader1c[i]);
  }
}

void sinvader1d()
{
  for (int i = 0; i < 8; i++)
  {
    lc.setRow(0, i, invader1d[i]);
  }
}

void sinvader1e()
{
  for (int i = 0; i < 8; i++)
  {
    lc.setRow(0, i, invader1e[i]);
  }
}

void sinvader1f()
{
  for (int i = 0; i < 8; i++)
  {
    lc.setRow(0, i, invader1f[i]);
  }
}






void loop() {

  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis > interval) {
    previousMillis = currentMillis;
    int reading  = analogRead(lightPin);
    int ledvalue = reading / 1;
    analogWrite(led, ledvalue);
    delay(0);
  }

  sensors.requestTemperatures();
  Temperature = sensors.getTempCByIndex(0);
  Serial.print("Temperature is: ");
  Serial.print(Temperature);

  if (Temperature >= 14)
  {
    sinvader1a();
    delay(delayTime);
    sinvader1b();
    delay(delayTime);
  } else if (Temperature < 14 && Temperature > 0 ) {
    sinvader1c();
    delay(delayTime);
    sinvader1d();
    delay(delayTime);
  } else if (Temperature <= 0) {
    sinvader1e();
    delay(delayTime);
    sinvader1f();
    delay(delayTime);
  }




}

Credits

Hipo Shun

Hipo Shun

1 project • 0 followers
Thanks to Nick Koumaris.

Comments