LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

bluetooth

Hi, I am a beginner attempting to create a PPG. In this project, my groupmates and I are required to collect signals from a sensor, transfer the data through some circuits and then bluetooth, into LabView. 

 

The following code is what I have in Arduino. The devices I have are Arduino UNO and Sparkfun Mate Silver Bluetooth, programmed as shown below.

 

#include <SoftwareSerial.h>

int bluetoothTx = 2; // TX-O pin of bluetooth mate, Arduino D2

int bluetoothRx = 3; // RX-I pin of bluetooth mate, Arduino D3

 

SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);

 

int sensorValue = A1;

 

int val;

 

void setup()

{

Serial.begin(9600); // Begin the serial monitor at 9600bps

bluetooth.begin(9600); // The Bluetooth Mate defaults to 9600bps

pinMode(sensorValue, INPUT);

val = analogRead(sensorValue);

}

 

void loop()

{

if(Serial.available()) // If stuff was typed in the serial monitor

{

// Send any characters the Serial monitor prints to the bluetooth

bluetooth.print((val),Serial.read());

delay(100);

}

// and loop forever and ever!

 

}

 

How do I design block diagrams in a way to receive signals from Sparkfun bluetooth using laptop bluetooth modem?

 

I have attempted using the VI shown in the attached (the idea behind the design of the bluetooth components was adopted from the NI forums). We can connect Bluetooth to my laptop's COM Port but we are unable to receive any data. We want to receive data from bluetooth and plot the data into a waveform in real time (delay should be less than 1 second).

 

Any kind experts willing to help us please? T.T The deadline is close. 

 

0 Kudos
Message 1 of 3
(2,773 Views)

Do you know how to use MAX (Measurement and Automation Explorer)?  Open MAX, find the port that is your Bluetooth input, and try to open the port and read something from it.  You can interactively "play around" with the Baud Rate, parity, etc. to try to get the settings that let you communicate with your device.

 

I noticed you were using 9600 N-8-1 with no Flow Control.  Where did you get these settings?  I'm old enough to remember when devices were that slow, but that was (probably) before you were born.  Check the settings that are appropriate for your device(s) ...

 

Bob Schor

0 Kudos
Message 2 of 3
(2,722 Views)

Hi Bob,

 

Thanks for your reply. 

 

I don't seem to be able to get NI MAX to change the Baud Rate, etc. I use the same settings on the VISA Serial Port VI as what I have input into the Arduino code, such as baud rate 9600. 

 

For the settings, I have been searching in the NI forums and youtube on the demonstrations on how to use VISA Serial Communication, which I did not change any other settings beside the VISA Port input and the baud rate. Is there a better way to make the data flow more efficient?

 

Actually I have been using LINX and LabVIEW interface for Arduino to get the signal from the Bluetooth Sparkfun Mate Silver connected to my circuit board. It's either firmware error in the COM Port (which I have reinstalled countless times), or no Bluetooth connection at all (indicated by flashing red light on the bluetooth component). Currently I am using Arduino Uno together with my Bluetooth Sparkfun Mate Silver. 

 

I am at my wits' ends. Please kindly assist! 

 

 

 

 

Download All
0 Kudos
Message 3 of 3
(2,662 Views)