This project is an RPM sensor example using embedded Rust, Arduino Uno R3, and a hall-effect sensor. This project builds on the avrs-hall-sensor project so you may want to review that project prior to starting this project for environment setup and build instructions.
The parts list below is for the project as described here. You may substitute a different motor; however, you would then need to build your own motor and sensor mount.
- Arduino Uno R3
- A3144 Hall Effect Sensor
- 10kΩ Resistor
- Jumper wires
- L9110S DC Motor Drive Module
- 4mm x 1mm neodymium magnet - 2ea
- 0-6V 5000RPM Mini Motor
- M3 6mm Nylon Standoff - 4ea
I have the Arduino powered through USB power. You have several options for supplying power to the motor controller. I have the parts listed for 2 options:
5V Power Supply
- Lithium Battery Shield Micro USB
- 18650 Li-ion Battery - 2ea
6V Power Supply
- Voltage Regulator
- 7.4V LiPo or Li-ion Battery
In addition you will need appropriate connectors and wiring for the power supply. I show both options in the construction guide.
We printed a motor mount that holds the motor, a flywheel with magnets, and a Hall Effect sensor for this project. The construction guide explains the basic assembly process.
NOTE: I have observed some variability in the hall effect sensors used. Once the mount is completed and wired up you may need to adjust the distance between the flywheel and the sensor if you are getting inconsistent detection results from the sensor.
This project uses the same environment I setup in the avrs-hall-sensor project. I suggest reading through the setup guide in that project prior to starting this project if you do not already have a Rust AVR build environment setup.
Once you have successfully installed the application and have the motor running you should enable the serial monitor in the Arduino IDE. You should see something like the following output:
If you do not see this output you might want to check your wiring by running the avrs-hall-sensor project and manually turning the flywheel to ensure that you are getting detection events.