What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A Raspberry Pi Pico can receive decoded barcode or QR-code text from a compatible scanner module over UART. The scanner handles the camera, optical reading, and decoding; the Pico reads the resulting serial data and can display, store, or act on it. This guide uses Waveshare’s Barcode Scanner Module (D) as a documented example, not as a universal pinout for every scanner.

Choose a scanner the Pico can communicate with

Look for a reader with a clearly documented output interface and pinout. A TTL UART module is a straightforward embedded option: it sends decoded text as serial data. A USB handheld reader that behaves like a keyboard is different. Do not assume it will plug directly into a Pico running MicroPython; that requires the Pico hardware and firmware design to act as a USB host. The MicroPython pyb.USB_HID reference describes a pyboard HID interface, not USB-host support for a Pico.

Before choosing a module, check these details in its documentation:

  • Interface: UART output, USB HID, or another protocol—and whether the Pico setup supports that role.
  • Voltage and current: Confirm both the scanner’s supply requirements and the signal levels expected at its UART pins.
  • Connector and pinout: Check whether the supplied lead exposes the needed pins and how they are labeled.
  • Barcode formats: Verify the required symbologies are supported and enabled in the scanner’s configuration.
  • Scanning behavior: Check whether it scans on a trigger, continuously, or through a command, and whether it appends a line ending.

Documented example: Waveshare Barcode Scanner Module (D)

Waveshare documents this module with a 3.3 V supply and 120 mA current requirement, plus UART at 9600 baud, 8 data bits, no parity, and one stop bit by default (Waveshare Barcode Scanner Module (D) documentation; undated page accessed in 2026). Those are specifications for this model, not a guarantee that another module uses the same settings. The vendor lists EAN-13, EAN-8, UPC-A, UPC-E, Codabar, Code 128, Code 93, Code 39, QR Code, DataMatrix, and PDF417; it also notes that some formats are disabled by default. Check the configuration for the format you intend to scan.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Raspberry Pi Pico
  • RP2040 microcontroller chip designed by Raspberry Pi in the United Kingdom
  • Dual-core Arm Cortex M0+ processor, flexible clock running up to 133 MHz
  • 264KB of SRAM, and 2MB of on-board Flash memory
  • Castellated module allows soldering direct to carrier boards
  • 26 × multi-function GPIO pins

Wire the scanner’s UART to the Pico

UART transmit and receive lines are directional. The scanner’s TX pin is its output, so connect it to the Pico’s chosen UART RX pin. Connect scanner RX to Pico UART TX only if the Pico will send commands or configuration data. Connect the grounds together. For the Waveshare example, its pin definitions are GND, RX (module input), TX (module output), and VCC (3.3 V).

  • Scanner TX → Pico UART RX
  • Scanner RX → Pico UART TX only if sending data to the scanner
  • Scanner GND → Pico GND
  • Scanner VCC → a suitable 3.3 V supply, after confirming the exact module and power arrangement

Choose a UART-capable pin assignment for your exact Pico board and firmware, then check it against the board documentation. There is no single universal UART ID and GPIO pair for every board and scanner setup. Confirm the module’s cable pinout before applying power; do not infer wiring from wire colors or connector shape.

Rank #2
2Pcs Raspberry Pi Pico Development Board, Raspberry Pi RP2040 Dual-core ARM Cortex M0+ Processor, Running Up to 133 MHz, Support C/C++/Python, 2MB Quad SPI Flash Integrated with SPI/I2C/UART Interface
  • The Raspberry Pi Pico is a beginner-friendly microcontroller board that uses MicroPython to give you a taste of the Internet of Things and microcontrollers. The RP2040 is a well-designed microprocessor that can be utilized in almost any Internet of Things project. It has enough power to complete the task quickly.
  • 【Raspberry Pi RP2040 Microcontroller】Raspberry Pi Pico features Dual-core ARM Cortex M0+ processor, flexible clock running up to 133 MHz. With 264KB of SRAM, and 2MB of on-board Flash memory.Supports up to 16 MB of off chip flash memory via a dedicated QSPI bus
  • 【Multiple Software Support】Pico has rich and complete software support, it comes with a complete Rasberry Pi official C/C++ SDK, Micropython SDK.The programming and burning of Pico need to be carried out on the computer. Supported operating systems and computers include:Raspberry Pie with Raspberry Pi OS,Other platforms equipped with Debian based Linux system Computer with MacOS, Computers with Windows, etc.
  • 【Rich Hardware Interface】Raspberry Pi Pico has 30 GPIO pins, 4 pins for analog signal input and 26 × multi-function GPIO pins, 2 × SPI, 2 × I2C, 2 × UART, 3 × 12-bit ADC, 16 × controllable PWM channels.USB 1.1 supported by host and device, The installation mode can be flexibly selected by users to facilitate welding with other development boards.
  • 【Build Project in Tiny Size】Only 2.1cm*5.1cm ( as small as your thumb). Pico has been designed to use either soldered 0.1" pin-headers or can be used as a surface-mountable 'module'.

Install MicroPython for the correct Pico board

  1. Identify the exact board variant: Pico, Pico W, Pico 2, or Pico 2 W.
  2. Download the matching MicroPython UF2 from Raspberry Pi’s MicroPython setup guidance.
  3. Hold the board’s BOOTSEL button while connecting it to the computer by USB. It should appear as a storage drive.
  4. Copy the matching UF2 file to that drive. The board reboots with MicroPython installed.
  5. Connect to the board’s USB serial REPL using a serial terminal or editor that supports MicroPython. Raspberry Pi documents USB serial REPL access as well as UART serial access on Pico-series GPIOs in its Pico-series Python SDK.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Read decoded scans with MicroPython

