Myoware doesn't work

Hello. I can’t get EMG data using MyoWare sensor and Arduino Uno. Arduino connected to a laptop. I need a USB insulator? I attach the code and photo. Thanks.

int onboardLED = 13; // Arduino onboard LED (pin 13) you can control
int voltageThreshold = 400; // any reading higher will trigger an action

void setup() {
// put your setup code here, to run when Arduino is powered on:
Serial.begin(9600);
pinMode(onboardLED, OUTPUT);
}

void loop() {
// put your main code here, to run repeatedly:
int currentVoltage = analogRead(A0); // store the incoming voltage
Serial.print(currentVoltage); // prints voltage to monitor

if(currentVoltage > voltageThreshold){
// trigger actions
Serial.println(" contraction"); // prints string + new line
digitalWrite(onboardLED, HIGH); //this sends 5V, turning on LED
} else {
Serial.println(""); //adds a new line
digitalWrite(onboardLED, LOW);
// turn off the light as threshold is not met
}
}

Безымянный.jpg

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html . Then look down to item #7 about how to post your code.Hi
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Does it compile and upload?
If so what do you get on the serial monitor?
Have you got the serial monitor set to 9600?

Can you tell us your electronics, programming, arduino, hardware experience?

Thanks.. Tom.. :slight_smile:

No, I have no experience. I just need this for biomechanical research.
I attach the scheme. I attached the data on the serial monitor to the photo.

And yes, the program was successfully compiled and uploaded.

Hi,
OPs image;


Tom.. :slight_smile:

So what happens when you use attempt to use that code? Does the serial monitor not print anything at all?

That’s all i could get. If I turn off the sensor, or disconnect the electrodes from the body, only a horizontal line is shown on the serial monitor (there is no signal at all).

That's not the serial monitor.

the serial monitor shows the same values as the plotter

I increased the potentiometer, and after that I got this on a plotter. A jump is a muscle contraction (mean value of 1000). But after it there is a fall in 3-5 minutes to 900, 700 … 280 consecutively. It did not work out below, because during this time some involuntary contraction of muscles occurs, and the value again sharply increases to 900. After that, the decrease begins again.
As I understand it, this is not correct? It should be like a vibrational curve at the level of 400-420.
Thank you.

Hi Igor,

I would first recommend resetting the gain potentiometer to 50 kOhms until you get the sensor working properly.

Looking at your pictures, am I seeing correctly that you soldered your wires to the Arduino board itself instead of using the pin housing?

Can you post some pictures of how you're placing the electrodes and of the solder joints on the sensor? This will help rule out connection and setup issues.

You don't need USB isolation if you run your laptop on battery power. If you haven't already, I would try running the sensor this way regardless of isolation. Having the laptop power cord plugged in has been shown to cause performance issues for some customers.

Additionally, if you want to rule out issues with your code, I would suggest running the Arduino example code called ReadAnalogVoltage.

  • Brian

Igor1409:
I increased the potentiometer (snip)

What potentiometer? Your first image didn't show any potentiometer in the circuit.

The pot is on the other side.

Hello Brian,

I ordered and today received a new sensor Myoware, since the old one could already break due to power problems.
I used your code, used pins instead of soldering, did not twist the wires to avoid mutual flooding. Placed the electrodes as indicated in the datasheet (middle of the muscle belly - the correct placement), used alcohol to clean the skin to avoid possible interference. Used a laptop that runs on batteries (not from the wire). The potentiometer is set to 50 kΩ (default).

And I got this.

IMG_20190606_170021.jpg

You're declaring sensorValue twice in your code. First as a double and then as an int. I'm not sure why that even compiled.

Can you tell me what the red LED is doing (e.g. staying on constantly, going on and off intermittently, etc)? I don't see power (green) LED on in your pictures. Are these taken with it disconnected from the Arduino?

Can you post pictures of your solder joints on the sensor where you soldered the female headers?

The code was successfully compiled and loaded. I tried the code without sensorValue duplicate. Again, only 5 volts and nothing more.

Do you mean the LEDs on the sensor? They do not light up at all. Never.

IMG_20190607_192555.jpg

Hi,
Ops pics;
IMG_20190607_192555.jpg

Please use this simple code;

int sensorValue ;


void setup() 
{
  Serial.begin(9600);
}


void loop() 
{
  sensorValue = analogRead(A0);
  Serial.print(sensorValue);
}

Thanks.. Tom... :slight_smile:

Hi,
Why have you got positive and gnd connected the wrong way to the sensor?



Tom... :slight_smile:

Tom, I used this connection scheme (this scheme from medium.com tutorial). Is it wrong?

Hi,
Look on the sensor board.
It will have + - and sig marked on the pins you are connecting to.

5V should go to +
Gnd should go to -
Signal comes from sig.

Your pictures of your setup on your arm show + and - swapped.

Tom.. :slight_smile: