Smart refrigerator

Updated: May 2, 2020

Component required

GSM module

Breadboard

Force resistor

Arduino mega


Working principal

In this smart refrigerator, there are different force resistor that is attached to different food tray in the fridge .if the force register gets less weight from any food tray then it will send message to the user cell phone that this food gets low in-tray. Depending upon the requirement the user will order the food





code

#include<SoftwareSerial.h>

SoftwareSerial gsm(2,3);

float cf = 19.5; // calibration factor

int ffs1 = A0; // Force sensor is connected analog pin A0 of arduino or mega.

int ffsdata = 0;

float vout1;

float vout2;

float vout3;

float vout4;

void setup()

{

  Serial.begin(9600);

  pinMode(ffs1, INPUT);

}

void loop()

{

 ffsdata = analogRead(ffs1);

 vout1 = (ffsdata * 5.0) / 1023.0;

 vout1= vout1 * cf ;

if(vout1<5)

{

    if (Serial.available()>0)

     {

        mySerial.println("AT+CMGF=1");    //Sets the GSM Module in Text Mode

        delay(1000);  // Delay of 1 second

        mySerial.println("AT+CMGS=\"+917896xxxxxx\"\r"); // Replace x with mobile number

        delay(1000);

        mySerial.println("the capusicum get low");// The SMS text you want to send

         delay(100);

        mySerial.println((char)26);// ASCII code of CTRL+Z for saying the end of sms to  the module

         delay(1000);

     }

}

vout2 = (ffsdata * 5.0) / 1023.0;

vout2= vout2 * cf ;

if(vout2<5)

{

    if (Serial.available()>0)

     {

        mySerial.println("AT+CMGF=1");    //Sets the GSM Module in Text Mode

        delay(1000);  // Delay of 1 second

        mySerial.println("AT+CMGS=\"+917896xxxxxx\"\r"); // Replace x with mobile number

        delay(1000);

        mySerial.println("the tomato get low");// The SMS text you want to send

         delay(100);

        mySerial.println((char)26);// ASCII code of CTRL+Z for saying the end of sms to  the module

         delay(1000);

     }

}

vout3 = (ffsdata * 5.0) / 1023.0;

vout3= vout3 * cf ;

if(vout3<5)

{

    if (Serial.available()>0)

     {

        mySerial.println("AT+CMGF=1");    //Sets the GSM Module in Text Mode

        delay(1000);  // Delay of 1 second

        mySerial.println("AT+CMGS=\"+917896xxxxxx\"\r"); // Replace x with mobile number

        delay(1000);

        mySerial.println("the cucumber get low");// The SMS text you want to send

         delay(100);

        mySerial.println((char)26);// ASCII code of CTRL+Z for saying the end of sms to  the module

         delay(1000);

     }

}

vout4 = (ffsdata * 5.0) / 1023.0;

vout4= vout4 * cf ;

if(vout3<5)

{

    if (Serial.available()>0)

     {

        mySerial.println("AT+CMGF=1");    //Sets the GSM Module in Text Mode

        delay(1000);  // Delay of 1 second

        mySerial.println("AT+CMGS=\"+917896xxxxxx\"\r"); // Replace x with mobile number

        delay(1000);

        mySerial.println("the butter  get low");// The SMS text you want to send

         delay(100);

        mySerial.println((char)26);// ASCII code of CTRL+Z for saying the end of sms to  the module

         delay(1000);

     }

}

}




30 views0 comments

Recent Posts

See All