LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My arduino voltage readings do not match the voltage on the power supply? See attached VI

For example, when I try to have arduino read 5 volts coming from the power supply, it would read 1.2 V as you can see on the waveform chart below. What am I doing wrong? Also, I'm using the example from the Linx package. 

GRCK5000_0-1685476461372.png

Code

GRCK5000_1-1685476494176.png

 

 

 

0 Kudos
Message 1 of 4
(840 Views)

Which Arduino board are you using? And is your power supply input properly grounded? A lot of bench power supplies generate floating voltages, so you may need to tie a wire from the (-) terminal to the Arduino's ground.

0 Kudos
Message 2 of 4
(819 Views)

Hi BertMcmahan ,

thanks for answering. Yes, I connected the negative of the power supply to the ground. I am not sure what is going on. I am using arduino uno.

0 Kudos
Message 3 of 4
(745 Views)

I wonder if it got set to use the 1V reference instead of the 5V reference. This is an older Help file but it might be something to look at:

 

https://www.labviewmakerhub.com/doku.php?id=learn:libraries:linx:reference:labview:analog-set-refere...

 

In short, the ADC actually measures a value relative to a reference voltage and returns that value. If your input is pegged at 1V, then you might be measuring relative to the 1V reference.

 

There's also an external input (AREF) that can be used for comparison: https://www.instructables.com/The-Arduino-AREF-Pin/

 

I haven't used it myself. Is there any chance something's connected to your AREF pin? Or is the Uno completely by itself? If you have a shield on it, that shield might be doing something to that pin.

 

Unfortunately I can't find good documentation for the LINX toolkit to know what analog reference it uses by default, but going by this page (https://reference.arduino.cc/reference/tr/language/functions/analog-io/analogreference/) I can assume that "Default" uses the internal 5V reference, "Internal" uses the internal 1.1V reference, and "External" uses the AREF pin.

 

Your system is acting like it's using "Internal", so maybe try explicitly setting it to "Default".

 

I don't have the LINX toolkit installed or I'd give it a go myself, sorry.

0 Kudos
Message 4 of 4
(708 Views)