Reading EMG signal using analogread()

I have a working circuit that detects spikes in EMG upon muscle contraction: I can read the output successfully on the oscilloscope:

The maximum amplitude of the spike is around 1.2V which should be well within the 5V limit of the analog pins. However, I essentially just see a random constant value each time which doesn't change upon contraction on the serial monitor on the Arduino IDE.

The code is pretty simple, I tried increasing the baud rate from 9600 to 115200 but it doesn't solve the issue:

void setup(){
  
  pinMode(A1, INPUT);
  Serial.begin(9600);
}

void loop(){
  float sensorValue  = analogRead(A1);
  EMG_Voltage = (sensorValue*5.0/1023.0);
  Serial.println(EMG_Voltage);
  }

Hardware setup:

I have connected the circuit output to pin A1. The circuit is powered by 9V batteries and the arduino is powered by the laptop. I only have 1 connection between the Arduino and the circuit, which is from circuit output to A1.

I suspect there is something wrong with the hardware setup or the code, as the circuit is functional as confirmed by the oscilloscope. Could I please get some help on this front? Thanks.

Try adding a connection between the Arduino ground and the mystery devices ground, so you have a complete circuit!

I did try that, but the reading still looks nothing like the oscilloscope. Do you think there's anything else I'm missing in the hardware setup?

We can't see your hardware setup.

sorry but I cannot understand the oscilloscope trace. both blue and yellow traces seem to have a 2 mV scale. The yellow trace barely makes it to 0.5 and the blue trace seems to overload the scale. They seem to be changing 3 separate times. Why do you say they are at a random constant value?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.