November 23, 2024, 12:53:43 AM

ekg emg shield meaning of output value

Started by fiara, March 21, 2017, 10:43:38 AM

Previous topic - Next topic

fiara

Hello all !

I am reading & seding the output value from the ekg - emg shield to the computer such that I dinamically plot it in a custom based .net application (using ms control from Windows Forms).

I read from the shield with int sensorValue = analogRead(analogInPin);

I noticed i get values from [0,1024]. Is there a way to convert these integers to voltage values such that I can label my Y-axis in my application ?

Thanks,
Fiara.

LubOlimex

This is not very related to SHIELD-EKG-EMG. This depends on the main board that you use (what is the ADC of the board; what is the voltage of the board). It is a general analog read approach as described here: https://www.arduino.cc/en/Reference/analogRead

If you don't understand what is going on, please also let us know what is the specific board that you use with SHIELD-EKG-EMG.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

fiara

Hi !

Well, I am using the official Arduino Uno with the  ATmega328P microcontroller.

Fiara.

LubOlimex

#3
Hey,

The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution (i.e. 1024 different values). The important part is that the ADC is 10 bits, which means 2^10, which is 1024 (0-1023).

The other important part is that Arduino UNO works at 5V.

So:

1. You need to make sure to set SHIELD-EKG-EMG to 5V mode of operation.
2. To calculate voltage per unit:

5 volts / 1024 units = 0.0049 volts (4.9 mV) per unit.

Other boards have other ADC resolution (for example, 12-bit or 16-bit). Other boards can work at 3.3V too. That is why I needed to know the board to be able to calculate it.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex