Hobby DC motors are small, versatile electric motors commonly used in DIY projects, model trains, RC cars, and robotics.
They offer hobbyists the ability to create custom motion systems and mechanisms for various applications, ranging from simple to complex projects.
In a DC motor, "DC" stands for Direct Current as it is powered by a direct current (as opposed to an AC motor, which is powered by alternating current). In a DC motor, the direct current generates a constant magnetic field, which then drives the rotor to produce continuous rotational motion.
Which of the following is a feature of DC hobby motors?
Motor Shields
A DC motor shield is an add-on board that interfaces with a microcontroller, such as an Arduino, to control one or more DC motors easily.
It typically includes motor driver chips, connectors for motor connections, and sometimes additional features like voltage regulation or current sensing.
This shield simplifies the process of controlling DC motors in projects by providing a convenient and reliable interface between the microcontroller and the motors.
Motor shields are required to:
Amplify the voltage output from the microbit to the 6v needed to power the motor
Protect the Microbit from current surges produced by the motors
Dissapate excess heat generated through the use of heat sink fins.
The is used to amplify the power supplied to the dc motor from the microbit.
Motor shield
DC Motors vs Continuous Servos
DC Motors
Requires additional circuitry for speed and direction control.
Generally higher torque.
Continuous Servos
Controlled directly by a control signal (e.g., PWM), simplifying control.
Provides continuous rotation at variable speeds in both directions.
Typically lower torque.
Less precise control due to simplified control method.
Suitable for applications requiring continuous rotation, such as robot wheels and rotating displays.
The direction of rotation of a DC hobby motor can be reversed by swapping the of the connections.
DC Motors can controlled using either digital (0 to 1) or analogue (0 to 1023) output signals send along the GPIO pins.
Digital write 1 = 100% torque (turning force)
Digital write 0 = 0% torque
Analogue write 512 = 50% torque
Wiring up a DC motor using a breakout board
Here is how to wire up two DC motors to the Microbit using a motor shield.
Each of the GPIO pins connect to control pins on the breakout board, with each pin sending a low/high signal.
The motor shield then sends voltage to the motors depending on the signals (inputs 1 and 2 control motor A, inputs 3 and 4 control motor B)
DFR05 Breakout Board
The DFR05 is a breakout board for the Microbit the features a dedicated motor board driver which connects using the I2C protocol, meaning that most of the Microbits ports are left free for other purposes, such as for servos or sensors.
Advantages of using the DFR05 Board:
The wiring process is much simpler
More pins are left free for other purposes (like for servos or sensors)
DFR05 Breakout Board Wiring
Wiring up motors is much simpler with the DFR05 breakout board.
Coding the DFR05
Coding the Motors with the DFR05 is a bit easier too. You just specify the speed (0 to 255) and the directipon.
CW = Clockwise
CCW = Counter Clockwise
To rotate in the opposite direction, the polarity of the DC hobby motor's power source must be .