I am trying to measure the rpm of a dc motor by installing a hall sensor across a wheel connected to the motor. The wheel has four small gaps at equal intervals; the hall sensor gets demagnetized when it is across these gaps and gets magnetized again as it is away from these gaps. Meaning, the sensor is sending digital highs and lows (switching from 0V to around 5V) signal.
For measurement, I am using NI 9401 module placed at slot 6 on NI cDAQ-9178 chassis and the sensor is connected to pin 16 (PFI1) of the module.
When I check these signals using DAQ Assistant > Acquire Signals> Digital Input, I can see that the program is showing me the highs and lows correctly and results are given in the form of a ‘1D array of booleans’ in LabVIEW.
Now, when I use ‘counter input’ instead in the DAQ Assistant so that I can measure the frequency of these digital signals, the test run always gives me rapidly changing numbers around a certain value and this value does not change as expected if I speed up or down the dc motor. Additionally, the waveform chart also does not give a true representation of frequency as you can see in the picture below. The range of my frequency is 1-300 Hz and I am using 1 counter low frequency method. I am wondering how I can get correct frequency reading by this method, or alternatively, if I can somehow convert the ‘1D array of Booleans’ result into a frequency reading if I use the ‘Digital Input’ method. I am new to programming in LabVIEW and apologize if I have not worded the problem properly.