I am using the MyoWare muscle sensor from Advancer Technologies (this one) to obtain EMG signals from my forearm. I want to use it in a project where I will be checking if the muscle is flexed or not. I'm also using an Arduino MKRZero to capture the EMG signals from the MyoWare board using the basic Serial.Read() function from Arduino (full code attached below). I'm powering the MyoWare board and the Arduino MKRZero using USB of my laptop with the laptop running on battery and being disconnected from the mains supply. I'm using the EMG envelope output (from the SIG pin of the MyoWare board) and not the RAW EMG signal.
The problem I'm facing is that the output signals from the MyoWare board get saturated even when the muscle is not excited. There seems a particular pattern in the signals when this happens. In the user manual of the MyoWare sensor (here) it has been mentioned that the JFET amplifier of the previous version of the MyoWare board was replaced by a CMOS amplifier which would result in slower recovery times when saturated. It also advises users against adjusting the gain so that the amplifier is not saturated. I tried reducing the gain to as low as possible but I still get these sudden increases in voltage.
I have the following questions:
What could be the cause of the amplifier saturation? I am powering the Arduino using from the USB of my laptop. I tried to give input power to the MyoWare board using 4V DC from a function generator and connecting the grounds of the MyoWare and Arduino to the ground of the function generator but I had the same problem there as well. Could the supply voltage be the cause? Will it make a difference if I connect the Arduino to a battery and a Bluetooth module and acquire the signals from the MyoWare board via Bluetooth instead?
Why does the waveform have a particular shape/pattern to it?