From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

RPM Measurement with Hall-Sensor on Arduino Uno

Hi guys, I'm new here and have only been using Labview for a few weeks. So my question is certainly very trivial, but I get no further.

 

The following: I would like to measure the speed of a shaft using a Hall sensor. To do this, a magnet sticks to the shaft, which then passes the Hall sensor. The sensor then just switches true if the magnet is there and false if not. I am using LabView 2019 and an Arduino Uno via the Linx tool.

 

On the Arduino, I connected the Hall sensor via the digital pin. Now my idea for speed measurement was that I stop the time and every time the sensor switches True, i.e. one revolution is over, the time is stopped, saved and converted into the speed is displayed in the GUI. The time is then restarted. At the next rotation the new time is stopped again, the old saved value is overwritten and output again in the GUI as the speed. The problem here is how to save the value. How can I save the stopped time as a constant and overwrite it next time? I've already tried various things with arrays and shift registers, but none of this was effective.

 

But probably the problem is simply my lack of Labview experience, so I am grateful for any help and tips! Thanks to everyone !!!!!

best regards

madalandria

0 Kudos
Message 1 of 2
(1,866 Views)

If I am understanding your issue I believe this is the change you need to make.  The solution is on the left and your original VI is on the right.

RPM VI DiffRPM VI Diff

 

In your VI you are passing the RPM to the shift register so on the next loop if you did not get a new revolution it will use the RPM as seconds and calculate the value again.  What you want to do is pass the seconds value to the shift register this way on the next loop you are determining to use the new seconds value or old seconds value and then calculating RPM.

 

There are multiple ways you can solve the issue as long as you make sure the units of the value being passed into Select function are the same.

David Wilt
The New Standard LLC
0 Kudos
Message 2 of 2
(1,750 Views)