MicroPython’s machine.UART API provides stream-style reads from a duplex serial bus. Set the baud rate and UART pins to match the scanner and the chosen Pico pin assignment. The following example is a template: replace UART_ID, RX_PIN, and TX_PIN with values supported by your board and firmware. If you only need to receive scans, the scanner RX-to-Pico TX wire is optional; the API may still be initialized with a TX pin for the selected UART.

from machine import UART, Pin

# Replace these with a valid UART and GPIO assignment for your Pico.
UART_ID = 0
RX_PIN = 1
TX_PIN = 0

scanner = UART(
    UART_ID,
    baudrate=9600,
    bits=8,
    parity=None,
    stop=1,
    rx=Pin(RX_PIN),
    tx=Pin(TX_PIN),
)

while True:
    line = scanner.readline()
    if line is not None:
        text = line.decode("utf-8", "replace").strip()
        if text:
            print(text)

This initializes the example scanner’s documented default 9600 8N1 settings; change them if your scanner is configured differently. readline() is useful when the scanner terminates each result with a newline. If the module sends no line ending, this loop may wait rather than return a scan; use a read strategy suited to the scanner’s framing, such as checking any() and reading available bytes, or configure a terminator if the scanner supports it. The decoding shown assumes UTF-8-compatible text; preserve raw bytes instead if your data format requires another encoding.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
With Pre-Soldered Header Raspberry Pi Pico Microcontroller Development Board Based on Raspberry Pi RP2040 Chip,Dual-Core ARM Cortex M0+ Processor
  • with pre-soldered header Raspberry Pi Pico. RP2040 microcontroller chip designed by Raspberry Pi in the United Kingdom
  • Dual-core Arm Cortex M0+ processor, flexible clock running up to 133 MHz. 264KB of SRAM, and 2MB of on-board Flash memory.
  • Castellated module allows soldering direct to carrier boards. USB 1.1 with device and host support. Low-power sleep and dormant modes. Drag-and-drop programming using mass storage over USB. 26 × multi-function GPIO pins.
  • 2 × SPI, 2 × I2C, 2 × UART, 3 × 12-bit ADC, 16 × controllable PWM channels.Accurate clock and timer on-chip.Temperature sensor.
  • Accelerated floating-point libraries on-chip.8 × Programmable I/O (PIO) state machines for custom peripheral support

The scanner’s trigger and output behavior are model-specific. Some readers emit a result only after a trigger, while others scan continuously or need configuration. Confirm that behavior in the scanner’s manual rather than assuming the Pico must send a command. The Pico can then use each decoded string in its own application, for example by printing it in the REPL, writing it to storage, or comparing it against expected values.

Best Value
Freenove Raspberry Pi Pico Board Pre-Soldered Header, Dual-core Arm Cortex-M0+ Microcontroller, Development Board, Python C Java Code, Tutorial Example Projects
  • Raspberry Pi Pico: A tiny, fast, and versatile board built using dual-core Arm Cortex-M0+ processor (Comes with pinout card and stickers)
  • Detailed Tutorial: Provides step-by-step guide with MicroPython, C and Processing (Java) Code (The download link can be found on the product box) (No paper tutorial)
  • Example Projects: Each project has schematics, wiring diagrams, complete code and detailed explanations (Need extra items)
  • Easy to Use: Just connect the board to your computer (installed IDE) with the USB cable to program it
  • Get Support: Our technical support team is always ready to answer your questions
Rank #4
Sale
KEYESTUDIO Raspberry Pi Pico Basic Starter Kit with Headers Micro USB Cable, Pico RP2040 Microcontroller, Flexible 26 Multifunction GPIO Pins, Temperature Sensor, Programmable in C & MicroPython
  • New Flexible Microcontroller Board --- Raspberry Pi Pico is a tiny, fast, and versatile board. It's based on RP2040 chip, which features a dual-core Arm Cortex-M0+ processor with 264KB internal RAM and support for up to 16MB of off-chip Flash, flexible clock running up to 133 MHz.
  • Multi-Function GPIO Pins---It has 26 multifunction GPIO pins, including 3 analogue inputs, 2 × UART, 2 × SPI controllers, 2 × I2C controllers, 16 × PWM channels.
  • Rich Peripheral Set---A wide range of flexible I/O options includes I2C, SPI, and — uniquely —8 × Programmable I/O (PIO) state machines for custom peripheral support.
  • Multiple Software Support---Raspberry Pi Pico has rich and complete software support and community resources. Programmable in C and MicroPython. Drag-and-drop programming using mass storage over USB.
  • Low-power sleep and dormant modes; Accurate on-chip clock; Temperature sensor; Accelerated integer and floating-point libraries on-chip

Troubleshoot missing or garbled scan text

  • No characters arrive: Confirm scanner TX reaches the Pico RX pin, that grounds are shared, the selected UART ID and GPIOs are valid, and the scanner is powered. Check whether a trigger or a configuration change is required.
  • Characters are garbled: Match baud rate, data bits, parity, and stop bits on both ends. For the cited Waveshare defaults, use 9600 baud, 8 data bits, no parity, and one stop bit.
  • A scan appears only after a delay—or not at all with readline(): Check whether the scanner sends a newline or another delimiter. If it does not, use a read method appropriate to its message framing.
  • One barcode type works but another does not: Verify that the scanner supports that symbology and that it is enabled; a listed format may be disabled by default.
  • The scanner resets or behaves inconsistently: Recheck supply voltage and current capacity, wiring, connector pinout, and the exact module revision before changing the UART code.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.