The SparkFun 2D Barcode Scanner Breakout - DE2120 is a compact and versatile module designed to interface with 2D barcode scanners. It enables seamless integration into projects requiring the scanning of QR codes, Data Matrix codes, and other 1D/2D barcodes. This breakout board is ideal for applications in retail, inventory management, access control, and embedded systems where barcode scanning is essential.
With its small form factor and straightforward connectivity options, the DE2120 breakout board simplifies the process of adding barcode scanning functionality to your projects. It supports both UART and USB communication, making it compatible with a wide range of microcontrollers and systems.
The DE2120 breakout board features a 6-pin header for UART communication and a micro-USB connector for USB communication. Below is the pinout for the 6-pin header:
Pin | Name | Description |
---|---|---|
1 | VCC | Power input (3.3V to 6V DC) |
2 | GND | Ground |
3 | TXD | UART Transmit (3.3V logic) |
4 | RXD | UART Receive (3.3V logic) |
5 | CTS | Clear to Send (optional, for UART flow control) |
6 | RTS | Request to Send (optional, for UART flow control) |
Powering the Module:
Communication Setup:
Barcode Scanning:
Below is an example of how to connect the DE2120 to an Arduino UNO using UART communication:
DE2120 Pin | Arduino UNO Pin |
---|---|
VCC | 5V |
GND | GND |
TXD | Pin 10 (RX) |
RXD | Pin 11 (TX) |
#include <SoftwareSerial.h>
// Define RX and TX pins for SoftwareSerial
SoftwareSerial barcodeScanner(10, 11); // RX = Pin 10, TX = Pin 11
void setup() {
Serial.begin(9600); // Initialize Serial Monitor
barcodeScanner.begin(9600); // Initialize barcode scanner communication
Serial.println("SparkFun DE2120 Barcode Scanner Example");
Serial.println("Present a barcode to the scanner...");
}
void loop() {
// Check if data is available from the barcode scanner
if (barcodeScanner.available()) {
String barcodeData = "";
// Read all available data from the scanner
while (barcodeScanner.available()) {
char c = barcodeScanner.read();
barcodeData += c;
}
// Print the scanned barcode data to the Serial Monitor
Serial.println("Scanned Data: " + barcodeData);
}
}
No Data Received from the Scanner:
Scanner Fails to Detect Barcodes:
Communication Issues with Arduino:
Can the DE2120 scan barcodes on a screen?
Yes, the DE2120 can scan barcodes displayed on screens, such as smartphones or tablets.
What is the maximum scanning distance?
The effective scanning distance depends on the barcode size and type but typically ranges from 5cm to 30cm.
Can I change the default UART baud rate?
Yes, the baud rate can be configured using specific commands sent to the module. Refer to the manufacturer's datasheet for details.
Is the DE2120 compatible with Raspberry Pi?
Yes, the DE2120 can be connected to a Raspberry Pi via UART or USB.
This concludes the documentation for the SparkFun 2D Barcode Scanner Breakout - DE2120. For additional support, refer to the official SparkFun resources or community forums.