Problem description

When XIAO microcontroller is connected to the sensor signal output pin, keep printing unexpected values.

Sketch enter image description here enter image description here I haven't sensor circuit diagram, you can machine translate and read the pagehttps://www.yuque.com/cs/products/rwe87o

Detailed description:

The sensor has been outputting a raw value of about 4000. That is to say, the transformation of the function outputs is around 1600000~400000. Not the 0 to 30 values I expected to output.(I tried to use other development board ESP32 to read the sensor value using ADC and its own power supply pin, and still output the original value of 4000(output 1600000~400000), as shown in the figure below.)

Abnormal output

Vendor-supplied sample code

Normal output:

enter image description here

This is the output I expect, but I can't reproduce the normal output (last month was very occasionally normal output, I don't know why it can't normal output now and the environment has not changed...Analog circuits are too much like witchcraft...)

I try to do:

  1. Measured with a digital multimeter to ESP32 and XIAO, the power supply pin(to measure voltage between 3.3V and GND pin) is about 3.1V~3.3V(maybe my positive and negative probes are not accurate).

  1. Check XIAO's ADC using ADC pin to GND pin for any problems with Analog pins read GND and VCC respectively, with 12bit resolution and output of 100 and 4000 + respectively.XIAO is fine.

  2. The Sensor connects the TTL to USB power supply pin, but the output is still abnormal.(I used PWM pin by esp32 or xiao MCU to output analog 3.3V, results same to abnormal output) enter image description here

  3. If the sensor signal output is connected to MCU, the high value of 4000 is output(The original value). Seems to be the power problem, someone tell me how to minimize the power ripple effect and make the 3.3V stable output provided by the battery? But when I unplug the sensor, the MCU outputs random values, and I don't want the sensor output to be affected by other factors.

  1. DMM Checks the sensor output and GND pin separately, using only the DMM, sensor, 3.3V battery module, and breadboard: (This is one 3P Dupont line and the colors are random.I didn't have a wiring error. If the wiring is wrong neither the MCU nor the sensor will work properly, let alone output signals) 22-04-04-23-35-46.gif The quality of my DMM is poor, I will measure it when my FLUKE17B+ arrives.

Use MCU to read the value, sure enough, the output value is not affected by the power on or off, because the output value is more than 100000(raw value is 4000,12 bit).


Asked the store, customer service said this is not normal, the sensor should output the value of 0~500, if the sensor monitors the current output of 200~400, not monitoring the general output of 0~30 range.

Equipment information

XIAO EMG sampled code: EMG.ino · GitHub

Sensor parameters: {ED0056}Sensor

Microcontrollers XIAO general description: Getting Started with Seeeduino XIAO - Seeed Wiki

Microcontrollers XIAO instruction manual: https://files.seeedstudio.com/wiki/Seeeduino-XIAO/res/ATSAMD21G18A-MU-Datasheet.pdf enter image description here

How do I solve XIAO’s the sensor’s abnormal output?

  • 1
    Please add a schematic to your question. It's not at all clear how all the components are interconnected. Have you connected all of the grounds properly?
    – StarCat
    Commented Apr 3, 2022 at 8:34
  • In your wiring diagram (fritzing) Vcc and ground of the sensor on the right are connected to the upper power rail. Though there is no other connection to that rail. Where does the power and groumd connection come from for the sensor?
    – chrisl
    Commented Apr 3, 2022 at 12:49
  • Ten days ago, I connected the power supply pin of the USB to TTL module, and it could output normal signals. However, the 3.3V usB-to-TTL pin is only one.
    – C.SH.K
    Commented Apr 3, 2022 at 14:22
  • My six sensors need six 3.3V pins, the battery module supplies power to the sensor, but the oscilloscope outputs the original value of the sensor above 4000.
    – C.SH.K
    Commented Apr 3, 2022 at 14:23
  • on Leonardo you power it from 3.3 V pin? The analog pins of Leonardo read values from 0 to 5 V and the xiao analog input reads from 0 to 3.3 V
    – Juraj
    Commented Apr 3, 2022 at 16:06

2 Answers 2


First thing I notice in your photo is that you have your 3.3V and GND wires around the wrong way on the Xiao microcontroller board. This will indeed give you wrong results.

Please see the image below for the pinout.

Pinout of the Xiao Microcontroller board

Your Fritzing circuit diagram has the correct wiring for 3.3V and GND.

Please do a couple of tests to verify your setup once the wiring has been corrected. First, remove the sensor and use a potentiometer to provide an analog input into A0. Verify that the potentiometer gives you the correct response that you expect and cross check it with an oscilloscope or digital multi-meter (DMM).

Secondly, power up only the sensor and test the output of the sensor with an oscilloscope or DMM. This should how up as the clean analog signal that you expect.

If these two tests pass, then when you connect up the sensor to the Xiao microcontroller board it should work as expected.

  • Hello, not in the wrong direction. It's just the color of the lines that misleads you. I was misled by its color, the reverse connection short-circuit MCU. (I'll re-upload the picture for you to see.) Yesterday I have tested XIAO with the potentiometer and everything is normal. I think there may be something wrong with the sensor itself. Multimeter to measure voltage between sensor's GND and sensor output is 0.15~0.20V. Sensor states a reference voltage of 1.5 and then a range of 0 - 3 volts, which made me wonder if it will work correctly with analogRead();
    – C.SH.K
    Commented Apr 4, 2022 at 14:37
  • Great to hear that it was wired correctly and that you had just wired it up with red for GND and black for 3.3V. However this is bound to cause confusion which could lead to mistakes. Please perform the tests in the bottom half of the answer to determine if the fault lies with the sensor or the microcontroller.
    – sa_leinad
    Commented Apr 4, 2022 at 14:49
  • This is a 3P integrated line, the seller random gift of different colors of the line. There seems to be Abnormal output with the sensor as soon as it is connected any MCU. I am contacting the manufacturer to solve it.Besides, I didn't have a wiring error. If the wiring is wrong neither the MCU nor the sensor will work properly, let alone output signals(These tests were tested yesterday. Unfortunately, it cannot output the desired clean signal)
    – C.SH.K
    Commented Apr 4, 2022 at 14:58
  • I don't have an oscilloscope, and the DMM I have is of poor quality. I have placed an order of FLUKE 17B+ online, and I will use it to check the output of the sensor in a few days.
    – C.SH.K
    Commented Apr 4, 2022 at 15:10
  • You seem pretty sure it is the sensor, so perform the sensor test, where you only power the sensor and measure the output with a DMM. Even a poor quality DMM will give you enough information to tell if the sensor is fauty or not.
    – sa_leinad
    Commented Apr 4, 2022 at 15:19

Now it solved. I was so stupid, because I didn't connect the MCU to the sensor power, so the MCU couldn't measure the sensor value with the reference power.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.