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.
