Introduction: RPM Measurement Using Hall Sensor and Arduino
In continuation with my previous instructable, RC Car that you can find on this link
I've decided to upgrade the car with RPM measurement using Hall sensor and a neodymium magnet. In the following steps I'll describe the parts needed for the setup and will provide the code.
I did not encounter a good Instructable about RPM measurement with Hall sensor on this site so I hope it will provide valuable information for the potential readers.
Step 1: Parts
- first of all you will need a Hall sensor, I am using a SS461A Honeywell latching Hall sensor. I found it in my local store but you can use any one, order it on ebay or buy it local too. If you are not familiar what does a "latching" sensor mean, google the types of Hall sensor and you will find your explanation
- next you will need a magnet which would rotate on the shaft of the motor and when it comes close to the sensor, it will trigger it. I use a neodymium magnet I collected from an old hard drive, but you can order them from ebay too in large amounts, or you can try to use a different magnet, but it may not be strong enough to trigger the sensor
- you will also need a 10K resistor
- since I am just upgrading my RC car, I have all the rest of the components needed already, but if you are doing this project solo, you will also need :
- an electrical motor
- some kind of driver to drive it
- power for your micro and the motor
Step 2: Setup for the Magnet
I have 3D printed a case for my magnet. It has a hole to fit the magnet and a hole to place it on the shaft of the motor
Step 3: Setup for the Sensor
I also 3D printed the setup for the sensor, with a hole to fit the sensor connected to Dupont wires, and 2 screw holes to attach it to the main car setup.
Step 4: Connect the Sensor to the Micro
Connect the sensor to the micro in a way described on the picture.
The main point is to connect the VCC to the power, GND to ground, then connect the VCC to the signal with a 10K resistor, you can do it on the board like I did on the second picture, and connect it all to a pin on your micro (yellow wire on the picture).
Step 5: Final Setup
As you can see on the picture, the magnet is currently away from the sensor, but when the motor starts spinning, it will pass next to the sensor and trigger it, triggering the interrupt in the code and you will get your rpm count.
Step 6: The Code
I will attach the code I used.
I also used LCD to display the results, but you can use Serial Monitor too.
I also use the IR remote to change speed of the motor (I change the PWM signal +/-20) to check if the code and the setup is working.
On the first picture you can see there isnt any noise in the incoming signal, unlike the optical encoders, and in the second picture you can see the final result in my case.
I hope you learned something new and that you will use it too in your future projects :)