LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting wrong data from NI USB 6001?

I created a ohm meter as done with the arduino in this link (https://www.circuitbasics.com/arduino-ohm-meter/). However, my unknown resistance will be found from a  coil of a relay. I have another relay (control relay) that I am using as a switch as you can see in the picture below.

GRCK5000_0-1675387022644.png

For some reason, the resistance of the coil is not consistent. It would jump from 152 ohms to 135 ohms then back to 154 (at room temperature). What could be the reason? I can't think of anything else besides blaming NI USB 6001. How to prevent this jumping. I have attached my code.

 

P.S.: Vin = 5V coming from a power supply.

 

 

0 Kudos
Message 1 of 3
(576 Views)

Lacking careful sequencing, I suspect you're sometimes catching part of the transient that coils produce when you suddenly disrupt their source of current.

 

I made minimal mods to your code to control the sequencing better.  First a voltage reading is taken, then the new relay state is written, then the 100 msec wait starts (giving the circuit time to settle before you iterate for the next cycle).   Try it out, see if it helps.

 

The circuit itself could be improved too, I'm sure, but I'll let those with better expertise comment on that part.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 2 of 3
(551 Views)

Thanks a lot Proven_zealot! I'll give it a try.

I noticed you mentioned transient that the coils produced. So I went ahead and did some research on it. It's very interesting, something worth taking note for. I read one of the ways to prevent transient or surge voltage is to use a diode (flyback diode) across the ground and input voltage. That's something I will also try to do. Thank you very much for your help!

By the way, for my control relay I am using one that looks like this below, but the coil voltage is 5Volts.

GRCK5000_0-1675397085029.png

 

0 Kudos
Message 3 of 3
(542 Views)