01-07-2024 10:22 AM
I connected ZMPT101B voltage sensor to Arduino and got 0 - 5VAC reading. I have written a simply code to display Vrms value. This is the code.
#include <ZMPT101B.h>
#define SENSITIVITY 735.0f
// ZMPT101B sensor output connected to analog pin A0
// and the voltage source frequency is 50 Hz.
ZMPT101B voltageSensor(A0, 50.0);
void setup() {
Serial.begin(115200);
voltageSensor.setSensitivity(SENSITIVITY);
}
void loop() {
float voltage = voltageSensor.getRmsVoltage();
Serial.println(voltage);
delay(1000);
}
I want to read this voltage number using LabView. How can i do this. This is the sample Vi file that i create to read the analogue reading. But i want to read this voltage number. Serial.Println (voltage);
Solved! Go to Solution.
01-07-2024 12:07 PM
01-08-2024 09:23 AM - edited 01-08-2024 09:49 AM
In general there are three ways of using LabVIEW with an Arduino
01-08-2024 09:41 AM
@RTSLVU wrote:
- Use LINX Now called the LabVIEW Hobbyist Toolkit (LIFA has long since been deprecated)
- Full LabVIEW integration
- Limited amount of Arduino libraries and peripherals directly supported
- The Arduino basically becomes a USB DAQ device that always needs to be connected to a computer.
An additional comment on LINX with the Arduino. The LINX library uses a set sketch for the Arduino. The LabVIEW driver then uses the commands pre-defined in the sketch to make it do what is needed. If you write your own sketch, the LINX libraries will not work. At that point, just do the simple VISA Read to get the data coming from your Arduino.
01-08-2024 12:08 PM
Thank you. I am building a power analyzer. So, I needed to analyze the graph using LabVIEW. That's why i took analogue reading for further analyses. But thank you for your idea. I will do in that way.
01-08-2024 05:09 PM
@crossrulz wrote:
@RTSLVU wrote:
- Use LINX Now called the LabVIEW Hobbyist Toolkit (LIFA has long since been deprecated)
- Full LabVIEW integration
- Limited amount of Arduino libraries and peripherals directly supported
- The Arduino basically becomes a USB DAQ device that always needs to be connected to a computer.
An additional comment on LINX with the Arduino. The LINX library uses a set sketch for the Arduino. The LabVIEW driver then uses the commands pre-defined in the sketch to make it do what is needed. If you write your own sketch, the LINX libraries will not work. At that point, just do the simple VISA Read to get the data coming from your Arduino.
That's a good point I have updated my generic Arduino and LabVIEW response to better clarify that it