Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Waveshare Barcode Sanner: Examples, Pinouts, and Specs

Image of Waveshare Barcode Sanner
Cirkit Designer LogoDesign with Waveshare Barcode Sanner in Cirkit Designer

Introduction

The Waveshare Barcode Scanner is a compact and efficient device designed to read and decode barcodes. It is capable of scanning both 1D and 2D barcodes, making it versatile for a wide range of applications. This scanner is commonly used in retail, inventory management, logistics, and embedded systems. It can interface with microcontrollers, such as Arduino, Raspberry Pi, or computers, to transmit scanned data for further processing.

Explore Projects Built with Waveshare Barcode Sanner

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino UNO-Based Barcode Scanner with LCD Display and SD Card Storage
Image of Barcode Scanner: A project utilizing Waveshare Barcode Sanner in a practical application
This circuit features an Arduino UNO microcontroller interfaced with an LCD display, a barcode scanner, and an SD card module. The Arduino is powered by a 12V battery and controls the display and data logging functionalities, while the barcode scanner provides input data.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Barcode Reader and Thermal Printer System
Image of negeshoca: A project utilizing Waveshare Barcode Sanner in a practical application
This circuit features an ESP32 microcontroller interfaced with a thermal printer and a GM67 barcode reader module. The ESP32 handles communication with the printer and barcode reader via its GPIO pins, enabling barcode data to be read and printed. Power is supplied to all components through the ESP32's Vin and GND pins.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Mega 2560-Based Reverse Vending Machine with GSM and Wi-Fi Connectivity
Image of RVM WIFI: A project utilizing Waveshare Barcode Sanner in a practical application
This circuit is a reverse vending machine for plastic bottles and cans, utilizing an Arduino Mega 2560 to interface with various sensors and actuators. It includes ultrasonic sensors for distance measurement, a load cell for weight measurement, micro servos for actuation, and a GSM module for communication. The system also features an LCD display for user interaction and uses inductive and photoelectric sensors for object detection.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi 5-Based OCR and Weighing System with Wi-Fi Connectivity
Image of OCR Project: A project utilizing Waveshare Barcode Sanner in a practical application
This circuit integrates a Raspberry Pi 5 with an OV2640 camera module, an ILI9488 TFT screen, an infrared proximity sensor, and a load cell with an HX711 sensor module. The system captures images and performs OCR to extract text from documents, displays the text and weight measurements on the TFT screen, and allows data export via WiFi.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Waveshare Barcode Sanner

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Barcode Scanner: A project utilizing Waveshare Barcode Sanner in a practical application
Arduino UNO-Based Barcode Scanner with LCD Display and SD Card Storage
This circuit features an Arduino UNO microcontroller interfaced with an LCD display, a barcode scanner, and an SD card module. The Arduino is powered by a 12V battery and controls the display and data logging functionalities, while the barcode scanner provides input data.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of negeshoca: A project utilizing Waveshare Barcode Sanner in a practical application
ESP32-Based Barcode Reader and Thermal Printer System
This circuit features an ESP32 microcontroller interfaced with a thermal printer and a GM67 barcode reader module. The ESP32 handles communication with the printer and barcode reader via its GPIO pins, enabling barcode data to be read and printed. Power is supplied to all components through the ESP32's Vin and GND pins.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of RVM WIFI: A project utilizing Waveshare Barcode Sanner in a practical application
Arduino Mega 2560-Based Reverse Vending Machine with GSM and Wi-Fi Connectivity
This circuit is a reverse vending machine for plastic bottles and cans, utilizing an Arduino Mega 2560 to interface with various sensors and actuators. It includes ultrasonic sensors for distance measurement, a load cell for weight measurement, micro servos for actuation, and a GSM module for communication. The system also features an LCD display for user interaction and uses inductive and photoelectric sensors for object detection.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of OCR Project: A project utilizing Waveshare Barcode Sanner in a practical application
Raspberry Pi 5-Based OCR and Weighing System with Wi-Fi Connectivity
This circuit integrates a Raspberry Pi 5 with an OV2640 camera module, an ILI9488 TFT screen, an infrared proximity sensor, and a load cell with an HX711 sensor module. The system captures images and performs OCR to extract text from documents, displays the text and weight measurements on the TFT screen, and allows data export via WiFi.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

  • Manufacturer: Waveshare
  • Supported Barcode Types: 1D (e.g., Code 128, EAN-13) and 2D (e.g., QR Code, Data Matrix)
  • Interface: UART (TTL), USB
  • Operating Voltage: 3.3V to 5V
  • Current Consumption: ~120mA (typical)
  • Scan Speed: Up to 300 scans per second
  • Communication Baud Rate: Configurable (default: 9600 bps)
  • Operating Temperature: -20°C to 60°C
  • Dimensions: Compact and lightweight for easy integration

