Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use SparkFun 2D Barcode Scanner Breakout - DE2120: Examples, Pinouts, and Specs

Image of SparkFun 2D Barcode Scanner Breakout - DE2120Design with SparkFun 2D Barcode Scanner Breakout - DE2120 in Cirkit Designer

Introduction

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.

Explore Projects Built with SparkFun 2D Barcode Scanner Breakout - DE2120

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 Arduino Mega 2560 Biometric Security System with Wi-Fi Connectivity: A project utilizing SparkFun 2D Barcode Scanner Breakout - DE2120 in a practical application
Arduino Mega 2560 Biometric Security System with Wi-Fi Connectivity

This is a multi-functional sensor system controlled by an Arduino Mega 2560, designed to read biometric data from a pulse oximeter and an infrared thermometer, authenticate using a fingerprint scanner, display information on an OLED screen, and transmit data wirelessly via an ESP8266 module. User inputs can be received through two pushbuttons, and the system's power distribution is managed through common ground and voltage supply nets.

Open Project in Cirkit Designer
Image of Arduino Mega 2560 Based Security System with Fingerprint Authentication and SMS Alerts: A project utilizing SparkFun 2D Barcode Scanner Breakout - DE2120 in a practical application
Arduino Mega 2560 Based Security System with Fingerprint Authentication and SMS Alerts

This circuit features an Arduino Mega 2560 microcontroller interfaced with a SIM800L GSM module, two fingerprint scanners, an I2C LCD display, an IR sensor, and a piezo buzzer. Power management is handled by a PowerBoost 1000 Basic Pad USB, a TP4056 charging module, and a Li-ion 18650 battery, with an option to use a Mini AC-DC 110V-230V to 5V 700mA module for direct power supply. The primary functionality appears to be a security system with GSM communication capabilities, biometric access control, and visual/audible feedback.

Open Project in Cirkit Designer

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

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)

Usage Instructions

How to Use the Component in a Circuit

  1. Powering the Module:

    • Connect the VCC pin to a 3.3V to 6V DC power source.
    • Connect the GND pin to the ground of your circuit.
  2. Communication Setup:

    • For UART communication, connect the TXD pin of the DE2120 to the RX pin of your microcontroller, and the RXD pin of the DE2120 to the TX pin of your microcontroller.
    • Optionally, connect the CTS and RTS pins if your application requires UART flow control.
    • For USB communication, simply connect the breakout board to your system using a micro-USB cable.
  3. Barcode Scanning:

    • Once powered and connected, the DE2120 will automatically begin scanning when a barcode is presented in its field of view.
    • The scanned data will be transmitted via the selected communication interface (UART or USB).

Important Considerations and Best Practices

Example: Connecting to an Arduino UNO

Below is an example of how to connect the DE2120 to an Arduino UNO using UART communication:

Wiring

DE2120 Pin Arduino UNO Pin
VCC 5V
GND GND
TXD Pin 10 (RX)
RXD Pin 11 (TX)

Arduino Code

#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);
  }
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Data Received from the Scanner:

    • Ensure that the module is powered correctly and the connections are secure.
    • Verify that the UART baud rate matches the default setting of 9600 bps.
  2. Scanner Fails to Detect Barcodes:

    • Check that the barcode is within the scanner's field of view and is not damaged.
    • Ensure proper lighting conditions and avoid reflective surfaces.
  3. Communication Issues with Arduino:

    • Confirm that the RX and TX pins are correctly connected.
    • If using SoftwareSerial, ensure no conflicts with other libraries or pins.

FAQs

This concludes the documentation for the SparkFun 2D Barcode Scanner Breakout - DE2120. For additional support, refer to the official SparkFun resources or community forums.