Store

Adafruit

$24.38 |
Out of stock
No reviews yet

The first step in a robotics project is to get a motor spinning. Once you've done that you quickly learn that not all motors go the same speed, even if they ...

Get notified when back in stock

Qty
Estimated Delivery
Arrives
Disclaimer
View Markdown
Secure checkout

The first step in a robotics project is to get a motor spinning. Once you've done that you quickly learn that not all motors go the same speed, even if they are the same part number! There are always variations that relate to voltage, environment, and manufacturing changes. So, the second step is to figure out how fast it's going! Turns out that's not so easy, but the best way to get started is to add an encoder wheel and an optical or magnetic counter. As the motor turns, the attached encoder wheel spins, causing the counter to detect each passing spoke and that lets your microcontroller count and determine speed.

If you want to do one better, add a second counter, and now you can tell direction as well as speed! All this wiring is kind of a pain, so that's why this motor is really nice! It has a magnetic wheel and two hall effect sensors already attached. Using this motor is a breeze, and it's a nice small motor as well, in the 'standard' N20 size.

Provide 4.5 to 6V DC (nominal) to the white and red wires - these connect to your motor driver, and can be PWM'd for speed adjustment and direction by using an H-bridge.

Connect the black wire to your microcontroller ground pin, and the blue wire to 3-5V DC (we tried both, works fine) use whichever voltage your microcontroller uses. Then you can read the hall effect outputs on the yellow and green wires. We have an example sketch here for Arduino, it can be adapted to other languages - basically you just want to interrupt on one of the encoder pins, use count the time since the last interrupt, and multiply the count time by 14-counts-per-revolution and the gear ratio.

This particular DC motor comes with 1:100 gear ratio, uses 6V nominal power for the motor and draws about 100mA (200mA when stalled). The gear ratio will not affect the current draw but does change the torque and RPM. See below for the no load/rated/stall current, RPM and torque for a range of ratios!

 

https://www.youtube.com/embed/cfO7Sk1Ga2A?start=830

Jargon buster

Plain-language definitions for the technical terms used above.

encoder
A device attached to a motor or shaft that reports movement, such as rotation steps or position. In a pump system, an encoder can help measure or control how much the motor has turned, which affects how repeatable the watering amount can be.
microcontroller
A microcontroller is a small computer on a chip that runs your program and controls connected inputs and outputs. For this product, it is the part that reads buttons and sensors, drives the display and speaker, and communicates over Bluetooth.
motor driver
An electronic circuit that lets a low-power controller switch and control a motor that needs more current than the controller pins can safely provide. Checking motor driver support matters because pumps and motors usually cannot be connected directly to a microcontroller output.
PWM
Pulse Width Modulation is a way for a digital pin to simulate variable output power by switching on and off very quickly. It matters for controlling things like LED brightness, motor speed, or servo-style signals from a microcontroller pin.
Torque
A twisting force that causes something to rotate, usually measured in newton-metres or kilogram-centimetres. It matters when choosing motors, servos, gears, and tools because higher torque is needed to lift heavier loads, turn larger wheels, or move mechanisms without stalling.

Related Tutorials

Free guides on learn.littlebird.com.au

Stella
Stella Expert

Ask me anything about this product

Maddy, co-founder of Little Bird

Need help? We're here for you!

Hi, I'm Maddy. My team and I are ready to help with your order or any questions.