user84542: Problem description
When XIAO microcontroller is connected to the sensor signal output pin, keep printing unexpected values.
Sketch


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

Normal output:

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:

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).




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.

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)


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.




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)


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).
other
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

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

user19409: 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.

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.

user84542: 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.


84542: <h2>Problem description</h2>
<p>When XIAO microcontroller is connected to the sensor signal output pin, keep printing unexpected values.</p>
<p>Sketch
<a href="https://i.stack.imgur.com/63bmP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/63bmP.jpg" alt="enter image description here" /></a>
<a href="https://i.stack.imgur.com/QUrPg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QUrPg.png" alt="enter image description here" /></a>
I haven't sensor circuit diagram, you can machine translate and read the page<a href="https://www.yuque.com/cs/products/rwe87o" rel="nofollow noreferrer">https://www.yuque.com/cs/products/rwe87o</a></p>
<h2>Detailed description:</h2>
<p>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.)</p>
<h3>Abnormal output</h3>
<p><img src="https://aws1.discourse-cdn.com/arduino/original/4X/e/9/9/e9939564973468d73ca65706dff0df430504bc72.gif" alt="Vendor-supplied sample code" /></p>
<h3>Normal output:</h3>
<p><a href="https://i.stack.imgur.com/zELX3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zELX3.png" alt="enter image description here" /></a></p>
<p>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...)</p>
<h3>I try to do:</h3>
<ol>
<li>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).</li>
</ol>
<p><img src="https://tupian.li/images/2022/04/04/new1.gif" alt="" />
<img src="https://i.stack.imgur.com/Lk9oY.png" alt="" /></p>
<ol start="2">
<li><p>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.</p>
</li>
<li><p>The Sensor connects the <code>TTL to USB</code> 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)
<a href="https://i.stack.imgur.com/EwulX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EwulX.png" alt="enter image description here" /></a></p>
</li>
<li><p>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.</p>
</li>
</ol>
<p></p>
<ol start="5">
<li>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)
<img src="https://tupian.li/images/2022/04/04/22-04-04-23-35-46.gif" alt="22-04-04-23-35-46.gif" />
<img src="https://iili.io/MRCnSa.gif" alt="" />
The quality of my DMM is poor, I will measure it when my FLUKE17B+ arrives.</li>
</ol>
<p>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).</p>
<h2>other</h2>
<p>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.</p>
<h2>Equipment information</h2>
<p>XIAO EMG sampled code: <a href="https://gist.github.com/allrobot/c70abc599ca8eb7fbc246ed67515449a" rel="nofollow noreferrer">EMG.ino · GitHub</a></p>
<p>Sensor parameters: <a href="https://www.yuque.com/cs/products/rwe87o" rel="nofollow noreferrer">{ED0056}Sensor</a></p>
<p>Microcontrollers XIAO general description: <a href="https://wiki.seeedstudio.com/Seeeduino-XIAO/" rel="nofollow noreferrer">Getting Started with Seeeduino XIAO - Seeed Wiki</a></p>
<p>Microcontrollers XIAO instruction manual: <a href="https://files.seeedstudio.com/wiki/Seeeduino-XIAO/res/ATSAMD21G18A-MU-Datasheet.pdf" rel="nofollow noreferrer">https://files.seeedstudio.com/wiki/Seeeduino-XIAO/res/ATSAMD21G18A-MU-Datasheet.pdf</a>
<a href="https://i.stack.imgur.com/myihn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/myihn.png" alt="enter image description here" /></a></p>
<p>How do I solve XIAO’s the sensor’s abnormal output?</p>
 19409: <p>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.</p>
<p>Please see the image below for the pinout.</p>
<p><a href="https://i.stack.imgur.com/hxAZ5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hxAZ5.jpg" alt="Pinout of the Xiao Microcontroller board" /></a></p>
<p>Your Fritzing circuit diagram has the correct wiring for 3.3V and GND.</p>
<p>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).</p>
<p>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.</p>
<p>If these two tests pass, then when you connect up the sensor to the Xiao microcontroller board it should work as expected.</p>
 84542: <p>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.</p>
<p><a href="https://i.stack.imgur.com/FzRfE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FzRfE.png" alt="![image|667x500](upload://6MZQ5bHsZdZKAhBULisPfXrMJu9.png)" /></a></p>