Pin Configuration and Descriptions

The Waveshare Barcode Scanner typically uses a 4-pin interface for UART communication. Below is the pinout:

Pin Name Description
1 VCC Power supply input (3.3V to 5V)
2 GND Ground connection
3 TXD Transmit data (output from the scanner)
4 RXD Receive data (input to the scanner)

For USB communication, the scanner uses a standard USB interface and does not require manual pin connections.

Usage Instructions

Connecting the Barcode Scanner to an Arduino UNO

To use the Waveshare Barcode Scanner with an Arduino UNO, follow these steps:

  1. Wiring:

    • Connect the scanner's VCC pin to the Arduino's 5V pin.
    • Connect the scanner's GND pin to the Arduino's GND pin.
    • Connect the scanner's TXD pin to the Arduino's RX pin (digital pin 0).
    • Connect the scanner's RXD pin to the Arduino's TX pin (digital pin 1).
  2. Upload Code: Use the following Arduino sketch to read barcode data and display it in the Serial Monitor.

// Waveshare Barcode Scanner Example Code
// This code reads data from the scanner and displays it in the Serial Monitor.

void setup() {
  Serial.begin(9600); // Initialize Serial communication at 9600 bps
  Serial.println("Waveshare Barcode Scanner Ready");
}

void loop() {
  // Check if data is available from the scanner
  if (Serial.available() > 0) {
    String barcodeData = ""; // Variable to store the scanned data

    // Read all available characters from the scanner
    while (Serial.available() > 0) {
      char c = Serial.read(); // Read one character
      barcodeData += c;       // Append character to the string
      delay(5);               // Small delay to ensure all data is read
    }

    // Print the scanned barcode data to the Serial Monitor
    Serial.print("Scanned Data: ");
    Serial.println(barcodeData);
  }
}
  1. Testing:
    • Open the Arduino IDE's Serial Monitor (set the baud rate to 9600).
    • Scan a barcode using the Waveshare Barcode Scanner.
    • The scanned data will appear in the Serial Monitor.

Important Considerations

  • Ensure the scanner is powered within its operating voltage range (3.3V to 5V).
  • Avoid connecting the scanner's TXD pin directly to a 3.3V microcontroller without a level shifter if the scanner is powered at 5V.
  • For USB communication, install the necessary drivers (if required) on your computer.
  • The scanner's baud rate can be configured using specific commands (refer to the manufacturer's manual for details).

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Data Received in Serial Monitor

    • Cause: Incorrect wiring or baud rate mismatch.
    • Solution: Double-check the connections and ensure the baud rate in the code matches the scanner's default baud rate (9600 bps).
  2. Scanner Not Powering On

    • Cause: Insufficient power supply or loose connections.
    • Solution: Verify that the VCC and GND pins are properly connected and the power source provides adequate voltage.
  3. Unreadable or Garbled Data

    • Cause: Noise in the communication line or incorrect baud rate.
    • Solution: Use shorter wires to reduce noise and confirm the baud rate settings.
  4. Scanner Fails to Read Barcodes

    • Cause: Poor lighting, damaged barcode, or unsupported barcode type.
    • Solution: Ensure proper lighting, use a clear barcode, and verify that the barcode type is supported.

FAQs

Q1: Can the scanner read barcodes from a screen (e.g., smartphone)?
A1: Yes, the Waveshare Barcode Scanner can read barcodes displayed on screens, provided the screen brightness and contrast are adequate.

Q2: How do I change the scanner's baud rate?
A2: The baud rate can be changed by sending specific configuration commands to the scanner. Refer to the manufacturer's manual for detailed instructions.

Q3: Is the scanner compatible with Raspberry Pi?
A3: Yes, the scanner can be connected to a Raspberry Pi via UART or USB. Use the appropriate GPIO pins or USB port for communication.

Q4: Can the scanner decode custom barcode formats?
A4: The scanner supports standard 1D and 2D barcode formats. Custom formats may not be supported unless they conform to standard encoding schemes.

By following this documentation, you can effectively integrate and use the Waveshare Barcode Scanner in your projects. For advanced configurations, refer to the manufacturer's user manual.