# M5Stack Smart QR & Barcode Scanner Unit (CE10062)

**URL:** <https://forum.core-electronics.com.au/t/m5stack-smart-qr-barcode-scanner-unit-ce10062/24449>\
**Category:** Product Questions\
**Created:** [20 September 2026 08:09 UTC](https://forum.core-electronics.com.au/t/m5stack-smart-qr-barcode-scanner-unit-ce10062/24449 "2026-09-20T08:09:30Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Core](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/core/32/57_2.png) [@Core](https://forum.core-electronics.com.au/u/Core)\
**Post date:** [20 September 2026 08:09 UTC](https://forum.core-electronics.com.au/t/m5stack-smart-qr-barcode-scanner-unit-ce10062/24449/1 "2026-09-20T08:09:31Z")

</div>

This is a placeholder topic for [**“M5Stack Smart QR & Barcode Scanner Unit”**](https://core-electronics.com.au/m5stack-smart-qr-barcode-scanner-unit.html) comments.

![](https://core-electronics.com.au/media/catalog/product/cache/27ce3f31be4e054a027b4903049e33e9/c/e/ce010062-1.png)

Explore M5Stack’s Smart QR & Barcode Scanner Unit featuring a 640x480 CMOS sensor, integrated STM32F030 MCU, and versatile I2C/UART communication for effortless scanning of QR codes and barcodes in retail, logistics, and manufacturing applications.

[**Read more**](https://core-electronics.com.au/m5stack-smart-qr-barcode-scanner-unit.html)

---

<div class="post-metadata">

**Author:** ![Pixmusix](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/pixmusix/32/9719_2.png) [@Pixmusix](https://forum.core-electronics.com.au/u/Pixmusix)\
**Post date:** [20 September 2026 08:09 UTC](https://forum.core-electronics.com.au/t/m5stack-smart-qr-barcode-scanner-unit-ce10062/24449/2 "2026-09-20T08:09:32Z")

</div>

This thing isn’t working for me and I think it’s because I need to push it into continuous mode.

I think I need this… but in english.

> **[ZBarcode\_Scanner\_User\_Guide-2.5.3-CN.pdf](https://m5stack-doc.oss-cn-shenzhen.aliyuncs.com/1163/ZBarcode_Scanner_User_Guide-2.5.3-CN.pdf)**
>
> 2.01 MB

Does core have a way of contacting the manufacture and asking for one please?

---

<div class="post-metadata">

**Author:** ![Jane](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/jane/32/12622_2.png) [@Jane](https://forum.core-electronics.com.au/u/Jane)\
**Post date:** [22 September 2026 02:14 UTC](https://forum.core-electronics.com.au/t/m5stack-smart-qr-barcode-scanner-unit-ce10062/24449/3 "2026-09-22T02:14:21Z")

</div>

Hey there, @Pixmusix, I think I found the English version of that guide here:

[ZBarcode Scanner User Guide v2.5 – English](https://m5stack-doc.oss-cn-shenzhen.aliyuncs.com/1163/ZBarcode_Scanner_User_Guide-2.5-EN.pdf)

Continuous Mode is on page 22. Point the scanner at the **Continuous Mode** programming barcode. Once accepted, the trigger should start continuous decoding, with another trigger stopping it.

---

<div class="post-metadata">

**Author:** ![Pixmusix](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/pixmusix/32/9719_2.png) [@Pixmusix](https://forum.core-electronics.com.au/u/Pixmusix)\
**Post date:** [3 October 2026 02:01 UTC](https://forum.core-electronics.com.au/t/m5stack-smart-qr-barcode-scanner-unit-ce10062/24449/4 "2026-10-03T02:01:51Z")

</div>

I cannot for the life of me get this thing to scan with the M5 core 2.

Does core have a recommended arduino IDE example so I can confirm it’s not dud hardware?

I’m just looking for a sanity check (nothing I can find online works).

---

<div class="post-metadata">

**Author:** ![Jane](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/jane/32/12622_2.png) [@Jane](https://forum.core-electronics.com.au/u/Jane)\
**Post date:** [6 October 2026 04:39 UTC](https://forum.core-electronics.com.au/t/m5stack-smart-qr-barcode-scanner-unit-ce10062/24449/5 "2026-10-06T04:39:19Z")

</div>

Hey there, @Pixmusix,

Yes we do. Or, well, M5Stack does. There is an [I2C test example](https://github.com/m5stack/M5Unit-QRCode/tree/main/example/i2c_mode) on the M5 Stack Docs page for this product (which is unhelpfully labelled as ‘Complete Documentation’ (I’m going to have to update the product page to make that a little more clear).

Its for the M5Stack Core, not the Core2 so it may need a little bit of modification to get it working, but it should distinguish **“I2C Init Fail”** from a decoding problem.

Let us know the results.

---

<div class="post-metadata">

**Author:** ![Pixmusix](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/pixmusix/32/9719_2.png) [@Pixmusix](https://forum.core-electronics.com.au/u/Pixmusix)\
**Post date:** [8 October 2026 00:01 UTC](https://forum.core-electronics.com.au/t/m5stack-smart-qr-barcode-scanner-unit-ce10062/24449/6 "2026-10-08T00:01:04Z")

</div>

Thanks Jane.

That test code just prints `Unit QRCode I2C Init Fail` in a loop.

My Scanner is plugged into the groove port.  
My Scanner’s side switch is down towards i2c mode.

I made no modifications to the code. I started with a blank project. My compilation target was Core2-M5Stack.

* * *

Next I tried modifying the code to suit the Core2 Unit.  
Here was my attempt, which tries to keep the same spirit as the original code.

```cpp
#include <M5Unified.h>
#include "M5UnitQRCode.h"

M5UnitQRCodeI2C qrcode;

void debug_print(String printme) {
  M5.Display.println(printme);   
  Serial.println(printme);
}

void setup() {
  Serial.begin(115200);
  delay(100);
  auto cfg = M5.config();
  M5.begin(cfg);

  M5.Display.setTextSize(2);
  M5.Display.fillScreen(BLACK);
  M5.Display.setCursor(0, 0);
  debug_print("Initializing I2C...");

  // Based on the back of the M5Core2 Unit. Is this right?
  while (!qrcode.begin(&Wire1, UNIT_QRCODE_ADDR, 32, 33, 100000U)) {
    debug_print("Error: I2C Init Fail!");
    delay(1000);
  }
  qrcode.setTriggerMode(MANUAL_SCAN_MODE);
}

void loop() {
  M5.update();

  if (qrcode.getDecodeReadyStatus() == 1) {
    uint8_t buffer[512] = {0};
    uint16_t length = qrcode.getDecodeLength();
    
    Serial.printf("Decode success, len: %d\r\n", length);
    qrcode.getDecodeData(buffer, length);

    M5.Display.fillScreen(BLACK);
    M5.Display.setCursor(0, 0);
    debug_print("Decoded Data:");
    for (int i = 0; i < length; i++) {
      String decdat = String((char*)buffer, length);
      debug_print(decdat);
    }
  }
}

```

It prints `"Error I2C Init Fail!"` in a loop.

Any ideas?  
🙂

---

<div class="post-metadata">

**Author:** ![Michael99645](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/michael99645/32/11893_2.png) [@Michael99645](https://forum.core-electronics.com.au/u/Michael99645)\
**Post date:** [8 October 2026 01:15 UTC](https://forum.core-electronics.com.au/t/m5stack-smart-qr-barcode-scanner-unit-ce10062/24449/7 "2026-10-08T01:15:28Z")

</div>

Glossing over the documents, it kinda looks like the reader can be either UART or i2c. is it in I2C mode ? is there a QR code to scan to put it into I2C mode ?

---

<div class="post-metadata">

**Author:** ![Jane](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/jane/32/12622_2.png) [@Jane](https://forum.core-electronics.com.au/u/Jane)\
**Post date:** [8 October 2026 04:16 UTC](https://forum.core-electronics.com.au/t/m5stack-smart-qr-barcode-scanner-unit-ce10062/24449/8 "2026-10-08T04:16:01Z")

</div>

Hey Pix,

I think the next thing to try is using **`Wire` instead of `Wire1`**. M5Unified uses I²C controller 1 for the Core2’s internal devices, so `Wire1` looks like the likely clash here. Replace your initialisation loop with:

```cpp
// Core2 Grove port: SDA = 32, SCL = 33.
// Use controller 0 so the internal I2C bus is left alone.
while (!qrcode.begin(&Wire, UNIT_QRCODE_ADDR, 32, 33, 100000U)) {
  debug_print("Error: I2C Init Fail!");
  delay(1000);
}
debug_print("I2C Init Success!");

```

Once it gets past initialisation, change your trigger-mode line to this for the scanning test:

```cpp
qrcode.setTriggerMode(AUTO_SCAN_MODE);

```

Give that a go and let us know whether you get “I2C Init Success!”. If not, post the startup output and your M5Unified and ESP32 board-package versions.

---

<div class="post-metadata">

**Author:** ![Pixmusix](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/pixmusix/32/9719_2.png) [@Pixmusix](https://forum.core-electronics.com.au/u/Pixmusix)\
**Post date:** [8 October 2026 23:49 UTC](https://forum.core-electronics.com.au/t/m5stack-smart-qr-barcode-scanner-unit-ce10062/24449/9 "2026-10-08T23:49:35Z")

</div>

Good news. Wire was the solution. 🙂

That did manage to init i2c.  
Sadly, I’m still not scanning anything.

This is where I got to on my first attempt which was in [esp\_idf](https://github.com/ysak-y/rust-on-m5stack).  
I could initialize, but I could never scan.

This is why I decided to revert to ol’faithful arduino ide.  
I wanted to check that it wasn’t my code.

Here is a video.

[![](https://i.ytimg.com/vi/GxDQo0iNXMc/hq2.jpg "9 October 2026") ](https://www.youtube.com/watch?v=GxDQo0iNXMc)

---

<div class="post-metadata">

**Author:** ![Pixmusix](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/pixmusix/32/9719_2.png) [@Pixmusix](https://forum.core-electronics.com.au/u/Pixmusix)\
**Post date:** [8 October 2026 23:52 UTC](https://forum.core-electronics.com.au/t/m5stack-smart-qr-barcode-scanner-unit-ce10062/24449/10 "2026-10-08T23:52:35Z")

</div>

> [@Michael99645](#):
>
> is it in I2C mode

Switch on the side of the scanner. It is set correctly. 🙂

---

<div class="post-metadata">

**Author:** ![Jane](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/jane/32/12622_2.png) [@Jane](https://forum.core-electronics.com.au/u/Jane)\
**Post date:** [9 October 2026 01:49 UTC](https://forum.core-electronics.com.au/t/m5stack-smart-qr-barcode-scanner-unit-ce10062/24449/11 "2026-10-09T01:49:01Z")

</div>

Hey Pix,

The fact that the barcode scanner is beeping in the video suggests to me that the scanner is registering the barcode. If that is the case, then the data is likely getting lost either in the I2C communication or the data reading.

Without changing your working initialisation, could you please mod your `loop()` with this:

```cpp
void loop() {
  M5.update();

  // Inspect the scanner's registers without reading the decoded payload.
  static uint32_t lastCheck = 0;
  if (millis() - lastCheck >= 500) {
    lastCheck = millis();

    const uint8_t mode = qrcode.getTriggerMode();
    const uint8_t ready = qrcode.getDecodeReadyStatus();
    const uint16_t length = qrcode.getDecodeLength();

    Serial.printf("mode=%u ready=%u length=%u\n",
                  mode, ready, length);
  }
}

```

For reference, there are two modes, auto scan (0) manual scan (1) is manual scan. Scan a barcode and share the Serial Monitor output from before and after the beep, along with your current complete sketch. If ready becomes 1 and the length looks sensible, the payload-reading/display code is next to look at. If it doesn’t, the I²C status reads need a closer look.
