Overview
In this project we will build a Smart Shopping Cart with an Automatic Billing System using EM-18 RFID Module & Arduino. The project is super easy to build and requires only a few electronics components. In this system, every product in Mart will have an RFID tag, and every cart will be having RFID Reader. When a product is scanned, the price is automatically added to the billing system. The LCD Display in this project shows the item name along with the price.
A supermarket is a place where customers come to purchase their daily using products and pay for them. So there is a need to calculate how many products are sold and generate the bill for the customer. When we go to a shopping cart for shopping, we have to work for selecting the right product. Also, after that, it is hectic to stand in line for billing all the goods. Hence, we are proposing to develop a smart shopping cart system that will keep the track of purchased products for billing using RFID and Arduino.
You can check some of the RFID Based projects as well:
- RFID Based Security System
- RFID Based Student Attendance System
- RFID Based Automated Toll Collection System
Bill of Materials
You need to buy the following components for this project.
| S.N. | Components | Quantity | Purchase Links |
|---|---|---|---|
| 1 | Arduino Nano Board | 1 | Amazon | AliExpress |
| 2 | RFID Reader EM-18 | 1 | Amazon | AliExpress |
| 3 | RFID Card 125KHz | 5-10 | Amazon | AliExpress |
| 4 | Red LED 5mm | 1 | Amazon | AliExpress |
| 5 | Green LED 5mm | 1 | Amazon | AliExpress |
| 6 | Buzzer 5V | 1 | Amazon | AliExpress |
| 7 | Push Button Switch | 1 | Amazon | AliExpress |
| 8 | LCD Display | 1 | Amazon | AliExpress |
| 9 | Potentiometer 10K | 1 | Amazon | AliExpress |
| 10 | Battery 18650 3.7V | 2 | Amazon | AliExpress |
Hardware Design & Circuit
The following is the circuit diagram for the Smart Shopping Cart with Automatic Billing System.
The main controller of this project is Arduino Nano Board where the project code is stored. The Arduino operates all the processes from reading RFID Cards info to storing and calculating prices. The RFID Module that we are using here is the EM-18 Module which operates at a frequency of 125KHz. Apart from the RFID Cards, we need 5-10 RFID cards. These RFID cards are named as different items name like tea, milk, biscuits, oil, etc.
The system has a buzzer that turns on when an RFID is scanned. There are two LEDs Red and Green LED. These LEDs turn on and off based on items added or removed. The most important part of the project is the LCD Display. We are using a 16×2 LCD display for this project. The 10K potentiometer is used with LCD Display for adjusting LCD contrast. When you press hold the reset button and scan the RFID, the items can be removed.
To power the entire circuit, we will use a pair of Lithium-Ion Batteries. Each 3.7V Samsung 18650 connects in series to give a 7.4V Supply. Then the 7.4V is supplied to Vin Pin of Arduino Board. The RFID and LCD module is powered via a 5V pin of Arduino Nano.
The Buzzer, Green LED and Red LED connects to digital pins 6, 5, and 4 of Arduino. The RFID Module EM-18 Tx pin connects to the RX0 pin of Arduino. The Reset button connects to the A4 Pin of Arduino. Pin 4, 6, 11, 12, 13, 14 of LCD connects to Pin 12, 11, 10, 9, 8, and 7 pins of Arduino.
Project PCB Gerber File & PCB Ordering Online
If you don’t want to assemble the circuit on a breadboard and you want PCB for the project, then here is the PCB for you. I used EasyEDA to design the Schematic & PCB. The Schematic & PCB Board for Arduino Smart Shopping Cart looks something like the below.
The Gerber File for the PCB is given below. You can simply download the Gerber File and order the PCB from ALLPCB at 1$ only.
You can use this Gerber file to order high quality PCB for this project. To do that visit the ALLPCB official website by clicking here: https://www.allpcb.com/.
You can now upload the Gerber File by choosing the Quote Now option. From these options, you can choose the Material Type, Dimensions, Quantity, Thickness, Solder Mask Color and other required parameters.
After filling all details, select your country and shipping method. Finally you can place the order.
You can assemble the components on the PCB Board.
Source Code/Program
The source code/program for Smart Shopping Cart with Automatic Billing System using RFID is written on Arduino IDE. The code is simple and easy to understand.
|
1 |
else if ((strncmp(input, "03007C2DA0F2", 12) == 0) && (a == 0)) |
In this code you need to replace the RFID Card Serial Number in every line that looks like the above line. To find the RFID Serial Number of your RFID Card, use the RFID Scanner Code and note down all the card RFID numbers first.
You can now copy the following code and upload it to the Arduino Board.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
#include <Arduino.h> #include <Wire.h> #include <LiquidCrystal.h> LiquidCrystal lcd(12, 11, 10, 9, 8, 7); 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 () { pinMode(A4, INPUT_PULLUP); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); lcd.clear(); Wire.begin(); Serial.begin(9600); 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"); delay (2000); lcd.setCursor(3, 1); lcd.print("SUPER MARKET"); delay (2000); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Plz Add iTem"); } void loop() { count = 0; while (Serial.available() && count < 12) { input[count] = Serial.read(); count++; delay(5); } int a = digitalRead(A4); if ((strncmp(input, "2700227A344B", 12) == 0) && (a == 1)) { lcd.setCursor(0, 0); lcd.print("Butter Added "); lcd.setCursor(0, 1); lcd.print("Price :- 10.00 "); p1++; digitalWrite(4, HIGH); digitalWrite(5, HIGH); digitalWrite(6, LOW); delay(2000); total = total + 10.00; count_prod++; digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, HIGH); } else if ((strncmp(input, "2700227A344B", 12) == 0) && (a == 0)) { if (p1 > 0) { lcd.clear(); lcd.setCursor(0, 0); lcd.print("Butter Removed!!! "); digitalWrite(4, HIGH); digitalWrite(5, HIGH); digitalWrite(6, LOW); delay(2000); p1--; total = total - 10.00; count_prod--; lcd.clear(); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, HIGH); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Total Price :-"); lcd.setCursor(0, 1); lcd.print(total); } else { lcd.clear(); lcd.setCursor(0, 0); lcd.print("Not in cart!!! "); digitalWrite(4, HIGH); digitalWrite(5, HIGH); digitalWrite(6, HIGH); delay(2000); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, LOW); lcd.clear(); } } if ((strncmp(input, "4000350ABAC5", 12) == 0) && (a == 1)) { lcd.setCursor(0, 0); lcd.print("Milk Added "); lcd.setCursor(0, 1); lcd.print("Price :- 20.00 "); p2++; digitalWrite(4, HIGH); digitalWrite(5, HIGH); digitalWrite(6, LOW); delay(2000); total = total + 20.00; count_prod++; digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, HIGH); } else if ((strncmp(input, "4000350ABAC5", 12) == 0) && (a == 0)) { if (p2 > 0) { lcd.clear(); lcd.setCursor(0, 0); lcd.print("Milk Removed!!! "); digitalWrite(4, HIGH); digitalWrite(5, HIGH); digitalWrite(6, LOW); delay(2000); p2--; total = total - 20.00; count_prod--; lcd.clear(); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, HIGH); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Total Price :-"); lcd.setCursor(0, 1); lcd.print(total); } else { lcd.clear(); lcd.setCursor(0, 0); lcd.print("Not in cart!!! "); digitalWrite(4, HIGH); digitalWrite(5, HIGH); digitalWrite(6, HIGH); delay(2000); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, LOW); lcd.clear(); } } if ((strncmp(input, "03007C2DA0F2", 12) == 0) && (a == 1)) { lcd.setCursor(0, 0); lcd.print("Tea Added "); lcd.setCursor(0, 1); lcd.print("Price :- 25.00 "); p3++; digitalWrite(4, HIGH); digitalWrite(5, HIGH); digitalWrite(6, LOW); delay(2000); total = total + 25.00; count_prod++; digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, HIGH); } else if ((strncmp(input, "03007C2DA0F2", 12) == 0) && (a == 0)) { if (p3 > 0) { lcd.clear(); lcd.setCursor(0, 0); lcd.print("Tea Removed!!! "); digitalWrite(4, HIGH); digitalWrite(5, HIGH); digitalWrite(6, LOW); delay(2000); p3--; total = total - 25.00; count_prod--; lcd.clear(); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, HIGH); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Total Price :-"); lcd.setCursor(0, 1); lcd.print(total); } else { lcd.clear(); lcd.setCursor(0, 0); lcd.print("Not in cart!!! "); digitalWrite(4, HIGH); digitalWrite(5, HIGH); digitalWrite(6, HIGH); delay(2000); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, LOW); lcd.clear(); } } } |
Working of the RFID Smart Shopping Cart Project
After uploading the code, you can start testing the device. Initially, the LCD display will show the message “Welcome To Super Market”.
The LCD will display the message to Add the item. You can add any item simply by scanning the item with an RFID tag.
For example, the RFID Card marked as Tea is scanned in our project. The LCD will display Tea is Added along with the price value of the tea.
You can scan other cards with different item names like Milk, Butter, or whatever you have assigned in your code. Every time you add any item, the price is added to the previous value with a total cost.
In case you want to remove any item from the list, then press and hold the reset button and scan the item. The item will be removed from the system and the price will be updated automatically.
At the end of shopping the shopper can show the total price value of the products and pay the final price.
This is how you can build your own Smart Shopping Cart with an Automatic Billing System using RFID and Arduino.



















4 Comments
That is quite informative. I like this article very much. The content was good. If any of the engineering students are looking for a project, I found this site and they are providing the best service to the engineering students regarding the projects.
how use to rfid tags
What if one uses RC522 reader will it be possible and if yes can you kindly assist me with the code
did you win with the code