When we deal with controlling motor speed, normally we just provide PWM and the motor will rotate accordingly to the voltage reach at motor terminal. To have a better speed controlling, we can monitor RPM. Revolutions per minute (abbreviated rpm, RPM, rev/min, r/min) is the number of turns in one minute. It is a standard unit of rotational speed or the frequency of rotation around a fixed axis.
To monitor RPM, we need to have a feedback or sensor to sense shaft rotation. Luckily, nowadays, there have many DC motor in the market comes with built-in hall sensor encoder attach to the motor shaft. There have a few options offered by Cytron Technologies:
How it works? Please check on this video.
This tutorial uses:
- Maker UNO
- Cytron 10Amp DC Motor Driver
- DC Motor IG42E-24K
- Planetary Motor Bracket (IG42E/IG45)
- LiPo Rechargeable Battery 11.1V 2200mAH
- 2-3 Cell LIPO Balance Charger
You can make hardware connection based on the table below.
|MD10C: +||Battery +ve|
|MD30C: –||Battery -ve|
|MD30C: A||Motor red/black wire|
|MD30C: B||Motor red/black wire|
|MD30C: GND||Maker UNO: GND|
|MD30C: PWM||Maker UNO: pin 10|
|MD30C: DIR||Maker UNO: pin 12|
|Motor brown wire (Hall sensor VCC)||Maker UNO: 5V|
|Motor green wire (Hall sensor GND)||Maker UNO: GND|
|Motor blue wire (Hall sensor A)||Maker UNO: pin 3|
|Motor purple wire (Hall sensor B)||Not connected|
This is sample code used in the video. Enjoy it!
Thank you for reading this tutorial and we hope it helps your project development. If you have any technical inquiry, please post at Cytron Technical Forum.