Introduction
In this Tutorial, We make a smart shopping cart using RFID readers and RFID cards with NodeMCU.The cart will Display all information and the total value will be displayed on the webpage as well as on the LCD.
- we have faced a problem in shopping malls and markets. Because if you buy anything but when the time to pay bill is Wastes a lot of time in billing Process.
- That’s why we built a smart shopping cart with an automatic billing system. that not only reduces the waiting time but the payment process is easy for everyone.
- Here we used the RFID Cards and RFID Reader with nodeMCU(ESP8266) to build the smart shopping cart. and the cart information and total value will be displayed on the webpage as well on LCD Display.
- Each RFID Tag has a Different Product. and just put the Details in a code.RFID Reader is in the cart, which Reads the RFID tags and finds out the Product Details.
Bill of Materials
S.N. | Component | Quantity | Link To Buy |
1 | ESP8266 | 1 | |
2 | 20x4 LCD Display | 1 | |
3 | EM-18 RFID Module | 1 | |
4 | RFID Tag | 1 | |
5 | Red Led | 1 | |
6 | Green Led | 1 | |
7 | Buzzer | 1 | |
8 | Push Button | 1 |
Component
Here are all the components of the project… We will give some Details about each component.
ESP8266
NodeMCU is an IoT Module based on the ESP8266 Wi-Fi module. NodeMCU uses Lua Scripting language and is an open-source Internet of Things (IoT) platform. This module has CH340g USB to TTL IC.
Specification of Node-MCU IoT Module:-
- It is based on ESP8266 and integrates GPIO, PWM, IIC, 1-Wire and ADC in one board.
- Power your development in the fastest way by combining with NodeMCU Firmware!
- USB-TTL included plug&play
- 10 GPIO, every GPIO can be PWM, I2C, 1-wire
Features of Node-MCU IoT Module:-
- Open-source IoT Platform
- Easily Programmable
- Low Cost & Simple to Implement
- WI-FI enabled
EM-18 Reader Module
This EM-18 RFID Reader is a Tiny, simple-to-use RFID reader module. With a built-in antenna, the only holdup is the 2mm pin spacing. Power the module, hold up a card, and get a serial string output containing the unique ID of the card. It has TTL output.
Specifications –
- Operating Voltage: 5V DC Supply
- Reading Distance: 6-10 cm.
- Read frequency: 125 kHz.
- Operating Frequency: 125 kHz
- Read Distance: 5 cm
- Compatible Tags: 125KHz
Application –
- Smart Access Control System.
- Card-Based Entry System.
- Attendance System.
- Smart Trolly
16×2 LCD Display
LED
A Red light-emitting diode (LED) is a semiconductor light source. LEDs are used as indicator lamps in many devices and are increasingly used for other lighting. It looks like a red LED and it illuminates Red light.
Features:-
- Choice of various viewing angles
- Reliable and robust
- The product itself will remain within RoHS compliant version Applications
Specifications:-
- Glow Color: Red, Green
- Forward voltage: 2.2 V to 2.4 V
Buzzer
The active Buzzer Alarm Module for Arduino is an audio signaling device, which may be mechanical, electromechanical, or piezoelectric. Just like what you are viewing now, it is a 3.3V-5V DC Electronic Part Active Buzzer Module.
Push Button
These are very small duty SPST Single Pole Single push buttons that are not normally Open. Push buttons are only rated up to 50mA at 5V DC and are intended for low-voltage operations such as providing digital inputs to microcontrollers.
Circuit Diagram
we will use EasyEDA Software to Design The Circuit Diagram And Proper PCB of the Project.
- We just connect the all components in the ESP8266 Microcontroller Pin. The 16×2 LCD Display Will be connected to the I2C Pine Numbers SCL-D1, SDA-D2, VCC-5v, And GND-GND.
- The EM-18 Module Will Connect To The TX-RX Pin, VCC-5V And GND-GND.
- The Red Led Will be connected to PIN D7, Green Led-D5, and Buzzer-D6 and The Push button Will be connected to PIN Numbr-D4.
Source Code
Here we will give the code Before You upload the code you just Edit the wifi SSID And Password And Then You Select the proper Board and Upload The Code.
LiquidCrystal_I2C
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 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 |
//Prateek //www.justdoelectronics.com #include <ESP8266WiFi.h> #include <WiFiClient.h> #include <ESP8266WebServer.h> #include <LiquidCrystal_I2C.h> #include <Wire.h> void printDetail(uint8_t type, int value); LiquidCrystal_I2C lcd(0x27, 20, 4); const char* ssid = "JustDo"; //Replace with your network SSID const char* password = "par12345"; //Replace with your network password ESP8266WebServer server(80); String page = ""; 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; int led1 = D3; int led2 = D5; int buzzer = D6; void setup() { Serial.begin(115200); pinMode(D4, INPUT_PULLUP); pinMode(led1, OUTPUT); pinMode(led2, OUTPUT); pinMode(buzzer, OUTPUT); Serial.begin(9600); WiFi.begin(ssid, password); Wire.begin(D2, D1); lcd.begin(); lcd.backlight(); lcd.setCursor(2, 0); lcd.print("WELCOME TO "); lcd.setCursor(5, 1); lcd.print("SMART TROLLY"); delay(2000); lcd.clear(); lcd.setCursor(2, 0); lcd.print(" IoT Based"); lcd.setCursor(5, 1); lcd.print(" Smart Cart"); delay(3000); lcd.clear(); while (WiFi.status() != WL_CONNECTED) { delay(500); lcd.setCursor(3, 0); lcd.print("WiFi Connecting... "); } Serial.print(WiFi.localIP()); lcd.setCursor(3, 0); lcd.print("WiFi Connected"); lcd.setCursor(3, 1); lcd.print(WiFi.localIP()); delay(2000); lcd.setCursor(3, 0); lcd.print(" PLZ SCAN ITEMS "); lcd.setCursor(3, 1); lcd.print(" TO CART "); server.begin(); } void loop() { int a = digitalRead(D4); if (Serial.available()) { count = 0; while (Serial.available() && count < 12) { input[count] = Serial.read(); count++; delay(5); } if (count == 12) { if ((strncmp(input, "03007C4D2517", 12) == 0) && (a == 1)) { lcd.clear(); lcd.setCursor(3, 0); lcd.print("Suger Added"); lcd.setCursor(3, 1); lcd.print("Price(Rs):35.00"); p1++; digitalWrite(led1, HIGH); digitalWrite(buzzer, HIGH); delay(2000); total = total + 35.00; count_prod++; digitalWrite(led1, LOW); digitalWrite(buzzer, LOW); lcd.clear(); lcd.setCursor(0, 0); lcd.print(" PLZ ADD ITEM"); lcd.setCursor(0, 1); lcd.print(" TO CART "); } else if ((strncmp(input, "03007C4D2517", 12) == 0) && (a == 0)) { if (p1 > 0) { lcd.clear(); lcd.setCursor(3, 0); lcd.print("Suger Removed"); digitalWrite(led2, HIGH); digitalWrite(buzzer, HIGH); delay(2000); p1--; total = total - 35.00; count_prod--; digitalWrite(led2, LOW); digitalWrite(buzzer, LOW); lcd.clear(); lcd.setCursor(0, 0); lcd.print(" PLZ ADD ITEM"); lcd.setCursor(0, 1); lcd.print(" TO CART "); } else { lcd.clear(); lcd.setCursor(0, 0); lcd.print(" PLZ ADD ITEM"); lcd.setCursor(0, 1); lcd.print(" TO CART "); } } else if ((strncmp(input, "03007C561F36", 12) == 0) && (a == 1)) { lcd.clear(); lcd.setCursor(3, 0); lcd.print("Milk Added"); lcd.setCursor(3, 1); lcd.print("Price(Rs):24.00"); total = total + 24.00; digitalWrite(led1, HIGH); digitalWrite(buzzer, HIGH); delay(2000); p2++; count_prod++; digitalWrite(led1, LOW); digitalWrite(buzzer, LOW); lcd.clear(); lcd.setCursor(0, 0); lcd.print(" PLZ ADD ITEM"); lcd.setCursor(0, 1); lcd.print(" TO CART "); } else if ((strncmp(input, "03007C561F36", 12) == 0) && (a == 0)) { if (p2 > 0) { lcd.clear(); lcd.setCursor(3, 0); lcd.print("Milk Removed"); digitalWrite(led2, HIGH); digitalWrite(buzzer, HIGH); delay(2000); p2--; total = total - 24.00; count_prod--; digitalWrite(led2, LOW); digitalWrite(buzzer, LOW); lcd.clear(); lcd.setCursor(0, 0); lcd.print(" PLZ ADD ITEM"); lcd.setCursor(0, 1); lcd.print(" TO CART "); } else { lcd.clear(); lcd.setCursor(0, 0); lcd.print(" PLZ ADD ITEM"); lcd.setCursor(0, 1); lcd.print(" TO CART "); } } else if ((strncmp(input, "03007C12315C", 12) == 0) && (a == 1)) { lcd.clear(); lcd.setCursor(3, 0); lcd.print("Biscuits Added"); lcd.setCursor(3, 1); lcd.print("Price(Rs):10.00"); total = total + 10.00; digitalWrite(led1, HIGH); digitalWrite(buzzer, HIGH); delay(2000); p3++; count_prod++; digitalWrite(led1, LOW); digitalWrite(buzzer, LOW); lcd.clear(); lcd.setCursor(0, 0); lcd.print(" PLZ ADD ITEM"); lcd.setCursor(0, 1); lcd.print(" TO CART "); } else if ((strncmp(input, "03007C12315C", 12) == 0) && (a == 0)) { if (p3 > 0) { lcd.clear(); lcd.setCursor(3, 0); lcd.print("Biscuits Removed"); digitalWrite(led2, HIGH); digitalWrite(buzzer, HIGH); delay(2000); p3--; total = total - 10.00; count_prod--; digitalWrite(led2, LOW); digitalWrite(buzzer, LOW); lcd.clear(); lcd.setCursor(0, 0); lcd.print(" PLZ ADD ITEM"); lcd.setCursor(0, 1); lcd.print(" TO CART "); } else { lcd.clear(); lcd.setCursor(0, 0); lcd.print(" PLZ ADD ITEM"); lcd.setCursor(0, 1); lcd.print(" TO CART "); } } else if ((strncmp(input, "03007C186007", 12) == 0) && (a == 1)) { lcd.clear(); lcd.setCursor(3, 0); lcd.print("Dairy Mlik"); lcd.setCursor(3, 1); lcd.print("Price(Rs):20.00"); total = total + 20.00; digitalWrite(led1, HIGH); digitalWrite(buzzer, HIGH); delay(2000); p4++; count_prod++; digitalWrite(led1, LOW); digitalWrite(buzzer, LOW); lcd.clear(); lcd.setCursor(0, 0); lcd.print(" PLZ ADD ITEM"); lcd.setCursor(0, 1); lcd.print(" TO CART "); } else if ((strncmp(input, "03007C186007", 12) == 0) && (a == 0)) { if (p4 > 0) { lcd.clear(); lcd.setCursor(3, 0); lcd.print("DairyMlik Removed"); digitalWrite(led2, HIGH); digitalWrite(buzzer, HIGH); delay(2000); p4--; total = total - 20.00; count_prod--; digitalWrite(led2, LOW); digitalWrite(buzzer, LOW); lcd.clear(); lcd.setCursor(0, 0); lcd.print(" PLZ ADD ITEM"); lcd.setCursor(0, 1); lcd.print(" TO CART "); } else { lcd.clear(); lcd.setCursor(0, 0); lcd.print(" PLZ ADD ITEM"); lcd.setCursor(0, 1); lcd.print(" TO CART "); } } } lcd.setCursor(1, 3); lcd.print("Total Price:-"); lcd.setCursor(14, 3); lcd.print(total); } server.handleClient(); } |
More projects
- Smart Shopping Cart Using RFID & Arduino
- RC-522 RFID Interfacing With ARDUINO, ESP8266 & ESP32
- EM-18 RFID Interfacing With Arduino, ESP8266 & ESP32