LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems in getting signals from Hall Sensor through NI-9401

Dear all,

 

I am facing problems when I am trying to connect a Hall sensor (12 VDC) to NI 9401. I am using 14(DIO) and 1(COM) pins, and connecting my Hall sensor to a DC source. I am trying to get the signals by passing the magnet, to alter the magnetic field yielding no result. What do you guys think could be the issue?

 

Best regards,

LaxG

0 Kudos
Message 1 of 21
(4,292 Views)

@LaxG wrote:

Dear all,

 

I am facing problems when I am trying to connect a Hall sensor (12 VDC) to NI 9401. I am using 14(DIO) and 1(COM) pins, and connecting my Hall sensor to a DC source. I am trying to get the signals by passing the magnet, to alter the magnetic field yielding no result. What do you guys think could be the issue?

 

Best regards,

LaxG


What is the spec of the sensor? If I understood correctly, it needs 12V DC drive, and it gives out a digital signal depending on the direction of the magnetic field?

Do you try to do DAQ using a VI? If so, you can upload it here, so people can have a look at it.

 

Did you try to check the above mentioned DIO channel using the MAX? If it works there, you have a problem with your VI(s). If not, try to check the same DIO channel with another digital source.

If that works, it may happen your sensor is malfunctioning.

0 Kudos
Message 2 of 21
(4,257 Views)

Dear Blokk,

 

Thanks for the prompt reply..

 

Please find the attached VI, that I have used for signal acquisition. I have got a new sensor with me, so the possibility of it malfunctioning is slim.

 

However, I have managed to acquire the signal, and the acquisition is random, sometimes I can see it in MAX, sometimes I dont. I have also tried changing the pin for another channel, still the same result.

I am only using the DIO 16 pin and nothing else, do you think that could be an issue?

 

Ultimately the aim is to get it integrated with the labview program that we have here and use it for measuring the rotational speed.

 

Best regards,

LaxG

0 Kudos
Message 3 of 21
(4,241 Views)

Hello,

 

I am not familiar with edge counting, I guess here you want to count motor rotations? The VI you posted contains an Express VI, which is OK for prototyping, but you should use proper DAQmx programming for real working projects, you can avoid some headaches 🙂 (for example you do not have to deal with the crazy dynamic data wire...)

 

As I see here the DAQ Assistant express VI is configured to have acquisition mode: "1 Sample (On demand)". The problem is that, you do not put any software timing in the while loop, so your computer try to run the loop as fast as possible. And sometimes the DAQ can "catch" a rising edge, but usually not.

 

Still, I am not familiar with such applications, I just try to explain (I hope correctly) what I read at the Express VI's help doc. Please someone with better DAQmx skills correct me, if I am wrong!

 

So the help tells you this:

"When doing on-demand edge counting, each subsequent read returns the number of edges counted since the counter was started. If you perform multiple reads without first starting the counter, the counter implicitly starts and stops with each Read function/VI call, and the number of counted edges is not cumulative between read calls."

 

So could you try to put a timing in the while loop, like below, and run your application with the rotating magnet? Lets say, you count what happens during 1 sec acquisition in this way.

digital_snippet.png

 

Of course there is a better way to do digital edge counting for such application,

check out the LV examples!

(C:\Program Files (x86)\National Instruments\LabVIEW 2012\examples\DAQmx\Counter Input\Counter - Count Edges.vi):

 

digital_snippet_DAQmx.png

 

 

0 Kudos
Message 4 of 21
(4,234 Views)

Dear Blokk and all,

 

Thanks for the elaborative reply. Yes, I am using it for measuring rotational speed of a shaft.

 

I have tried attaching the time stamp in the DAQmx, again it shows sporadic results.

 

I have also tried using MAX, the acquisition in MAX is not uniform, it counts but shows these counts after a certain amount of time.

 

While I was taking these measurements, I have not attached the COM/NC pins.

 

Any other suggestions are welcome.

 

Best regards,

LaxG

 

 

0 Kudos
Message 5 of 21
(4,203 Views)

If you are sure you connect everything properly to your NI DAQ hardware, I would check the digital output of the Hall-sensor during a real measurement, using a real oscilloscope. If the sensor works properly, and your rotation speed is constant more or the less, you should see steady state square waveform on the oscilloscope. So in this way you could pinpoint or eliminate the possibility of sensor problem.

What sporadic result means? You see a fluctuating counter value?

In your configuration what is the rotation speed or frequency?

 

 

I have also found this (http://forums.ni.com/t5/LabVIEW/Encoder-speed-and-orientation-on-NI-9401-in-cDAQ-9172/m-p/1325879/hi... post, where they had some difficulties with higher rotations (above 1 kHz), and it is explained there how to fix it...However I do not know if this is the case here...

Hmm, but I think the linked post explains a measurement using digital encoder, and you use Hall-sensor...I do not know if they have the same type of outputs or not...

0 Kudos
Message 6 of 21
(4,198 Views)

LaxG,

 

Does your Hall sensor generate true logic level and logic timing transitions or does it generate a square wave with rise times in the microsecond or slower range? If the latter, you may need to use an analog input and process the waveform in software or place a hardware comparator between the sensor and the lgoic inputs. Many logic devices cannot handle slow rise times.

 

Lynn

Message 7 of 21
(4,196 Views)

 

 

Dear Blokk, Johnsold and other members,

 

Sorry for the late reply...

 

Sensor:

 

I am using a 3 pin Hall sensor which is used for measuring the position and speed of crankshafts in Automobile engines.

 

Sensor connection explanation:

 

I have tried to connect the sensor to the NI 9401 which is connected to NI cDAQ 9178 in the sixth slot (does location of slot alos matter ?). The pin 14 is connected to the output cable of the hall sensor, the COM pin 1 is connected to the -ve DC Volt supply cable. The left one is connected to the + DC volt supply.

 

After the connection is complete, I am trying to check for edges in NI MAX by going to the test panel. Please find a screen shot for this.

 

I am getting signals sometimes but not consistently.

Could anybody who has worked with the same problem suggest me another sensor. The speed that I want to measure is of the range of 0 - 3000 RPM in room temperature.

 

Best regards,

LaxG

 

 

0 Kudos
Message 8 of 21
(4,144 Views)

"I am using a 3 pin Hall sensor which is used for measuring the position and speed of crankshafts in Automobile engines."

"The left one is connected to the + DC volt supply."

 

Could you describe precisely your sensor (link or data sheet), and its terminals? Also describe what you connected to what, maybe I am too tired, but I do not get it clearly...

0 Kudos
Message 9 of 21
(4,134 Views)