From SB-Components Wiki

Barcode Hat For Raspberry Pi

Barcode HAT for Raspberry Pi is a robust and compact barcode scanner board that consists of a DE2120 scanner module, buzzer, 1.14” LCD screen, micro-USB port. It is designed to scan 20 different barcode symbologies in the segment of both 1D and 2D symbology like barcodes and QR codes.

The design of the barcode HAT makes it simple for the users to explore all the DE2120’s features without having to deal with the complicated wires. Through appropriate drive circuits, a buzzer, a push-button tactile switch, and a status LED & Power LED scanning become easier.


  • Onboard DE2120 barcode scanner
  • Onboard Micro-USB connector for USB HID Interface, Virtual COM Port, Support USB Barcode Information
  • Transmission Read 20 Different Barcode Symbology
  • UPC-A * GS1-128 * Matrix 2-of-5 * Datalogic 2-of-5 * UPC-E * Code 39 * Industrial 2-of-5 * 2D Symbologies * EAN-8 * Code 93 * Codabar * QR Code * EAN-13 * Code 11 * MSI * Data Matrix * Code 128 * Interleaved 2-of-5 * GS1 DataBar * PDF 417


  • Operating Voltage - 3.3 V
  • Display - 1.14 Inch LCD
  • Symbology - 1D and 2D
  • Compatibility - Raspberry Pi
  • Communications - Micro USB Port & GPIO
Barcode Hat For Raspberry Pi
Buy it From : Click Here


  • First, you need to change the mode of the Pi Barcode HAT. Put Barcode HAT at the top of the raspberry pi, then you need to scan the below barcode settings before running the code
  • Mode is TTL/RS232 (serial communication interface(UART)) for this you need to scan below the barcode, Connect USB to Barcode Hat For Raspberry Pi.


  • Change the baud rate to (9600) for this you need to scan the below barcode by pressing the scan button on the Barcode Hat For Raspberry Pi.


Use Pi Barcode Hat without Raspberry Pi( Via USB Cable )

  • For this you need to scan below barcode settings

Barcode Hat2.jpg Barcode Hat3.jpg


  • First of all, move all the files from the applications folder to the outside folder which is the Pi-Barcode-HAT folder, so that could access the files in the lib sub-directory
  • Pins of the ultrasonic sensor (we use this sensor to avoid pressing the push button to scan the barcode ), we use 3v ultrasonic sensor
 * Trig is connected to GPIO 4
 * Echo is connected to GPIO 17
  • Servo motor
 * Servo motor pin is connected to GPIO 2