How do you deal with abnormal output values from very sensitive sensors?

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, 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, the power supply 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.

gif

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?

What voltage do you measure if you use your yellow multimeter to measure voltage between GND and sensor output?

Do you have an oscilloscope?

The MyoWare muscle sensor works for some: https://learn.adafruit.com/getting-started-with-myoware-muscle-sensor.
The third terminal is with a wire, not near the terminals on the muscle.

I doubt if three metal strips next to each other will work.

Did you try the example code presented on the page you linked for the sensor?

YES,It doesn't work

I ask because your thread topic is addressed in that code. You can see the structure and code presented to normalize the input.

If your power supply is meant to provide between 3.3V and 3.7V, then I would be concerned if it randomly output 5V.

I don't have an oscilloscope..

Multimeter to measure voltage between GND and sensor output is 0.15~0.20V

This check ESP32's 3.3V and GND pin, results same to XIAO MCU

@Perehama I made a mistake. I accidentally connected GND to the ADC pin....

This is bad EMG output(The sample code provided by the vendor is used):
22-04-04 21-18-35

Nice, but not what I asked.

Nevermind, I'm not going to play this one; the language issue is too bad. Sorry mate, can't help you.

You need a moonshine reduction filter.

Seriously though, I can't help you. You may just have a bad connection somewhere.

It's okay, but I don't understand the language issue is too bad

Is my Code bad, or is the description bad?:joy:I'll do my best to describe it

I found your posts very hard to read and understand. It's not your fault.

Maybe there's something wrong with the accuracy of the multimeter, because it costs $5 to $10. I ordered a FLUKE 17B+ online and it will arrive in a few days.

Sorry to bother you. moonshine reduction filter Can provide the link of the code? What I found on the Internet is a device for filtering wine. I don't quite understand its connection with sensors.

I made a joke. There is no logical explanation why your project would work during the day and not at night or vice versa.

I don't know enough about the sensor or it's "jitter" but from experience with temperature sensors, I can suggest filling an array, and averaging the values. This specific sensor data sheet turned me off, not because it was in another language, but because it 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();.

Output raw value:

I don't think it's a good idea to average these values because there is too much interference, the mean output is meaningless.

I reproduced the normal output last month, although it was quite occasional (of course I can't reproduce it now).

bad connection, or missing connection.

Don't use the CH340 3.3V output pin to power sensors.

It's probably only rated for around 25mA. I think its only intended to power a few external logic ICs if required in an external circuit. This is similar to some FTDI adapters I've used where its 3.3V is generated in the serial IC and is rated for arounf 40mA.

Solution: Use a proper 3.3V power supply.

EDIT: OK, it looks like your sensor draws only 20mA, however I see no capacitor across the sensor's VCC and GND pins or on the breadboard.