LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous plotting of sensor data from Arduino

Hi, I am doing a project which involves monitoring the pH, level and temperature of water in an aquarium. I am using the Arduino Uno along with the following three sensors which are connected to it:

Ultrasonic Ping Distance Sensor:

http://www.parallax.com/product/28015

DS1B20 one wire temperature sensor:

https://www.sparkfun.com/products/11050

pH probe along with Atlas Scientific pH stamp Circuit:

http://www.atlas-scientific.com/product_pages/embedded/ph.html

I already have sketches which can display the readings of the sensors on the serial monitor of the Arduino but I would like to create a GUI to display three graphs simultaneously, all of them with respect to time, so that I can see how the three paramters affect each other.I'm not sure if I should go about pulling the data from the three sensors by using LIFA or by simply reading the data from the serial reader in labview. Can someone please give me some advice or show me how I can begin creating this GUI in labview. I am a not experienced with labview and any help would be greatly appreciated.Thanks.

0 Kudos
Message 1 of 3
(4,829 Views)

If you have an aruino sketch running on your device which sends data through serial monitor,then it is better to use serial VISA functions directly.
But in order to plot data continously without delays you have to make sure that your serial data from arduino is updated at considerable speed.

-----------------------------------------------------------------------------------------------------------------------------
Waiting For the inner calling 🙂


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

Thanks. I uploaded my code for sensing the temperature and did a GUI to plot the temperature in real time however, the time that the temperature is being displayed and the time used in the waveform chart are not in synch. Hence, I keep getting continuous spikes of data.  Can you please tell me what I am doing wrong. Or if this method is too dificult, does anyone know of a vi that I can use for the DS18B20 temperature probe for LIFA?

Arduino Sketch:

// Load Libraries for DS1820 and OneWire

#include<OneWire.h>

#include <DallasTemperature.h>

// Variables for temperature readings

float myTemp;

//float myHighTemp;

//float myLowTemp = 50;

// DS1820 Data wire is plugged into pin 4 on the Arduino

#define ONE_WIRE_BUS 4

// Setup oneWire instance to communicate with devices

OneWire oneWire(ONE_WIRE_BUS);

// Pass oneWire reference to Dallas Temperature.

DallasTemperature sensors(&oneWire);

void setup()

{

Serial.begin(115200);

   // Start the OneWire library

   sensors.begin();

}

void loop()

{

  // Read the temperature

  readtemp();

  // Write the Results to the serial Monitor

  serialPrint();

}

void readtemp()

{

  // call sensors.requestTemperatures() to issue a global temperature

  // request to all devices on the bus

  sensors.requestTemperatures(); // Send the command to get temperatures

  myTemp = (sensors.getTempCByIndex(0));

}

void serialPrint()

{

//Serial.print("Current Temp: ");

Serial.println(myTemp);

delay (10);

}

serial_read.PNG

0 Kudos
Message 3 of 3
(3,695 Views)