JustDoElectronics
Published

Smart Trolley Using RFID

We all have waited in a queue for payment in shopping malls and other places, its very tiring and wastes a lot of time in the billing proces

ExpertFull instructions provided2 hours4,400
Smart Trolley Using RFID

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

untitled_sketch_bbmkk_1w0K8zNjD4.png

Code

Smart trolly code

Arduino
//Prateek
//www.prateeks.in

#include <Arduino.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);

char input[12];
int count = 0;
int a;
int p1=0,p2=0,p3=0,p4=0; 
int c1=0,c2=0,c3=0,c4=0;

double total = 0;
int count_prod = 0;


void setup ()
{
//  Pin direction
   
  pinMode(3, INPUT_PULLUP);   //Push Switch
  pinMode(4, OUTPUT);         //RED LED
  pinMode(5, OUTPUT);         //BUZZER
  pinMode(6, OUTPUT);         //GREEN LED

// Initialization
  Serial.begin(9600);

  
//  lcd.begin();
 lcd.init();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print(" AUTOMATIC BILL");
  delay (2000);
  lcd.setCursor(0, 1);
  lcd.print("  SHOPPING CART       ");
  delay (2000);
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("   WELCOME TO ");
  lcd.setCursor(0, 1); 
  lcd.print("JUSTDOELECTRONIC");

}
 void loop()
{
  
 count = 0;
    while (Serial.available() && count < 12)
    {
      input[count] = Serial.read();
      delay(5);
    }
      int a=digitalRead(3);
      
     if ((strncmp(input, "4000350ABAC5", 12) == 0) && (a == 1))
      {
       
        lcd.setCursor(0, 0);
        lcd.print("Butter Added       ");
        lcd.setCursor(0, 1);
        lcd.print("Price(Rm):4.00      ");
        digitalWrite(4,HIGH);
        digitalWrite(5,LOW);
        digitalWrite(6,HIGH);
        delay(2000);
        total = total + 4.00;
        count_prod++;
        digitalWrite(4,LOW);
        digitalWrite(5,HIGH);
        digitalWrite(6,LOW);
        
      }


      else if ((strncmp(input, "4000350ABAC5", 12) == 0) && (a == 0))
      {
        if(p1>0)
        {
        lcd.clear();
        lcd.setCursor(0, 0);
        lcd.print("Butter Removed!!!        "); 
        digitalWrite(4,HIGH);
        digitalWrite(5,LOW);
        digitalWrite(6,HIGH);
        delay(2000);
        total = total - 4.00;
        lcd.clear();
       digitalWrite(4,LOW);
        digitalWrite(5,HIGH);
        digitalWrite(6,LOW);
        }
        else
        {
        lcd.clear();
        lcd.setCursor(0, 0);
        lcd.print("Not in cart!!!        ");
        digitalWrite(4,HIGH);
        digitalWrite(5,LOW);
        digitalWrite(6,HIGH);
        delay(2000);
        digitalWrite(4,LOW);
        digitalWrite(5,HIGH);
        digitalWrite(6,LOW);
        lcd.clear();
        }
      }


       if ((strncmp(input, "4000351B7B15", 12) == 0) && (a == 1))
      {
        lcd.setCursor(0, 0);
        lcd.print("Milk Added       ");
        lcd.setCursor(0, 1);
        lcd.print("Price(Rm):6.00      ");
       
        digitalWrite(6,HIGH);
        delay(2000);
        total = total + 6.00;
        count_prod++;
        digitalWrite(4,LOW);
        digitalWrite(5,HIGH);
        digitalWrite(6,LOW);
        
      }


      else if ((strncmp(input, "4000351B7B15", 12) == 0) && (a == 0))
      {
        if(p2>0)
        {
        lcd.clear();
        lcd.setCursor(0, 0);
        lcd.print("Butter Removed!!!        ");
         digitalWrite(4,HIGH);
        digitalWrite(5,LOW);
        digitalWrite(6,HIGH);
        delay(2000);
     
        lcd.clear();
        digitalWrite(4,LOW);
        digitalWrite(5,HIGH);
        digitalWrite(6,LOW);
        }
        else
        {
        lcd.clear();
        lcd.setCursor(0, 0);
        lcd.print("Not in cart!!!        ");
         digitalWrite(4,HIGH);
        digitalWrite(5,LOW);
        digitalWrite(6,HIGH);
        delay(2000);
        digitalWrite(4,LOW);
        digitalWrite(5,HIGH);
        digitalWrite(6,LOW);
        lcd.clear();
        }
      }

    if ((strncmp(input, "4000355181A5", 12) == 0) && (a == 1))
      {

     lcd.clear();  
     lcd.setCursor(0, 0);
     lcd.print("Total Price :-");
        
     lcd.setCursor(0, 1);
     lcd.print(total);

     delay(5000);
     lcd.clear();
   lcd.setCursor(0, 0);
  lcd.print("  THANKS FOR  ");
   lcd.setCursor(0, 1);
  lcd.print("   VISITING ");
     
      }     

}

Credits

JustDoElectronics

JustDoElectronics

2 projects • 0 followers
Electronics And Tele-Communication Engineer

Comments