Libelium is offering new technical support channels, to contact with de Technical Support team to solve any issue our doubt please contact with your sales agent or visit our contact site



Post a new topicPost a reply Page 1 of 1   [ 4 posts ]
Author Message
 Post subject: Unable getting ECG data from Arduino
PostPosted: Mon Apr 10, 2017 10:24 am 

Joined: Mon Apr 10, 2017 9:49 am
Posts: 2
Hi. My board is Arduino UNO along with e-Health Sensor Platform V2.0. Currently I am trying to get the ECG data from my board, but failed. The data always remain in 0.3V. Below is my code
Code:
int analogPin = 0;                             
float sensorValue = 0.0;           

void setup() {
  Serial.begin(9600);  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:
  sensorValue = analogRead(analogPin) 5 / 1023.0;
  // print out the value you read:
  Serial.println(sensorValue);
  delay(10);        // delay in between reads for stability


Is there anything wrong with my code? Or my board is broken?

Also, when using the program you plot on the tutorial, some errors occurred.

Quote:
In file included from C:\Users\guych\Documents\Arduino\libraries\eHealth_raspberrypi_v2.0/eHealth.h:36:0,

from C:\Users\guych\Desktop\ECGExampleSerial\ECGExampleSerial.ino:34:

C:\Users\guych\Documents\Arduino\libraries\arduPi/arduPi.h:27:24: fatal error: netinet/in.h: No such file or directory

#include <netinet/in.h>

^

compilation terminated.

exit status 1


It said that my computer does not have netinet/in.h. Is that because I am now using Windows 7?
Do I run it with Linux instead?


Top
 Profile  
 
 Post subject: Re: Unable getting ECG data from Arduino
PostPosted: Tue Apr 11, 2017 7:30 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11366
Hello YICHENGU,

Code:
sensorValue = analogRead(analogPin) 5 / 1023.0;


This line does not look right, try with this:

Code:
float sensorValue = (float)((analogRead(analogPin)* 5.0) / 1023.0);


Quote:
In file included from C:\Users\guych\Documents\Arduino\libraries\eHealth_raspberrypi_v2.0/eHealth.h:36:0,

from C:\Users\guych\Desktop\ECGExampleSerial\ECGExampleSerial.ino:34:

C:\Users\guych\Documents\Arduino\libraries\arduPi/arduPi.h:27:24: fatal error: netinet/in.h: No such file or directory


These errors occur because you are trying to use the codes for Raspberry Pi instead of the codes for Arduino Uno.

Regards


Top
 Profile  
 
 Post subject: Re: Unable getting ECG data from Arduino
PostPosted: Fri Apr 14, 2017 2:37 am 

Joined: Mon Apr 10, 2017 9:49 am
Posts: 2
Sorry, still return values around 0.3V.

I use oscilloscope measuring the wave of the analog pin 0 and it returns stable value between 0.3v ~ 0.4v in frequncy domain.
I tried to measure the pin value of OPA4340 in frequency domain.
And below is the value:
    pin 1 is stable value 2V
    pin 2 is stable value 2V
    pin 3 is stable value 2V
    pin 4 is stable value 4.5V
    piin 5 is stable value 2V
    pin 6 is stable value 2V
    pin 7 is stable value 2V
    pin 8 is sinusoid wave and vibrates when my heart is beating
    piin 9 is stable value 2V
    pin 10 is stable value 2V
    pin 11 is 0
    piin 12 is sinusoid wave and vibrates when my heart is beating
    pin 13 is sinusoid wave and vibrates when my heart is beating
    piin 14 is sinusoid wave and vibrates when my heart is beating

Is there any possibility that the hardware is broken or the setting of my Raspberry Pi is wrong?


Top
 Profile  
 
 Post subject: Re: Unable getting ECG data from Arduino
PostPosted: Mon Apr 17, 2017 8:46 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11366
Hello YICHENGU,

are you using Arduino Uno, or Raspberry Pi? Please could you send us a photo of your hardware setup?

Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 4 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use.