Olimex Support Forum

Others => Biofeedback - EEG, ECG, EKG => Topic started by: all315 on March 16, 2020, 11:24:40 PM

Title: EMG Arduino Nano and simple Sketch
Post by: all315 on March 16, 2020, 11:24:40 PM
Hello, can I use the EMG-EKG shield with an Arduino Nano?

I want to use it for emg biofeedback and not to control a servo.

My first step is to visualize on the serial monitor the succession of the EMG values detected and amplified by the sensor. Can I use this simple sketch for this purpose?


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

void loop() {
 
  int sensorValue = analogRead(A0);
 
// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V)
  float voltage = sensorValue * (5.0 / 1023.0);
 
  Serial.println(voltage);
}

I use this sketch with another emg sensor and works fine. Will it work with Olimex EMG-EKG shield?

Thank you.
Title: Re: EMG Arduino Nano and simple Sketch
Post by: LubOlimex on March 25, 2020, 08:26:37 AM
The hardware is alright. The code won't work. Use our demo for SHIELD-EKG-EMG and OLIMEXINO-328:

https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG/resources/ShieldEkgEmgDemo.zip

The software is based on OpenEEG's protocol that can be seen here:

http://openeeg.sourceforge.net/doc/modeeg/firmware/modeeg-p2.c