Skip to content

kalpvrux/Waveshare-Barcode-Scanner-Module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Waveshare Barcode Scanner Module

Waveshare Platforms

Overview

This repository provides comprehensive sample code and configuration scripts for the Waveshare Barcode Scanner Module. This compact 1D/2D code reader uses advanced image recognition algorithms to decode various barcode and QR formats from paper or screens quickly and accurately.

Features

  • Cross-Platform Support: Ready-to-use examples for Arduino, Raspberry Pi, and Raspberry Pi Pico.
  • Versatile Decoding: Supports a wide range of 1D and 2D barcode formats (QR, Data Matrix, PDF417, EAN, UPC, etc.).
  • Rich Configuration: Scripts to customize LED indicators, buzzer alerts, exposure, sensitivity, and scanning modes.
  • Multiple Interfaces: Supports UART, USB, and Keyboard emulation modes.

Repository Structure

Waveshare-Barcode-Scanner-Module/
β”œβ”€β”€ Arduino/              # C++ sketches for Arduino boards
β”‚   β”œβ”€β”€ Read/             # Basic scanning & data reading example
β”‚   └── [1-21]-*/         # Configuration scripts (Baudrate, sensitivity, etc.)
β”œβ”€β”€ Raspberry Pi/         # Python scripts for RPi (GPIO UART)
β”œβ”€β”€ RPI PICO/             # MicroPython scripts for Raspberry Pi Pico
β”œβ”€β”€ Barcode Scanner Module Code Manual.pdf  # Technical manual
└── README.md             # This documentation

Hardware Connection

Arduino (Uno/Mega/Nano)

Use SoftwareSerial to communicate with the module.

  • RX (Module) -> Pin 12 (Arduino TX)
  • TX (Module) -> Pin 11 (Arduino RX)
  • VCC -> 3.3V / 5V
  • GND -> GND

Raspberry Pi (4/3/Zero)

Connect via the primary UART (/dev/ttyS0 or /dev/serial0).

  • RX (Module) -> GPIO 14 (TXD)
  • TX (Module) -> GPIO 15 (RXD)
  • VCC -> 3.3V / 5V
  • GND -> GND Note: Ensure UART is enabled in raspi-config.

Raspberry Pi Pico

Connect via UART0.

  • RX (Module) -> GP0 (TX)
  • TX (Module) -> GP1 (RX)
  • VCC -> 3.3V
  • GND -> GND

Getting Started

1. Arduino

  1. Open the Arduino IDE.
  2. Navigate to Arduino/Read/Read.ino and upload it to your board.
  3. Open the Serial Monitor (set baud rate to 9600).
  4. Scan a barcode; the decoded data will appear in the monitor.

2. Raspberry Pi

  1. Ensure pyserial is installed: pip install pyserial
  2. Run the basic reading script or any configuration script:
    python "Raspberry Pi/1-Common_Setting.py"

3. Raspberry Pi Pico

  1. Flash your Pico with MicroPython firmware.
  2. Use Thonny IDE or ampy to upload the scripts.
  3. Run any .py file from the RPI PICO directory to configure or read from the scanner.

Configuration Scripts Index

Both Python and Arduino folders contain scripts numbered 1 to 21 for specific tasks:

  1. Common Setting: LED, Buzzer, and Mode selection.
  2. Scan Command: Trigger scan via software command.
  3. Setting Code: Enable/Disable setting barcode scanning.
  4. Set Interface: Switch between UART and USB modes.
  5. Baudrate Set: Change communication speed (Default: 9600). ... and more (see file names for details).

Documentation

For detailed command formats and advanced protocol information, refer to the Barcode Scanner Module Code Manual.pdf.

License

This project is open-source. Please refer to the repository's license file for usage terms.


Maintained by Kalpvrux