
The initial step in a robotics project involves getting a motor to spin, revealing variations in speed due to voltage, environment, and manufacturing differences. To accurately measure the motor's speed, an encoder wheel can be attached, along with an optical or magnetic counter. This combination allows your microcontroller to count the passing spokes and determine speed efficiently.
Enhance your setup by adding a second counter to detect direction along with speed, simplifying the process with our specially designed motor. This motor, not only compact in the standard N20 size, comes equipped with a magnetic wheel and two pre-attached hall effect sensors, ensuring seamless integration.
The motor operates optimally with a 4.5 to 6V DC supply through its white and red wires, which connect to your motor driver and allow speed adjustment via PWM with an H-bridge. Ground the blue wire to your microcontroller, provide 3-5V DC to the black wire, and read the hall effect outputs from the yellow and green wires for precise feedback.
An example sketch is available for Arduino, adaptable to other programming languages, utilizing interrupts on encoder pins to calculate speed. This motor features a 1:150 gear ratio, requires 6V nominal power, and draws around 100mA, peaking at 200mA when stalled. The gear ratio adjusts torque and RPM without affecting current draw, providing versatility across applications.
| Brand | Adafruit |
| Model | 4640 |