Arduino-Based Ordering System using QR/Barcode Scanner

So, we have this project wherein with the use of a QR/Barcode scanner, we will create a Arduino-Based canteen ordering system, in which a user will scan his/her QR/Barcode attached to their IDs in order to access the system and successfully place their order with their names associated with their respective orders.

So basically, without the integration of the QR/Barcode scanner, the system would be like this: DIY Smart Menu Ordering System using Arduino - YouTube

The question now, is it possible to create a connection or to connect/integrate the QR/Barcode scanner to the Arduino Uno to create the product?

*This the type of QR/Barcode scanner that we will use:


*

Most Arduinos can't handle USB devices on their own. The USB QR reader I have has four holes on one edge of the circuit board labeled "5V TX RX GND" so I expect you can connect to it with 5V Serial. If so, that would be much easier than adding a USB Host Shield to an Arduino to read the device through USB.

1 Like

There's scanner compatible with Arduino,

Check it:

Assuming you only have as,all number of products, the Arduino should be ok, but as the number grows, and/or you need to maintain your product & pricing database - you may want to add some networking, or a larger memory model.

The user and product details can be stored on SD card.

Here I have an example where the user credentials is stored on SD and a keypad is used as input.

It can be easily modified to work with scanner.

Could be pins 2 - 3 using software serial libray.

Arduino pin can delivery only 40 mA and it can't be enough to some buzzers.

So is better control the buzzer with a transistor (BCxxxx) like this:

https://www.maxphi.com/piezo-buzzer-interfacing-arduino-tutorial/amp

Do I need a separate power source for the QR/Barcode Scanner to work?

It could be a good choice for all external devices because Arduino 5 V regulator can get very hot working with current close to >600 mA.

BTW Arduino Uno can delivery only 20 mA per pin.

Edit:

I don't know why Arduino says the maximum current per pin is 20 mA.

The ATmega328P datasheet says it's 40 mA.

At what voltage should a QR/Barcode scanner need, if we are going to use another power supply?

Find a supplier and check the product specifications.

Is my block diagram appropriate? Or is there some flaws?

image

What's the reason to use two displays?

The touch screen one is for ordering itself, while the other is a indicator in which it will display if the order has been placed.

The order placement information is for the cashier or customer?

For the customer, the information that will be received by the cashier will be displayed on a PC (Terminal), in which data can be received through a receiver.

It doesn't makes so much sense to me because all information can be displayed on TFT.

Your diagram seems fine but don't need two PS because if has difference between voltages you can use a step down.

What could been some issues with this code? Everytime we fix certain issues, as the compiler tells us, another issue will pop up.

#include <TftSpfd5408.h>
#include <pin_magic.h>
#include <registers.h>

#include <RH_ASK.h>
#include <SPI.h>
#include <SPFD5408_Adafruit_GFX.h>
#include <SPFD5408_Adafruit_TFTLCD.h>
#include <SPFD5408_TouchScreen.h>

RH_ASK driver;

#define TS_MINX 125
#define TS_MINY 85
#define TS_MAXX 965
#define TS_MAXY 905

#define YP A3
#define XM A2
#define YM 9
#define XP 8

// Define touch screen pressure thresholds
#define MINPRESSURE 10
#define MAXPRESSURE 1000

#define BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF
#define GOLD    0xFEA0
#define LIME    0xAFE5

TouchScreen ts = TouchScreen(XP, YP, XM, YM, 364);

TftSpfd5408 tft; // declare an object of type TftSpfd5408

class TftSpfd5408 {
 public:
  TftSpfd5408();

  // other member functions

  uint8_t textsize; // add this line to declare the textsize variable
};

void TftSpfd5408::init() {
  // other code

  textsize = 1; // initialize the textsize variable
}


void setup() {
  tft.setRotation(1); // adjust the screen orientation as needed
}

void loop() {
  tft.fillScreen(WHITE);
  tft.drawRoundRect(0, 0, 319, 240, 8, WHITE);     //Page border
  tft.fillRoundRect(30, 40, 100, 40, 8, GOLD);
  tft.drawRoundRect(30, 40, 100, 40, 8, WHITE);  //Dish1​
  tft.fillRoundRect(30, 90, 100, 40, 8, GOLD);
  tft.drawRoundRect(30, 90, 100, 40, 8, WHITE);  //Dish2​
  tft.fillRoundRect(30, 140, 100, 40, 8, GOLD);   //Dish3
  tft.drawRoundRect(30, 140, 100, 40, 8, WHITE);

  tft.setCursor(60, 0);
  tft.setTextSize(3);
  tft.setTextColor(LIME);
  tft.print("   Menu");
  tft.setTextSize(2);
  tft.setTextColor(WHITE);
  tft.setCursor(37, 47);
  tft.print(" Dish1");

  TSPoint p = ts.getPoint();
  p.x = map(p.x, TS_MAXX, TS_MINX, 0, 320);
  p.y = map(p.y, TS_MAXY, TS_MINY, 0, 240);

  if (p.x > 180 && p.x < 280 && p.y > 190 && p.y < 230  && p.z > MINPRESSURE && p.z < MAXPRESSURE)
  {
    Serial.println("Dish1");
    char* msg = "Dish1"; // declare and initialize the msg variable
    driver.send((uint8_t *)msg, strlen(msg));
    driver.waitPacketSent();
    delay(1000);
    tft.fillRoundRect(30, 40, 100, 40, 8, WHITE);
    delay(70);
    tft.fillRoundRect(30, 40, 100, 40, 8, GOLD);
    tft.drawRoundRect(30, 40, 100, 40, 8, WHITE);
    tft.setCursor(37, 47);
    tft.print(" Dish1");
    delay(70);
  }
}

Give me a link for your TFT model.

Well, this is not a link but I think this TFT is compatible with UTFT library.

Look for this and apply to your case.

//#define DISABLE_HX8347A