Hall Effect Sensor By: John Muratore, Research Associate Professor, Aviation Systems and Flight Research, University of Tennessee Space Institute William Moonan, Graduate Research Assistant, Aviation Systems and Flight Research, University of Tennessee Space Institute Joseph Young, Graduate Research Assistant, Aviation Systems and Flight Research, University of Tennessee Space Institute Approach As a test article we will be using a Lego motor to which a bar magnet has been attached. This will excite a Hall effect sensor. Every time one of the ends of the bar magnet rotates past the switch, it will switch state. By counting the number of times the switch changes in a second and dividing by 2, the rotation rate per second can be determined. We will use the protoboard and mydaq for our data acquisition in this task. Hall Effect Switch The Hall effect switch consists of a piece of semiconductor to which a chemical has been added to make it sensitive to magnetic fields. This produces a small electrical signal which is detected and amplified in the chip. The Hall effect switch actually only switches on the south pole passage of the magnet. The bar magnet is mounted on the gear of the Lego motor such that the north-south pole axis is aligned with the shaft of rotation. This results in a switch whenever either end of the bar passes the Hall Effect switch. This sensor can be purchased from Paralax Instruments at http://www.parallax.com/storesearchresults/tabid/768/list/0/sortfield/4/productid/90/ Default.aspx?txtSearch=hall+effect Lego brand motors are available at most toy stores. 1
Step 1 - Wiring The Hall Effect switch consists of a small square housing for the integrated circuit. Note that the switch is in itself magnetized. The pinout for the switch is as follows : Lettering on face Pin 3 +5 V DC input power Pin 3 Output Pin 2 Ground 2
This should be wired as follows : mydaq AI0- AI0+ 7805 5.6 kohm Hall Effect Sensor AGND +15 Lego motor 10 micro-farad capacitor Lego battery pack NOTE: Make sure mydaq is not plugged into the USB port while wiring the +15 VDC/GND pins; if it is, simply unplug the mydaq and plug it back in after the wiring process is completed. 3
Developing the software Step 2 First open LabVIEW and select the block diagram display. Then define the DAQMX channel by selecting the Create Channel Function from the DAQMX function on the Measurement Section of the Function Palette.. It should then be wired by selecting the wiring function off the tools menu and right-clicking on the required functions and creating controls on the front panel associated with - input terminal configuration - minimum value - maximum value - physical channel On the front panel, the input terminal configuration should be selected to differential. The minimum value should be set to 0. The maximum value should be set to 5 and the physical channel should be set to Devx/AI0 4
Step 3 Then select the DAQMX read function and place on the block diagram, wiring from the create channel function to the DAQMX read as seen below and create an indicator on the front panel for the output Step 4 Place the read in a while loop and control the execution of the while loop with a Boolean on the front panel as follows: Step 5 Then add the DAQMX stop function as follows at the output of the while loop so that it executes when the stop button is pressed on the front panel and a dialog decode box from the dialog sub palette on the function palette so that any error messages will be displayed when the stop button is pressed. 5
Step 6 On the Front Panel select a waveform chart off the Controls palette and place on the front panel. On the block diagram, wire this to the output of the read function as follows. 6
The front panel should look like the following Step 7 Now run the VI. Place the motor with the gear facing the lettered side of the Hall effect switch and observe the results. You will have to place the gear with the magnet very close to the Hall effect switch. It may be helpful to place a jumper over the Hall effect switch so it doesn t jump around very much in response to the changing magnetic field. The result should look like this 7
Step 8 With the loop running the sampling at 1 sample at a time, it is hard to get a good capture of the rotation. To fix this we will insert some timing into the data acquisition and let the data acquisition hardware buffer the data acquisition. From the DAQMX sub-palette, place the timing function on the block diagram. Wire the samples/channel and rate to 1000. Also change the read function to be a single channel multiple samples acquisition and add 1000 to the number of samples per channel. This will acquire 1000 samples over one second period. Once that is done, you have to change the waveform chart to a waveform graph and change the output variable data from a scalar to an array. Once that is done it should look like 8
And when you run it while running the motor it should look like Step 9 To determine the RPM, all we need to do now is count the number of pulses in ARRAY, divide by 2 to get revolutions per second and multiply by 60 to get the Revolutions Per Minute or RPM. To do this, we will post-process the ARRAY after it is acquired by using a FOR loop and use a CASE statement to determine if we have found another pulse to count. First place a FOR loop on the block diagram. Then wire the number of samples into the loop. Wire the ARRAY into the FOR loop and leave the auto indexing enabled (indicated by [] on the loop terminal). Take the elements of the ARRAY and add a comparison to determine if the value is GREATER THAN 2. Wire the output of this comparison into the selection input for a CASE structure. Add 2 shift registers to the FOR loop. One of the shift registers will keep the count of the pulses. The other shift register will hold a Boolean that will keep track of whether the signal was in a high or low state on the last pass of the FOR loop. Basically the case statement will work by only incrementing the count of pulses when the value in ARRAY is greater than 2 volts and when it was less than 2 volts on the last value of the array (last pass of the FOR loop). Initialize the shift register for the pulse count to 0 by placing a numeric constant outside the shift register and feeding it to it. Program the TRUE and FALSE cases as below 9
Divide the output of the pulse count shift register by 2 and wire to an indicator on the front panel to display the revolutions per second. Give this a try and record the number of revs/per second. Then modify the VI to multiply the revs/second by 60 and display RPM. 10
Your final display should look something like this Data There are two LEGO motors that we are working with. The first is the original LEGO motor (2838) and has high RPM but low torque. The second (5292) is a more modern motor which has higher torque but lower RPM. There are two locations for connecting an axle to this motor. The innermost connection has higher RPM than the outer. 11
The performance of these motors is documented at www.philohome.com. 12
AS 508 Lab 8 Hall Effect Sensor Name 1. Which motor has highest RPM? 2. What is the difference in RPM between the two shaft outputs of the 5292 motors? 3. Are the RPMs recorded in your experiment higher or lower than those reported on the wwww.philohome.com website for an equal voltage? Plot your observations on the plots from the website. 4. What is another sensor typically used to determine rotation rate of a shaft? 5. How could this magnetic sensor be modified to determine direction or rotation of a motor? To determine position? 6. What other types of sensors could you use other than the magnetic characteristics of the Hall effect switch to count pulses as the shaft rotated? 7. What LabVIEW function would you use if you needed to detect and track the maximum RPM observed? 8. What LabVIEW function would you use to time the performance of the data acquisition loop? 9. What LabVIEW function would you use to compute the mean and standard deviation of the observed RPM? 13