Arduino Labview Interface To Display Sine Wave From External Function Generator

Thread Starter

Amalia Safiee

Joined Sep 21, 2017
9
Dear all,

My project is to design an ECG device. The problem that I am facing is:
1) I am trying to display sine wave from the ext function generator at 5V 100Hz but in the labview interface, it displayed a continuous straight line
2) I have problems uploading codes in the arduino. Do I need to upload the code everytime I run the labview interface?

Best Regards
Nur
 

MrChips

Joined Oct 2, 2009
20,364
1) You have not provided sufficient information for us to help you.
How is the sine wave acquired by the arduino? How is the data sent to Labview? Where is your arduino code? Where is your Labview code?

2) No. You do not need to upload your code everytime.
 

Thread Starter

Amalia Safiee

Joined Sep 21, 2017
9
1) You have not provided sufficient information for us to help you.
How is the sine wave acquired by the arduino? How is the data sent to Labview? Where is your arduino code? Where is your Labview code?

2) No. You do not need to upload your code everytime.
Thank you for replying!
For our project, we will connect the ecg circuit to A0 of arduino Uno and connect the arduino USB to laptop by comport5.
Our current phase is to try and get real-time continuous sine wave from external function generator and display it on labview. Our schematic diagram is below, I couldnt upload the VI here.
When we ran it, we got a straight horizontal line but the time x-plot showed increased time.
upload_2017-9-21_17-26-10.png
upload_2017-9-21_17-15-31.png

This is our arduino code:

//Read_Input.ino
// initialise variables
int inputPin = A0; // select input in:A0
void setup() {
Serial.begin(9600); // initialize serial comm with baud rate set as 9600 bps
}
void loop() {
Serial.println(analogRead(inputPin)); //read and send value from input pin
delay(2);
} //end of program

Do you have any advice?
 

dendad

Joined Feb 20, 2016
3,332
It is very hard to see what you have hooked up.
You do need to show a lot more detail.
Is the yellow +5V and the blue A0?
If so, you have them shorted together on the breadboard for a start.
Is the sine wave 5V Peak to Peak or RMS?
Start with a 1V sine wave, and couple it via a capacitor to the Arduino. Have a 10K resistor from +5V to A0, and another from A0 to GND.
AC-In.jpg
The resistors bias the A0 input to half volts so the sine wave can go both directions. Don't overdrive the Arduino input. It may be worth while adding a series resistor between the resistor divider center tap and A0 to help protect the input. Try a 1K resistor.

Running an Arduino as an analog input to graph it will only work for very low frequencies .
It may be worth getting rid of the "delay(2)" line.
As for your graphing program, I don't have any experience with that, sorry.
 
Last edited:

MrChips

Joined Oct 2, 2009
20,364
What have you tried in order to determine where is the problem?
Have you tested the Arduino code separately from the Labview code?
Have you tested the comm code and graphing program on Labview?
 

Thread Starter

Amalia Safiee

Joined Sep 21, 2017
9
I got the sine wave but with a little noise. Right now, the next step is to use Bluetooth to connect the arduino to labview as for this I used USB com port. Do you have any idea how to configure the bluetooth?
 

Thread Starter

Amalia Safiee

Joined Sep 21, 2017
9
What have you tried in order to determine where is the problem?
Have you tested the Arduino code separately from the Labview code?
Have you tested the comm code and graphing program on Labview?
Not sure where did it went wrong. But I suspect that there is some problem with the bluetooth transmission from arduino to labview. As of now, I achieved this.

upload_2017-10-5_20-14-14.png
 
Top