LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get voltage from sensor analog input on labview

Hi, i am newbie here, i am doing my minor thesis about how to detect CO, Methane, and dust particle (PM10) with MyRio and labview. for sensor I am using mq 7 for detect CO, mq 4 for detect methane and sharp dust sensor g2yp1010 for dust particle. I am confused about how to get voltage from those sensors in labview. I already used AC DC estimator  PtByPt.vi but the value that I get is small value that smaller than 1.221 volt that minimum voltage if using 5 volt as supply. For example, in datasheet Sharp dust sensor, to get right dust density we using divide between voltage and dust density (open image file). in the graphic we know the smallest voltage is 0.9 to get smallest density. but in my code i get value 0.01 till 0.09 (using AC DC estimator  PtByPt.vi). please teach me, I dont know what to do about this.

 

0 Kudos
Message 1 of 13
(7,377 Views)

Hi idekwntdne,

 

I am confused about how to get voltage from those sensors in labview. I already used AC DC estimator  PtByPt.vi

To "get" the voltage I would connect the sensor to some analog inputs of your myRIO board. Did you?

How did you connect the sensors?

Do those sensors need additional power supply? (Mind to provide a full manual of the sensor or atleast a link providing more information?)

How do you read the analog signals in your myRIO? Mind to attach your VI/snippet?

Why are you talking about this AC/DC-Estimator?

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 13
(7,332 Views)

Hello idekwntdne,

 

when all sensors are properly attached to the myRIO- device, you can use the Measurement and Automation Explorer (MAX) to check the values. It gives you a lot of options to check the settings.

 

Greets, Dave
0 Kudos
Message 3 of 13
(7,328 Views)

thanks for the respon, I am sorry I am not mention all additions in the question. 

I connected all sensors pin on MyRio MSP A pin,because all the input of sensors is analog, so I am using analog input pin (3,7,9). You can take a look at the image (myrio). Yes, all sensors need 5 volt as Vin, I used 5v in MSP A for dust sensor, 5v in MSP B for CO sensor and 5v in MXP pin for sensor Methane. and the code that i use to processing the signal is in image (code: all sensors got same code to process analog signals). because I need to know how many volt that sensor use when detecting or not detecting, so that's why i use ac/dc estimator to know it, but the value that i get is different from what I expect (based on the sensitivity graph of sensors). So far, that's what I did.

Download All
0 Kudos
Message 4 of 13
(7,317 Views)

Hi idekwntdne,

 

did you wire any of the GND pins? (See page 4&5 of the myRIO manual…)

 

because I need to know how many volt that sensor use when detecting or not detecting, so that's why i use ac/dc estimator to know it,

I still don't get why you use the estimator function.

Why don't you just use the voltage reading you get from the analog inputs???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 13
(7,308 Views)

hey, thank's for respon again, I am so glad.

uhm yeah I did, I wire GND pins. I am using AC/DC estimator to get the voltage from analog signal. I think that's the way to get voltage from sensor.

I usually use arduino as microcontroller, to get voltage from analog sensor in arduino we used ADC like this formula " Vout = analog signal*5v/1023; ". I thought using ac/dc estimator is the same way to get the voltage like I used arduino. is it right? 

First, i tried to implement the circuit to arduino using IDE sketch, and everything is alright i got the voltage and also the result of sensitivity same as sensitivity graph. But, after implemented on Myrio and using IDE labview the result make me confused. 

0 Kudos
Message 6 of 13
(7,292 Views)

Hi idekwntdne,

 

I am using AC/DC estimator to get the voltage from analog signal. I think that's the way to get voltage from sensor.

Why do you think so?

To get the voltage you just have to read the corresponding input pins!

 

to get voltage from analog sensor in arduino we used ADC like this formula " Vout = analog signal*5v/1023; ". I thought using ac/dc estimator is the same way to get the voltage like I used arduino. is it right?

No, it's wrong.

 

Did you read the help for AC/DC estimator to really know what this function does?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 13
(7,270 Views)

yes I already read the help for AC/DC estimator from labview application and from the site http://zone.ni.com/reference/en-XX/help/371361J-01/lvanls/ac_and_dc_estimator/

 

based on my senior paper about labview and myrio, he implemented a sensor that have analog input, to get the voltage from the sensor he used AC/DC estimator.

 

0 Kudos
Message 8 of 13
(7,257 Views)

Hi idekwntdne,

 

don't use the estimator when you only need the raw voltages.

 

Or ask your "senior paper" why he used that function!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 13
(7,243 Views)

Hey, Thank you so much, I really appreciate your help.

So, if I want to get raw voltage, I just connect an analog input from sensors to MSP analog pin on myrio and multiply analog input with 1.221 volt. is it right?

0 Kudos
Message 10 of 13
(7,221 Views)